From c94811f5649a0b35c78f96cd0bf412375b8612d5 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Wed, 9 Oct 2024 10:12:06 -0400 Subject: [PATCH 01/33] chore: sub mod --- .gitignore | 3 +++ .gitmodules | 6 ++++- branch-sync.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++----- hatchet | 1 - 4 files changed, 65 insertions(+), 8 deletions(-) delete mode 160000 hatchet diff --git a/.gitignore b/.gitignore index 6b15a2af..00831ae1 100644 --- a/.gitignore +++ b/.gitignore @@ -162,3 +162,6 @@ cython_debug/ #.idea/ openapitools.json + +hatchet-cloud/ +hatchet/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 2e2e6198..af5b788d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,8 @@ [submodule "hatchet"] path = hatchet url = git@github.com:hatchet-dev/hatchet.git - branch = main + branch = feat/iac +[submodule "hatchet-cloud"] + path = hatchet-cloud + url = https://github.com/hatchet-dev/hatchet-cloud.git + branch = feat/iac diff --git a/branch-sync.sh b/branch-sync.sh index e0ea9f87..bccdbcaf 100755 --- a/branch-sync.sh +++ b/branch-sync.sh @@ -1,5 +1,40 @@ #!/bin/bash +# Default values +mode="oss" +repo_url="https://github.com/hatchet-dev/hatchet.git" +submodule_name="hatchet" + +# Parse command line options +while getopts ":n:" opt; do + case $opt in + n) + mode=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +# Set the repository URL and submodule name based on the mode +if [ "$mode" = "cloud" ]; then + repo_url="https://github.com/hatchet-dev/hatchet-cloud.git" + submodule_name="hatchet-cloud" +else + repo_url="https://github.com/hatchet-dev/hatchet.git" + submodule_name="hatchet" +fi + +echo "Mode: $mode" +echo "Repository URL: $repo_url" +echo "Submodule name: $submodule_name" + # 1. Get the current branch name current_branch=$(echo $GITHUB_HEAD_REF | sed 's/refs\/heads\///') @@ -7,22 +42,38 @@ if [ -z "$current_branch" ]; then current_branch=$(git rev-parse --abbrev-ref HEAD) fi -# 2. Check a different repo and determine if a branch with the same name exists -git ls-remote --heads https://github.com/hatchet-dev/hatchet.git $current_branch | grep -q refs/heads/$current_branch +echo "Current branch: $current_branch" + +# 2. Check the repo and determine if a branch with the same name exists +git ls-remote --heads $repo_url $current_branch | grep -q refs/heads/$current_branch branch_exists=$? # 3. If it does, update the .gitmodules to set `branch = {the branch name}` if [ $branch_exists -eq 0 ]; then - git config -f .gitmodules submodule.hatchet.branch $current_branch + git config -f .gitmodules submodule.$submodule_name.branch $current_branch + git config -f .gitmodules submodule.$submodule_name.path $submodule_name + git config -f .gitmodules submodule.$submodule_name.url $repo_url git add .gitmodules echo "Updated .gitmodules with branch $current_branch" else - echo "Branch $current_branch does not exist in the remote repository. Pulling main branch instead." - git config -f .gitmodules submodule.hatchet.branch main + echo "Branch $current_branch does not exist in the remote repository. Using main branch instead." + git config -f .gitmodules submodule.$submodule_name.branch main + git config -f .gitmodules submodule.$submodule_name.path $submodule_name + git config -f .gitmodules submodule.$submodule_name.url $repo_url git add .gitmodules echo "Updated .gitmodules with branch main" fi -# 4. Initialize and update the submodule +# 4. Remove existing submodule if it exists +git submodule deinit -f -- $submodule_name +rm -rf .git/modules/$submodule_name +git rm -f $submodule_name + +# 5. Re-add and initialize the submodule +git submodule add -b $(git config -f .gitmodules submodule.$submodule_name.branch) $repo_url $submodule_name git submodule init + +# 6. Update the submodule git submodule update --remote --merge + +echo "Hatchet submodule ($mode mode) updated successfully" \ No newline at end of file diff --git a/hatchet b/hatchet deleted file mode 160000 index e046566d..00000000 --- a/hatchet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e046566db839e68e3a9c246dec4bbc6427d1bf75 From 8fa3c03f5ece879650db1e1e423cd761a38c3639 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Wed, 9 Oct 2024 10:16:02 -0400 Subject: [PATCH 02/33] chore: gen --- .gitignore | 2 +- branch-sync.sh | 2 +- generate.sh | 49 +- hatchet_sdk/clients/rest/__init__.py | 16 +- hatchet_sdk/clients/rest/api/__init__.py | 1 + hatchet_sdk/clients/rest/api/api_token_api.py | 21 +- hatchet_sdk/clients/rest/api/default_api.py | 42 +- hatchet_sdk/clients/rest/api/event_api.py | 1569 ++++------------- hatchet_sdk/clients/rest/api/github_api.py | 7 +- hatchet_sdk/clients/rest/api/log_api.py | 7 +- hatchet_sdk/clients/rest/api/metadata_api.py | 21 +- hatchet_sdk/clients/rest/api/slack_api.py | 14 +- hatchet_sdk/clients/rest/api/sns_api.py | 21 +- hatchet_sdk/clients/rest/api/step_run_api.py | 368 +--- hatchet_sdk/clients/rest/api/tenant_api.py | 105 +- hatchet_sdk/clients/rest/api/user_api.py | 42 +- hatchet_sdk/clients/rest/api/worker_api.py | 46 +- hatchet_sdk/clients/rest/api/workflow_api.py | 1459 ++++++--------- .../clients/rest/api/workflow_run_api.py | 637 +------ hatchet_sdk/clients/rest/api_client.py | 41 +- hatchet_sdk/clients/rest/configuration.py | 18 +- hatchet_sdk/clients/rest/models/__init__.py | 15 +- hatchet_sdk/clients/rest/models/api_errors.py | 6 +- hatchet_sdk/clients/rest/models/event_list.py | 6 +- .../rest/models/get_step_run_diff_response.py | 6 +- hatchet_sdk/clients/rest/models/job.py | 6 +- hatchet_sdk/clients/rest/models/job_run.py | 6 +- .../rest/models/list_api_tokens_response.py | 6 +- .../models/list_pull_requests_response.py | 6 +- .../rest/models/list_slack_webhooks.py | 6 +- .../rest/models/list_sns_integrations.py | 6 +- .../clients/rest/models/log_line_list.py | 6 +- .../models/replay_workflow_runs_response.py | 6 +- .../clients/rest/models/semaphore_slots.py | 17 +- hatchet_sdk/clients/rest/models/step_run.py | 8 +- .../clients/rest/models/step_run_archive.py | 3 - .../rest/models/step_run_archive_list.py | 6 +- .../clients/rest/models/step_run_event.py | 5 +- .../rest/models/step_run_event_list.py | 6 +- .../rest/models/step_run_event_reason.py | 2 - .../models/tenant_alert_email_group_list.py | 6 +- .../clients/rest/models/tenant_invite_list.py | 6 +- .../clients/rest/models/tenant_list.py | 6 +- .../clients/rest/models/tenant_member_list.py | 6 +- .../rest/models/tenant_queue_metrics.py | 15 - .../rest/models/tenant_resource_policy.py | 6 +- .../models/user_tenant_memberships_list.py | 6 +- .../models/webhook_worker_list_response.py | 6 +- .../webhook_worker_request_list_response.py | 6 +- hatchet_sdk/clients/rest/models/worker.py | 18 +- .../clients/rest/models/worker_list.py | 6 +- hatchet_sdk/clients/rest/models/workflow.py | 18 +- .../clients/rest/models/workflow_list.py | 6 +- .../clients/rest/models/workflow_run.py | 6 +- .../clients/rest/models/workflow_run_list.py | 6 +- .../rest/models/workflow_run_triggered_by.py | 19 +- .../clients/rest/models/workflow_triggers.py | 12 +- .../clients/rest/models/workflow_version.py | 18 +- hatchet_sdk/clients/rest/rest.py | 6 +- hatchet_sdk/contracts/events_pb2.py | 34 +- hatchet_sdk/contracts/events_pb2.pyi | 15 +- hatchet_sdk/contracts/events_pb2_grpc.py | 33 - hatchet_sdk/contracts/workflows_pb2.py | 86 +- hatchet_sdk/contracts/workflows_pb2.pyi | 6 +- 64 files changed, 1357 insertions(+), 3611 deletions(-) diff --git a/.gitignore b/.gitignore index 00831ae1..4f69d1e7 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,4 @@ cython_debug/ openapitools.json hatchet-cloud/ -hatchet/ \ No newline at end of file +hatchet/ diff --git a/branch-sync.sh b/branch-sync.sh index bccdbcaf..c3b113e0 100755 --- a/branch-sync.sh +++ b/branch-sync.sh @@ -76,4 +76,4 @@ git submodule init # 6. Update the submodule git submodule update --remote --merge -echo "Hatchet submodule ($mode mode) updated successfully" \ No newline at end of file +echo "Hatchet submodule ($mode mode) updated successfully" diff --git a/generate.sh b/generate.sh index fb57d131..9eb0134c 100755 --- a/generate.sh +++ b/generate.sh @@ -1,9 +1,37 @@ #!/bin/bash # -# Builds python auto-generated protobuf files +# Builds python auto-generated protobuf files for both OSS and Cloud versions set -eux +# Parse command line options +mode="oss" +while getopts ":n:" opt; do + case $opt in + n) + mode=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + exit 1 + ;; + esac +done + +# Set the submodule name based on the mode +if [ "$mode" = "cloud" ]; then + submodule_name="hatchet-cloud" +else + submodule_name="hatchet" +fi + +echo "Mode: $mode" +echo "Submodule name: $submodule_name" + ROOT_DIR=$(pwd) # deps @@ -16,7 +44,7 @@ openapi-generator-cli version || npm install @openapitools/openapi-generator-cli # fi # generate deps from hatchet repo -cd hatchet/ && sh ./hack/oas/generate-server.sh && cd $ROOT_DIR +cd $submodule_name/ && sh ./hack/oas/generate-server.sh && cd $ROOT_DIR # generate python rest client @@ -27,7 +55,7 @@ mkdir -p $dst_dir tmp_dir=./tmp # generate into tmp folder -openapi-generator-cli generate -i ./hatchet/bin/oas/openapi.yaml -g python -o ./tmp --skip-validate-spec \ +openapi-generator-cli generate -i ./$submodule_name/bin/oas/openapi.yaml -g python -o ./tmp --skip-validate-spec \ --library asyncio \ --global-property=apiTests=false \ --global-property=apiDocs=true \ @@ -42,7 +70,7 @@ mv $tmp_dir/hatchet_sdk/clients/rest/exceptions.py $dst_dir/exceptions.py mv $tmp_dir/hatchet_sdk/clients/rest/__init__.py $dst_dir/__init__.py mv $tmp_dir/hatchet_sdk/clients/rest/rest.py $dst_dir/rest.py -openapi-generator-cli generate -i ./hatchet/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ +openapi-generator-cli generate -i ./$submodule_name/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ --library asyncio \ --global-property=apis,models \ --global-property=apiTests=false \ @@ -58,9 +86,14 @@ cp $tmp_dir/hatchet_sdk/clients/rest/api/__init__.py $dst_dir/api/__init__.py # remove tmp folder rm -rf $tmp_dir -poetry run python -m grpc_tools.protoc --proto_path=hatchet/api-contracts/dispatcher --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts --grpc_python_out=./hatchet_sdk/contracts dispatcher.proto -poetry run python -m grpc_tools.protoc --proto_path=hatchet/api-contracts/events --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts --grpc_python_out=./hatchet_sdk/contracts events.proto -poetry run python -m grpc_tools.protoc --proto_path=hatchet/api-contracts/workflows --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts --grpc_python_out=./hatchet_sdk/contracts workflows.proto +# Generate protobuf files +proto_files=("dispatcher" "events" "workflows") + +for proto in "${proto_files[@]}"; do + poetry run python -m grpc_tools.protoc --proto_path=$submodule_name/api-contracts/$proto \ + --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts \ + --grpc_python_out=./hatchet_sdk/contracts $proto.proto +done # Fix relative imports in _grpc.py files if [[ "$OSTYPE" == "darwin"* ]]; then @@ -76,3 +109,5 @@ pre-commit run --all-files || pre-commit run --all-files # apply patch to openapi-generator generated code patch -p1 --no-backup-if-mismatch <./openapi_patch.patch + +echo "Generation completed for $mode mode" diff --git a/hatchet_sdk/clients/rest/__init__.py b/hatchet_sdk/clients/rest/__init__.py index a83c1cdc..de23ce32 100644 --- a/hatchet_sdk/clients/rest/__init__.py +++ b/hatchet_sdk/clients/rest/__init__.py @@ -32,6 +32,7 @@ from hatchet_sdk.clients.rest.api.worker_api import WorkerApi from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi +from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi from hatchet_sdk.clients.rest.api_client import ApiClient # import ApiClient @@ -56,13 +57,6 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( - BulkCreateEventRequest, -) -from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( - BulkCreateEventResponse, -) -from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest from hatchet_sdk.clients.rest.models.create_api_token_request import ( CreateAPITokenRequest, ) @@ -91,9 +85,6 @@ EventOrderByDirection, ) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( - EventUpdateCancel200Response, -) from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( EventWorkflowRunSummary, ) @@ -213,6 +204,9 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( + WorkflowRunCancel200Response, +) from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( WorkflowRunOrderByDirection, @@ -220,7 +214,6 @@ from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( WorkflowRunOrderByField, ) -from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( WorkflowRunTriggeredBy, @@ -245,4 +238,3 @@ WorkflowVersionDefinition, ) from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta -from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount diff --git a/hatchet_sdk/clients/rest/api/__init__.py b/hatchet_sdk/clients/rest/api/__init__.py index bc8c788d..718a6534 100644 --- a/hatchet_sdk/clients/rest/api/__init__.py +++ b/hatchet_sdk/clients/rest/api/__init__.py @@ -16,3 +16,4 @@ from hatchet_sdk.clients.rest.api.worker_api import WorkerApi from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi +from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi diff --git a/hatchet_sdk/clients/rest/api/api_token_api.py b/hatchet_sdk/clients/rest/api/api_token_api.py index 32faf798..5b32d0aa 100644 --- a/hatchet_sdk/clients/rest/api/api_token_api.py +++ b/hatchet_sdk/clients/rest/api/api_token_api.py @@ -296,10 +296,9 @@ def _api_token_create_serialize( _body_params = create_api_token_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -567,10 +566,9 @@ def _api_token_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -828,10 +826,9 @@ def _api_token_update_revoke_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/default_api.py b/hatchet_sdk/clients/rest/api/default_api.py index bdb00ebe..5cd078e4 100644 --- a/hatchet_sdk/clients/rest/api/default_api.py +++ b/hatchet_sdk/clients/rest/api/default_api.py @@ -322,10 +322,9 @@ def _tenant_invite_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -640,10 +639,9 @@ def _tenant_invite_update_serialize( _body_params = update_tenant_invite_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -929,10 +927,9 @@ def _webhook_create_serialize( _body_params = webhook_worker_create_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1203,10 +1200,9 @@ def _webhook_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1467,10 +1463,9 @@ def _webhook_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1731,10 +1726,9 @@ def _webhook_requests_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/event_api.py b/hatchet_sdk/clients/rest/api/event_api.py index febdf436..6c730fba 100644 --- a/hatchet_sdk/clients/rest/api/event_api.py +++ b/hatchet_sdk/clients/rest/api/event_api.py @@ -19,13 +19,6 @@ from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( - BulkCreateEventRequest, -) -from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( - BulkCreateEventResponse, -) -from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData @@ -35,9 +28,6 @@ EventOrderByDirection, ) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( - EventUpdateCancel200Response, -) from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -317,10 +307,9 @@ def _event_create_serialize( _body_params = create_event_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -351,17 +340,14 @@ def _event_create_serialize( ) @validate_call - async def event_create_bulk( + async def event_data_get( self, - tenant: Annotated[ + event: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The event id" ), ], - bulk_create_event_request: Annotated[ - BulkCreateEventRequest, Field(description="The events to create") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -373,15 +359,13 @@ async def event_create_bulk( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BulkCreateEventResponse: - """Bulk Create events + ) -> EventData: + """Get event data - Bulk creates new events. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str - :param bulk_create_event_request: The events to create (required) - :type bulk_create_event_request: BulkCreateEventRequest + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -404,9 +388,8 @@ async def event_create_bulk( :return: Returns the result object. """ # noqa: E501 - _param = self._event_create_bulk_serialize( - tenant=tenant, - bulk_create_event_request=bulk_create_event_request, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -414,10 +397,9 @@ async def event_create_bulk( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "BulkCreateEventResponse", + "200": "EventData", "400": "APIErrors", "403": "APIErrors", - "429": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -429,17 +411,14 @@ async def event_create_bulk( ).data @validate_call - async def event_create_bulk_with_http_info( + async def event_data_get_with_http_info( self, - tenant: Annotated[ + event: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The event id" ), ], - bulk_create_event_request: Annotated[ - BulkCreateEventRequest, Field(description="The events to create") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -451,15 +430,13 @@ async def event_create_bulk_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BulkCreateEventResponse]: - """Bulk Create events + ) -> ApiResponse[EventData]: + """Get event data - Bulk creates new events. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str - :param bulk_create_event_request: The events to create (required) - :type bulk_create_event_request: BulkCreateEventRequest + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -482,9 +459,8 @@ async def event_create_bulk_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._event_create_bulk_serialize( - tenant=tenant, - bulk_create_event_request=bulk_create_event_request, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -492,10 +468,9 @@ async def event_create_bulk_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "BulkCreateEventResponse", + "200": "EventData", "400": "APIErrors", "403": "APIErrors", - "429": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -507,17 +482,14 @@ async def event_create_bulk_with_http_info( ) @validate_call - async def event_create_bulk_without_preload_content( + async def event_data_get_without_preload_content( self, - tenant: Annotated[ + event: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The event id" ), ], - bulk_create_event_request: Annotated[ - BulkCreateEventRequest, Field(description="The events to create") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -530,14 +502,12 @@ async def event_create_bulk_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Bulk Create events + """Get event data - Bulk creates new events. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str - :param bulk_create_event_request: The events to create (required) - :type bulk_create_event_request: BulkCreateEventRequest + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -560,9 +530,8 @@ async def event_create_bulk_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._event_create_bulk_serialize( - tenant=tenant, - bulk_create_event_request=bulk_create_event_request, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -570,20 +539,18 @@ async def event_create_bulk_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "BulkCreateEventResponse", + "200": "EventData", "400": "APIErrors", "403": "APIErrors", - "429": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _event_create_bulk_serialize( + def _event_data_get_serialize( self, - tenant, - bulk_create_event_request, + event, _request_auth, _content_type, _headers, @@ -602,37 +569,24 @@ def _event_create_bulk_serialize( _body_params: Optional[bytes] = None # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant + if event is not None: + _path_params["event"] = event # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if bulk_create_event_request is not None: - _body_params = bulk_create_event_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/events/bulk", + method="GET", + resource_path="/api/v1/events/{event}/data", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -646,12 +600,12 @@ def _event_create_bulk_serialize( ) @validate_call - async def event_data_get( + async def event_key_list( self, - event: Annotated[ + tenant: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The event id" + min_length=36, strict=True, max_length=36, description="The tenant id" ), ], _request_timeout: Union[ @@ -665,13 +619,13 @@ async def event_data_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventData: - """Get event data + ) -> EventKeyList: + """List event keys - Get the data for an event. + Lists all event keys for a tenant. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -694,8 +648,8 @@ async def event_data_get( :return: Returns the result object. """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_key_list_serialize( + tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -703,7 +657,7 @@ async def event_data_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", + "200": "EventKeyList", "400": "APIErrors", "403": "APIErrors", } @@ -717,12 +671,12 @@ async def event_data_get( ).data @validate_call - async def event_data_get_with_http_info( + async def event_key_list_with_http_info( self, - event: Annotated[ + tenant: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The event id" + min_length=36, strict=True, max_length=36, description="The tenant id" ), ], _request_timeout: Union[ @@ -736,13 +690,13 @@ async def event_data_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventData]: - """Get event data + ) -> ApiResponse[EventKeyList]: + """List event keys - Get the data for an event. + Lists all event keys for a tenant. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -765,8 +719,8 @@ async def event_data_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_key_list_serialize( + tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -774,7 +728,7 @@ async def event_data_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", + "200": "EventKeyList", "400": "APIErrors", "403": "APIErrors", } @@ -788,12 +742,12 @@ async def event_data_get_with_http_info( ) @validate_call - async def event_data_get_without_preload_content( + async def event_key_list_without_preload_content( self, - event: Annotated[ + tenant: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The event id" + min_length=36, strict=True, max_length=36, description="The tenant id" ), ], _request_timeout: Union[ @@ -808,12 +762,12 @@ async def event_data_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get event data + """List event keys - Get the data for an event. + Lists all event keys for a tenant. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -836,8 +790,8 @@ async def event_data_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_key_list_serialize( + tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -845,7 +799,7 @@ async def event_data_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", + "200": "EventKeyList", "400": "APIErrors", "403": "APIErrors", } @@ -854,9 +808,9 @@ async def event_data_get_without_preload_content( ) return response_data.response - def _event_data_get_serialize( + def _event_key_list_serialize( self, - event, + tenant, _request_auth, _content_type, _headers, @@ -875,25 +829,24 @@ def _event_data_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if event is not None: - _path_params["event"] = event + if tenant is not None: + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/events/{event}/data", + resource_path="/api/v1/tenants/{tenant}/events/keys", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -907,14 +860,44 @@ def _event_data_get_serialize( ) @validate_call - async def event_get( + async def event_list( self, - event: Annotated[ + tenant: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The event id" + min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -926,13 +909,31 @@ async def event_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Event: - """Get event data + ) -> EventList: + """List events - Get an event. + Lists all events for a tenant. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -955,8 +956,17 @@ async def event_get( :return: Returns the result object. """ # noqa: E501 - _param = self._event_get_serialize( - event=event, + _param = self._event_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -964,7 +974,7 @@ async def event_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", + "200": "EventList", "400": "APIErrors", "403": "APIErrors", } @@ -978,1061 +988,44 @@ async def event_get( ).data @validate_call - async def event_get_with_http_info( + async def event_list_with_http_info( self, - event: Annotated[ + tenant: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The event id" + min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Event]: - """Get event data - - Get an event. - - :param event: The event id (required) - :type event: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_get_serialize( - event=event, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def event_get_without_preload_content( - self, - event: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The event id" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get event data - - Get an event. - - :param event: The event id (required) - :type event: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_get_serialize( - event=event, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _event_get_serialize( - self, - event, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if event is not None: - _path_params["event"] = event - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/events/{event}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def event_key_list( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventKeyList: - """List event keys - - Lists all event keys for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_key_list_serialize( - tenant=tenant, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def event_key_list_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventKeyList]: - """List event keys - - Lists all event keys for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_key_list_serialize( - tenant=tenant, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def event_key_list_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List event keys - - Lists all event keys for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_key_list_serialize( - tenant=tenant, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _event_key_list_serialize( - self, - tenant, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/events/keys", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def event_list( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - event_ids: Annotated[ - Optional[ - List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] - ], - Field(description="A list of event ids to filter by"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventList: - """List events - - Lists all events for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param event_ids: A list of event ids to filter by - :type event_ids: List[str] - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, - event_ids=event_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def event_list_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - event_ids: Annotated[ - Optional[ - List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] - ], - Field(description="A list of event ids to filter by"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventList]: - """List events - - Lists all events for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param event_ids: A list of event ids to filter by - :type event_ids: List[str] - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, - event_ids=event_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def event_list_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") ] = None, limit: Annotated[ Optional[StrictInt], Field(description="The number to limit by") ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - event_ids: Annotated[ - Optional[ - List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] - ], - Field(description="A list of event ids to filter by"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List events - - Lists all events for a tenant. - - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param event_ids: A list of event ids to filter by - :type event_ids: List[str] - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, - event_ids=event_ids, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _event_list_serialize( - self, - tenant, - offset, - limit, - keys, - workflows, - statuses, - search, - order_by_field, - order_by_direction, - additional_metadata, - event_ids, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - "keys": "multi", - "workflows": "multi", - "statuses": "multi", - "additionalMetadata": "multi", - "eventIds": "multi", - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - # process the query parameters - if offset is not None: - - _query_params.append(("offset", offset)) - - if limit is not None: - - _query_params.append(("limit", limit)) - - if keys is not None: - - _query_params.append(("keys", keys)) - - if workflows is not None: - - _query_params.append(("workflows", workflows)) - - if statuses is not None: - - _query_params.append(("statuses", statuses)) - - if search is not None: - - _query_params.append(("search", search)) - - if order_by_field is not None: - - _query_params.append(("orderByField", order_by_field.value)) - - if order_by_direction is not None: - - _query_params.append(("orderByDirection", order_by_direction.value)) - - if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - - if event_ids is not None: - - _query_params.append(("eventIds", event_ids)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/events", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def event_update_cancel( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - cancel_event_request: Annotated[ - CancelEventRequest, Field(description="The event ids to replay") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventUpdateCancel200Response: - """Replay events - - Cancels all runs for a list of events. - - :param tenant: The tenant id (required) - :type tenant: str - :param cancel_event_request: The event ids to replay (required) - :type cancel_event_request: CancelEventRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._event_update_cancel_serialize( - tenant=tenant, - cancel_event_request=cancel_event_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def event_update_cancel_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - cancel_event_request: Annotated[ - CancelEventRequest, Field(description="The event ids to replay") - ], + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2044,15 +1037,31 @@ async def event_update_cancel_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventUpdateCancel200Response]: - """Replay events + ) -> ApiResponse[EventList]: + """List events - Cancels all runs for a list of events. + Lists all events for a tenant. :param tenant: The tenant id (required) :type tenant: str - :param cancel_event_request: The event ids to replay (required) - :type cancel_event_request: CancelEventRequest + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2075,9 +1084,17 @@ async def event_update_cancel_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._event_update_cancel_serialize( + _param = self._event_list_serialize( tenant=tenant, - cancel_event_request=cancel_event_request, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2085,10 +1102,9 @@ async def event_update_cancel_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", + "200": "EventList", "400": "APIErrors", "403": "APIErrors", - "429": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2100,7 +1116,7 @@ async def event_update_cancel_with_http_info( ) @validate_call - async def event_update_cancel_without_preload_content( + async def event_list_without_preload_content( self, tenant: Annotated[ str, @@ -2108,9 +1124,36 @@ async def event_update_cancel_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - cancel_event_request: Annotated[ - CancelEventRequest, Field(description="The event ids to replay") - ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2123,14 +1166,30 @@ async def event_update_cancel_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Replay events + """List events - Cancels all runs for a list of events. + Lists all events for a tenant. :param tenant: The tenant id (required) :type tenant: str - :param cancel_event_request: The event ids to replay (required) - :type cancel_event_request: CancelEventRequest + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2153,9 +1212,17 @@ async def event_update_cancel_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._event_update_cancel_serialize( + _param = self._event_list_serialize( tenant=tenant, - cancel_event_request=cancel_event_request, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2163,20 +1230,27 @@ async def event_update_cancel_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", + "200": "EventList", "400": "APIErrors", "403": "APIErrors", - "429": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _event_update_cancel_serialize( + def _event_list_serialize( self, tenant, - cancel_event_request, + offset, + limit, + keys, + workflows, + statuses, + search, + order_by_field, + order_by_direction, + additional_metadata, _request_auth, _content_type, _headers, @@ -2185,7 +1259,12 @@ def _event_update_cancel_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "keys": "multi", + "workflows": "multi", + "statuses": "multi", + "additionalMetadata": "multi", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2198,34 +1277,57 @@ def _event_update_cancel_serialize( if tenant is not None: _path_params["tenant"] = tenant # process the query parameters + if offset is not None: + + _query_params.append(("offset", offset)) + + if limit is not None: + + _query_params.append(("limit", limit)) + + if keys is not None: + + _query_params.append(("keys", keys)) + + if workflows is not None: + + _query_params.append(("workflows", workflows)) + + if statuses is not None: + + _query_params.append(("statuses", statuses)) + + if search is not None: + + _query_params.append(("search", search)) + + if order_by_field is not None: + + _query_params.append(("orderByField", order_by_field.value)) + + if order_by_direction is not None: + + _query_params.append(("orderByDirection", order_by_direction.value)) + + if additional_metadata is not None: + + _query_params.append(("additionalMetadata", additional_metadata)) + # process the header parameters # process the form parameters # process the body parameter - if cancel_event_request is not None: - _body_params = cancel_event_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/events/cancel", + method="GET", + resource_path="/api/v1/tenants/{tenant}/events", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2500,10 +1602,9 @@ def _event_update_replay_serialize( _body_params = replay_event_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/hatchet_sdk/clients/rest/api/github_api.py b/hatchet_sdk/clients/rest/api/github_api.py index 6d584c01..121441df 100644 --- a/hatchet_sdk/clients/rest/api/github_api.py +++ b/hatchet_sdk/clients/rest/api/github_api.py @@ -305,10 +305,9 @@ def _sns_update_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = [] diff --git a/hatchet_sdk/clients/rest/api/log_api.py b/hatchet_sdk/clients/rest/api/log_api.py index 8643d563..dd941af0 100644 --- a/hatchet_sdk/clients/rest/api/log_api.py +++ b/hatchet_sdk/clients/rest/api/log_api.py @@ -421,10 +421,9 @@ def _log_line_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/metadata_api.py b/hatchet_sdk/clients/rest/api/metadata_api.py index 2954440a..44248e20 100644 --- a/hatchet_sdk/clients/rest/api/metadata_api.py +++ b/hatchet_sdk/clients/rest/api/metadata_api.py @@ -242,10 +242,9 @@ def _cloud_metadata_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = [] @@ -470,10 +469,9 @@ def _metadata_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = [] @@ -698,10 +696,9 @@ def _metadata_list_integrations_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/slack_api.py b/hatchet_sdk/clients/rest/api/slack_api.py index e12b65ab..6a0a0e43 100644 --- a/hatchet_sdk/clients/rest/api/slack_api.py +++ b/hatchet_sdk/clients/rest/api/slack_api.py @@ -285,10 +285,9 @@ def _slack_webhook_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -549,10 +548,9 @@ def _slack_webhook_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/sns_api.py b/hatchet_sdk/clients/rest/api/sns_api.py index d09763f7..f3214c03 100644 --- a/hatchet_sdk/clients/rest/api/sns_api.py +++ b/hatchet_sdk/clients/rest/api/sns_api.py @@ -295,10 +295,9 @@ def _sns_create_serialize( _body_params = create_sns_integration_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -578,10 +577,9 @@ def _sns_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -842,10 +840,9 @@ def _sns_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/step_run_api.py b/hatchet_sdk/clients/rest/api/step_run_api.py index 1a3db17c..a52e91fe 100644 --- a/hatchet_sdk/clients/rest/api/step_run_api.py +++ b/hatchet_sdk/clients/rest/api/step_run_api.py @@ -309,10 +309,9 @@ def _step_run_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -603,10 +602,9 @@ def _step_run_get_schema_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -913,10 +911,9 @@ def _step_run_list_archives_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1223,10 +1220,9 @@ def _step_run_list_events_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1514,10 +1510,9 @@ def _step_run_update_cancel_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1826,10 +1821,9 @@ def _step_run_update_rerun_serialize( _body_params = rerun_step_run_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1858,329 +1852,3 @@ def _step_run_update_rerun_serialize( _host=_host, _request_auth=_request_auth, ) - - @validate_call - async def workflow_run_list_step_run_events( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - last_id: Annotated[ - Optional[StrictInt], Field(description="Last ID of the last event") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> StepRunEventList: - """List events for all step runs for a workflow run - - List events for all step runs for a workflow run - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param last_id: Last ID of the last event - :type last_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_list_step_run_events_serialize( - tenant=tenant, - workflow_run=workflow_run, - last_id=last_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def workflow_run_list_step_run_events_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - last_id: Annotated[ - Optional[StrictInt], Field(description="Last ID of the last event") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[StepRunEventList]: - """List events for all step runs for a workflow run - - List events for all step runs for a workflow run - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param last_id: Last ID of the last event - :type last_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_list_step_run_events_serialize( - tenant=tenant, - workflow_run=workflow_run, - last_id=last_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def workflow_run_list_step_run_events_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - last_id: Annotated[ - Optional[StrictInt], Field(description="Last ID of the last event") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List events for all step runs for a workflow run - - List events for all step runs for a workflow run - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param last_id: Last ID of the last event - :type last_id: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_list_step_run_events_serialize( - tenant=tenant, - workflow_run=workflow_run, - last_id=last_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _workflow_run_list_step_run_events_serialize( - self, - tenant, - workflow_run, - last_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - if workflow_run is not None: - _path_params["workflow-run"] = workflow_run - # process the query parameters - if last_id is not None: - - _query_params.append(("lastId", last_id)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/step-run-events", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) diff --git a/hatchet_sdk/clients/rest/api/tenant_api.py b/hatchet_sdk/clients/rest/api/tenant_api.py index cacd78b8..5c6a8490 100644 --- a/hatchet_sdk/clients/rest/api/tenant_api.py +++ b/hatchet_sdk/clients/rest/api/tenant_api.py @@ -324,10 +324,9 @@ def _alert_email_group_create_serialize( _body_params = create_tenant_alert_email_group_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -604,10 +603,9 @@ def _alert_email_group_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -865,10 +863,9 @@ def _alert_email_group_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1159,10 +1156,9 @@ def _alert_email_group_update_serialize( _body_params = update_tenant_alert_email_group_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1430,10 +1426,9 @@ def _tenant_alerting_settings_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1682,10 +1677,9 @@ def _tenant_create_serialize( _body_params = create_tenant_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1938,10 +1932,9 @@ def _tenant_invite_accept_serialize( _body_params = accept_invite_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2230,10 +2223,9 @@ def _tenant_invite_create_serialize( _body_params = create_tenant_invite_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2501,10 +2493,9 @@ def _tenant_invite_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -2747,10 +2738,9 @@ def _tenant_invite_reject_serialize( _body_params = reject_invite_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -3060,10 +3050,9 @@ def _tenant_member_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -3321,10 +3310,9 @@ def _tenant_member_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -3582,10 +3570,9 @@ def _tenant_resource_policy_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -3864,10 +3851,9 @@ def _tenant_update_serialize( _body_params = update_tenant_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -4105,10 +4091,9 @@ def _user_list_tenant_invites_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth"] diff --git a/hatchet_sdk/clients/rest/api/user_api.py b/hatchet_sdk/clients/rest/api/user_api.py index 2c32e668..a0617fd3 100644 --- a/hatchet_sdk/clients/rest/api/user_api.py +++ b/hatchet_sdk/clients/rest/api/user_api.py @@ -251,10 +251,9 @@ def _tenant_memberships_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth"] @@ -500,10 +499,9 @@ def _user_create_serialize( _body_params = user_register_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -744,10 +742,9 @@ def _user_get_current_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth"] @@ -1869,10 +1866,9 @@ def _user_update_login_serialize( _body_params = user_login_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2113,10 +2109,9 @@ def _user_update_logout_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth"] @@ -2362,10 +2357,9 @@ def _user_update_password_serialize( _body_params = user_change_password_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/hatchet_sdk/clients/rest/api/worker_api.py b/hatchet_sdk/clients/rest/api/worker_api.py index 81bc7696..cc9a82a5 100644 --- a/hatchet_sdk/clients/rest/api/worker_api.py +++ b/hatchet_sdk/clients/rest/api/worker_api.py @@ -14,7 +14,7 @@ import warnings from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized @@ -46,6 +46,9 @@ async def worker_get( min_length=36, strict=True, max_length=36, description="The worker id" ), ], + recent_failed: Annotated[ + Optional[StrictBool], Field(description="Filter recent by failed") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -64,6 +67,8 @@ async def worker_get( :param worker: The worker id (required) :type worker: str + :param recent_failed: Filter recent by failed + :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -88,6 +93,7 @@ async def worker_get( _param = self._worker_get_serialize( worker=worker, + recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -117,6 +123,9 @@ async def worker_get_with_http_info( min_length=36, strict=True, max_length=36, description="The worker id" ), ], + recent_failed: Annotated[ + Optional[StrictBool], Field(description="Filter recent by failed") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -135,6 +144,8 @@ async def worker_get_with_http_info( :param worker: The worker id (required) :type worker: str + :param recent_failed: Filter recent by failed + :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -159,6 +170,7 @@ async def worker_get_with_http_info( _param = self._worker_get_serialize( worker=worker, + recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -188,6 +200,9 @@ async def worker_get_without_preload_content( min_length=36, strict=True, max_length=36, description="The worker id" ), ], + recent_failed: Annotated[ + Optional[StrictBool], Field(description="Filter recent by failed") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -206,6 +221,8 @@ async def worker_get_without_preload_content( :param worker: The worker id (required) :type worker: str + :param recent_failed: Filter recent by failed + :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -230,6 +247,7 @@ async def worker_get_without_preload_content( _param = self._worker_get_serialize( worker=worker, + recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -249,6 +267,7 @@ async def worker_get_without_preload_content( def _worker_get_serialize( self, worker, + recent_failed, _request_auth, _content_type, _headers, @@ -270,15 +289,18 @@ def _worker_get_serialize( if worker is not None: _path_params["worker"] = worker # process the query parameters + if recent_failed is not None: + + _query_params.append(("recentFailed", recent_failed)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -536,10 +558,9 @@ def _worker_list_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -818,10 +839,9 @@ def _worker_update_serialize( _body_params = update_worker_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/hatchet_sdk/clients/rest/api/workflow_api.py b/hatchet_sdk/clients/rest/api/workflow_api.py index 19d150e9..71316035 100644 --- a/hatchet_sdk/clients/rest/api/workflow_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_api.py @@ -33,11 +33,12 @@ from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( WorkflowRunOrderByField, ) -from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount +from hatchet_sdk.clients.rest.models.workflow_version_definition import ( + WorkflowVersionDefinition, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -349,10 +350,9 @@ def _tenant_get_queue_metrics_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -613,10 +613,9 @@ def _workflow_delete_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -697,7 +696,6 @@ async def workflow_get( "200": "Workflow", "400": "APIErrors", "403": "APIErrors", - "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -769,7 +767,6 @@ async def workflow_get_with_http_info( "200": "Workflow", "400": "APIErrors", "403": "APIErrors", - "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -841,7 +838,6 @@ async def workflow_get_without_preload_content( "200": "Workflow", "400": "APIErrors", "403": "APIErrors", - "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -877,10 +873,9 @@ def _workflow_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1190,10 +1185,9 @@ def _workflow_get_metrics_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] @@ -1214,7 +1208,7 @@ def _workflow_get_metrics_serialize( ) @validate_call - async def workflow_get_workers_count( + async def workflow_list( self, tenant: Annotated[ str, @@ -1222,12 +1216,6 @@ async def workflow_get_workers_count( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1239,15 +1227,13 @@ async def workflow_get_workers_count( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowWorkersCount: - """Get workflow worker count + ) -> WorkflowList: + """Get workflows - Get a count of the workers available for workflow + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow: The workflow id (required) - :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1270,9 +1256,8 @@ async def workflow_get_workers_count( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_get_workers_count_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1280,7 +1265,7 @@ async def workflow_get_workers_count( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowWorkersCount", + "200": "WorkflowList", "400": "APIErrors", "403": "APIErrors", } @@ -1294,7 +1279,7 @@ async def workflow_get_workers_count( ).data @validate_call - async def workflow_get_workers_count_with_http_info( + async def workflow_list_with_http_info( self, tenant: Annotated[ str, @@ -1302,12 +1287,6 @@ async def workflow_get_workers_count_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1319,15 +1298,13 @@ async def workflow_get_workers_count_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowWorkersCount]: - """Get workflow worker count + ) -> ApiResponse[WorkflowList]: + """Get workflows - Get a count of the workers available for workflow + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow: The workflow id (required) - :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1350,9 +1327,8 @@ async def workflow_get_workers_count_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_get_workers_count_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1360,7 +1336,7 @@ async def workflow_get_workers_count_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowWorkersCount", + "200": "WorkflowList", "400": "APIErrors", "403": "APIErrors", } @@ -1374,7 +1350,7 @@ async def workflow_get_workers_count_with_http_info( ) @validate_call - async def workflow_get_workers_count_without_preload_content( + async def workflow_list_without_preload_content( self, tenant: Annotated[ str, @@ -1382,12 +1358,6 @@ async def workflow_get_workers_count_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1400,14 +1370,12 @@ async def workflow_get_workers_count_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow worker count + """Get workflows - Get a count of the workers available for workflow + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow: The workflow id (required) - :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1430,9 +1398,8 @@ async def workflow_get_workers_count_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_get_workers_count_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1440,7 +1407,7 @@ async def workflow_get_workers_count_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowWorkersCount", + "200": "WorkflowList", "400": "APIErrors", "403": "APIErrors", } @@ -1449,10 +1416,9 @@ async def workflow_get_workers_count_without_preload_content( ) return response_data.response - def _workflow_get_workers_count_serialize( + def _workflow_list_serialize( self, tenant, - workflow, _request_auth, _content_type, _headers, @@ -1473,25 +1439,22 @@ def _workflow_get_workers_count_serialize( # process the path parameters if tenant is not None: _path_params["tenant"] = tenant - if workflow is not None: - _path_params["workflow"] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows/{workflow}/worker-count", + resource_path="/api/v1/tenants/{tenant}/workflows", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1505,7 +1468,7 @@ def _workflow_get_workers_count_serialize( ) @validate_call - async def workflow_list( + async def workflow_run_get( self, tenant: Annotated[ str, @@ -1513,6 +1476,15 @@ async def workflow_list( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1524,13 +1496,15 @@ async def workflow_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowList: - """Get workflows + ) -> WorkflowRun: + """Get workflow run - Get all workflows for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1553,8 +1527,9 @@ async def workflow_list( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, + workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1562,7 +1537,7 @@ async def workflow_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", + "200": "WorkflowRun", "400": "APIErrors", "403": "APIErrors", } @@ -1576,7 +1551,7 @@ async def workflow_list( ).data @validate_call - async def workflow_list_with_http_info( + async def workflow_run_get_with_http_info( self, tenant: Annotated[ str, @@ -1584,6 +1559,15 @@ async def workflow_list_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1595,13 +1579,15 @@ async def workflow_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowList]: - """Get workflows + ) -> ApiResponse[WorkflowRun]: + """Get workflow run - Get all workflows for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1624,8 +1610,9 @@ async def workflow_list_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, + workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1633,7 +1620,7 @@ async def workflow_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", + "200": "WorkflowRun", "400": "APIErrors", "403": "APIErrors", } @@ -1647,7 +1634,7 @@ async def workflow_list_with_http_info( ) @validate_call - async def workflow_list_without_preload_content( + async def workflow_run_get_without_preload_content( self, tenant: Annotated[ str, @@ -1655,6 +1642,15 @@ async def workflow_list_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1667,12 +1663,14 @@ async def workflow_list_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflows + """Get workflow run - Get all workflows for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1695,8 +1693,9 @@ async def workflow_list_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, + workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1704,7 +1703,7 @@ async def workflow_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", + "200": "WorkflowRun", "400": "APIErrors", "403": "APIErrors", } @@ -1713,9 +1712,10 @@ async def workflow_list_without_preload_content( ) return response_data.response - def _workflow_list_serialize( + def _workflow_run_get_serialize( self, tenant, + workflow_run, _request_auth, _content_type, _headers, @@ -1736,23 +1736,24 @@ def _workflow_list_serialize( # process the path parameters if tenant is not None: _path_params["tenant"] = tenant + if workflow_run is not None: + _path_params["workflow-run"] = workflow_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1766,7 +1767,7 @@ def _workflow_list_serialize( ) @validate_call - async def workflow_run_get( + async def workflow_run_get_metrics( self, tenant: Annotated[ str, @@ -1774,15 +1775,34 @@ async def workflow_run_get( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1794,15 +1814,27 @@ async def workflow_run_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRun: - """Get workflow run + ) -> WorkflowRunsMetrics: + """Get workflow runs - Get a workflow run for a tenant + Get a summary of workflow run metrics for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1825,9 +1857,15 @@ async def workflow_run_get( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_run_get_metrics_serialize( tenant=tenant, - workflow_run=workflow_run, + event_id=event_id, + workflow_id=workflow_id, + parent_workflow_run_id=parent_workflow_run_id, + parent_step_run_id=parent_step_run_id, + additional_metadata=additional_metadata, + created_after=created_after, + created_before=created_before, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1835,7 +1873,7 @@ async def workflow_run_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", + "200": "WorkflowRunsMetrics", "400": "APIErrors", "403": "APIErrors", } @@ -1849,7 +1887,7 @@ async def workflow_run_get( ).data @validate_call - async def workflow_run_get_with_http_info( + async def workflow_run_get_metrics_with_http_info( self, tenant: Annotated[ str, @@ -1857,15 +1895,34 @@ async def workflow_run_get_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1877,15 +1934,27 @@ async def workflow_run_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRun]: - """Get workflow run + ) -> ApiResponse[WorkflowRunsMetrics]: + """Get workflow runs - Get a workflow run for a tenant + Get a summary of workflow run metrics for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1908,9 +1977,15 @@ async def workflow_run_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_run_get_metrics_serialize( tenant=tenant, - workflow_run=workflow_run, + event_id=event_id, + workflow_id=workflow_id, + parent_workflow_run_id=parent_workflow_run_id, + parent_step_run_id=parent_step_run_id, + additional_metadata=additional_metadata, + created_after=created_after, + created_before=created_before, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1918,7 +1993,7 @@ async def workflow_run_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", + "200": "WorkflowRunsMetrics", "400": "APIErrors", "403": "APIErrors", } @@ -1932,7 +2007,7 @@ async def workflow_run_get_with_http_info( ) @validate_call - async def workflow_run_get_without_preload_content( + async def workflow_run_get_metrics_without_preload_content( self, tenant: Annotated[ str, @@ -1940,15 +2015,34 @@ async def workflow_run_get_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1961,14 +2055,26 @@ async def workflow_run_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow run + """Get workflow runs - Get a workflow run for a tenant + Get a summary of workflow run metrics for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1991,9 +2097,15 @@ async def workflow_run_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_run_get_metrics_serialize( tenant=tenant, - workflow_run=workflow_run, + event_id=event_id, + workflow_id=workflow_id, + parent_workflow_run_id=parent_workflow_run_id, + parent_step_run_id=parent_step_run_id, + additional_metadata=additional_metadata, + created_after=created_after, + created_before=created_before, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2001,7 +2113,7 @@ async def workflow_run_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", + "200": "WorkflowRunsMetrics", "400": "APIErrors", "403": "APIErrors", } @@ -2010,10 +2122,16 @@ async def workflow_run_get_without_preload_content( ) return response_data.response - def _workflow_run_get_serialize( + def _workflow_run_get_metrics_serialize( self, tenant, - workflow_run, + event_id, + workflow_id, + parent_workflow_run_id, + parent_step_run_id, + additional_metadata, + created_after, + created_before, _request_auth, _content_type, _headers, @@ -2022,7 +2140,9 @@ def _workflow_run_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "additionalMetadata": "multi", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2034,25 +2154,64 @@ def _workflow_run_get_serialize( # process the path parameters if tenant is not None: _path_params["tenant"] = tenant - if workflow_run is not None: - _path_params["workflow-run"] = workflow_run # process the query parameters + if event_id is not None: + + _query_params.append(("eventId", event_id)) + + if workflow_id is not None: + + _query_params.append(("workflowId", workflow_id)) + + if parent_workflow_run_id is not None: + + _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) + + if parent_step_run_id is not None: + + _query_params.append(("parentStepRunId", parent_step_run_id)) + + if additional_metadata is not None: + + _query_params.append(("additionalMetadata", additional_metadata)) + + if created_after is not None: + if isinstance(created_after, datetime): + _query_params.append( + ( + "createdAfter", + created_after.isoformat(), + ) + ) + else: + _query_params.append(("createdAfter", created_after)) + + if created_before is not None: + if isinstance(created_before, datetime): + _query_params.append( + ( + "createdBefore", + created_before.isoformat(), + ) + ) + else: + _query_params.append(("createdBefore", created_before)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}", + resource_path="/api/v1/tenants/{tenant}/workflows/runs/metrics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2066,7 +2225,7 @@ def _workflow_run_get_serialize( ) @validate_call - async def workflow_run_get_metrics( + async def workflow_run_list( self, tenant: Annotated[ str, @@ -2074,6 +2233,12 @@ async def workflow_run_get_metrics( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, event_id: Annotated[ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for."), @@ -2090,6 +2255,14 @@ async def workflow_run_get_metrics( Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id"), ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, additional_metadata: Annotated[ Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by"), @@ -2102,6 +2275,13 @@ async def workflow_run_get_metrics( Optional[datetime], Field(description="The time before the workflow run was created"), ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2113,13 +2293,17 @@ async def workflow_run_get_metrics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunsMetrics: + ) -> WorkflowRunList: """Get workflow runs - Get a summary of workflow run metrics for a tenant + Get all workflow runs for a tenant :param tenant: The tenant id (required) :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int :param event_id: The event id to get runs for. :type event_id: str :param workflow_id: The workflow id to get runs for. @@ -2128,12 +2312,20 @@ async def workflow_run_get_metrics( :type parent_workflow_run_id: str :param parent_step_run_id: The parent step run id :type parent_step_run_id: str + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param kinds: A list of workflow kinds to filter by + :type kinds: List[WorkflowKind] :param additional_metadata: A list of metadata key value pairs to filter by :type additional_metadata: List[str] :param created_after: The time after the workflow run was created :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param order_by_field: The order by field + :type order_by_field: WorkflowRunOrderByField + :param order_by_direction: The order by direction + :type order_by_direction: WorkflowRunOrderByDirection :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2156,15 +2348,21 @@ async def workflow_run_get_metrics( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_list_serialize( tenant=tenant, + offset=offset, + limit=limit, event_id=event_id, workflow_id=workflow_id, parent_workflow_run_id=parent_workflow_run_id, parent_step_run_id=parent_step_run_id, + statuses=statuses, + kinds=kinds, additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + order_by_field=order_by_field, + order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2172,7 +2370,7 @@ async def workflow_run_get_metrics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", + "200": "WorkflowRunList", "400": "APIErrors", "403": "APIErrors", } @@ -2186,7 +2384,7 @@ async def workflow_run_get_metrics( ).data @validate_call - async def workflow_run_get_metrics_with_http_info( + async def workflow_run_list_with_http_info( self, tenant: Annotated[ str, @@ -2194,6 +2392,12 @@ async def workflow_run_get_metrics_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, event_id: Annotated[ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for."), @@ -2210,6 +2414,14 @@ async def workflow_run_get_metrics_with_http_info( Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id"), ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, additional_metadata: Annotated[ Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by"), @@ -2222,6 +2434,13 @@ async def workflow_run_get_metrics_with_http_info( Optional[datetime], Field(description="The time before the workflow run was created"), ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2233,13 +2452,17 @@ async def workflow_run_get_metrics_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunsMetrics]: + ) -> ApiResponse[WorkflowRunList]: """Get workflow runs - Get a summary of workflow run metrics for a tenant + Get all workflow runs for a tenant :param tenant: The tenant id (required) :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int :param event_id: The event id to get runs for. :type event_id: str :param workflow_id: The workflow id to get runs for. @@ -2248,12 +2471,20 @@ async def workflow_run_get_metrics_with_http_info( :type parent_workflow_run_id: str :param parent_step_run_id: The parent step run id :type parent_step_run_id: str + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param kinds: A list of workflow kinds to filter by + :type kinds: List[WorkflowKind] :param additional_metadata: A list of metadata key value pairs to filter by :type additional_metadata: List[str] :param created_after: The time after the workflow run was created :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param order_by_field: The order by field + :type order_by_field: WorkflowRunOrderByField + :param order_by_direction: The order by direction + :type order_by_direction: WorkflowRunOrderByDirection :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2276,15 +2507,21 @@ async def workflow_run_get_metrics_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_list_serialize( tenant=tenant, + offset=offset, + limit=limit, event_id=event_id, workflow_id=workflow_id, parent_workflow_run_id=parent_workflow_run_id, parent_step_run_id=parent_step_run_id, + statuses=statuses, + kinds=kinds, additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + order_by_field=order_by_field, + order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2292,7 +2529,7 @@ async def workflow_run_get_metrics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", + "200": "WorkflowRunList", "400": "APIErrors", "403": "APIErrors", } @@ -2306,7 +2543,7 @@ async def workflow_run_get_metrics_with_http_info( ) @validate_call - async def workflow_run_get_metrics_without_preload_content( + async def workflow_run_list_without_preload_content( self, tenant: Annotated[ str, @@ -2314,6 +2551,12 @@ async def workflow_run_get_metrics_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, event_id: Annotated[ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for."), @@ -2330,6 +2573,14 @@ async def workflow_run_get_metrics_without_preload_content( Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id"), ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, additional_metadata: Annotated[ Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by"), @@ -2342,6 +2593,13 @@ async def workflow_run_get_metrics_without_preload_content( Optional[datetime], Field(description="The time before the workflow run was created"), ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2356,10 +2614,14 @@ async def workflow_run_get_metrics_without_preload_content( ) -> RESTResponseType: """Get workflow runs - Get a summary of workflow run metrics for a tenant + Get all workflow runs for a tenant :param tenant: The tenant id (required) :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int :param event_id: The event id to get runs for. :type event_id: str :param workflow_id: The workflow id to get runs for. @@ -2368,12 +2630,20 @@ async def workflow_run_get_metrics_without_preload_content( :type parent_workflow_run_id: str :param parent_step_run_id: The parent step run id :type parent_step_run_id: str + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param kinds: A list of workflow kinds to filter by + :type kinds: List[WorkflowKind] :param additional_metadata: A list of metadata key value pairs to filter by :type additional_metadata: List[str] :param created_after: The time after the workflow run was created :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param order_by_field: The order by field + :type order_by_field: WorkflowRunOrderByField + :param order_by_direction: The order by direction + :type order_by_direction: WorkflowRunOrderByDirection :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2396,15 +2666,21 @@ async def workflow_run_get_metrics_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_list_serialize( tenant=tenant, + offset=offset, + limit=limit, event_id=event_id, workflow_id=workflow_id, parent_workflow_run_id=parent_workflow_run_id, parent_step_run_id=parent_step_run_id, + statuses=statuses, + kinds=kinds, additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + order_by_field=order_by_field, + order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2412,7 +2688,7 @@ async def workflow_run_get_metrics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", + "200": "WorkflowRunList", "400": "APIErrors", "403": "APIErrors", } @@ -2421,16 +2697,22 @@ async def workflow_run_get_metrics_without_preload_content( ) return response_data.response - def _workflow_run_get_metrics_serialize( + def _workflow_run_list_serialize( self, tenant, + offset, + limit, event_id, workflow_id, parent_workflow_run_id, parent_step_run_id, + statuses, + kinds, additional_metadata, created_after, created_before, + order_by_field, + order_by_direction, _request_auth, _content_type, _headers, @@ -2440,6 +2722,8 @@ def _workflow_run_get_metrics_serialize( _host = None _collection_formats: Dict[str, str] = { + "statuses": "multi", + "kinds": "multi", "additionalMetadata": "multi", } @@ -2454,6 +2738,14 @@ def _workflow_run_get_metrics_serialize( if tenant is not None: _path_params["tenant"] = tenant # process the query parameters + if offset is not None: + + _query_params.append(("offset", offset)) + + if limit is not None: + + _query_params.append(("limit", limit)) + if event_id is not None: _query_params.append(("eventId", event_id)) @@ -2470,6 +2762,14 @@ def _workflow_run_get_metrics_serialize( _query_params.append(("parentStepRunId", parent_step_run_id)) + if statuses is not None: + + _query_params.append(("statuses", statuses)) + + if kinds is not None: + + _query_params.append(("kinds", kinds)) + if additional_metadata is not None: _query_params.append(("additionalMetadata", additional_metadata)) @@ -2496,22 +2796,29 @@ def _workflow_run_get_metrics_serialize( else: _query_params.append(("createdBefore", created_before)) + if order_by_field is not None: + + _query_params.append(("orderByField", order_by_field.value)) + + if order_by_direction is not None: + + _query_params.append(("orderByDirection", order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows/runs/metrics", + resource_path="/api/v1/tenants/{tenant}/workflows/runs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2525,23 +2832,20 @@ def _workflow_run_get_metrics_serialize( ) @validate_call - async def workflow_run_get_shape( + async def workflow_version_get( self, - tenant: Annotated[ + workflow: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The workflow id" ), ], - workflow_run: Annotated[ - str, + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", + description="The workflow version. If not supplied, the latest version is fetched." ), - ], + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2553,15 +2857,15 @@ async def workflow_run_get_shape( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunShape: - """Get workflow run + ) -> WorkflowVersion: + """Get workflow version - Get a workflow run for a tenant + Get a workflow version for a tenant - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str + :param workflow: The workflow id (required) + :type workflow: str + :param version: The workflow version. If not supplied, the latest version is fetched. + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2584,9 +2888,9 @@ async def workflow_run_get_shape( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_get_shape_serialize( - tenant=tenant, - workflow_run=workflow_run, + _param = self._workflow_version_get_serialize( + workflow=workflow, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2594,9 +2898,10 @@ async def workflow_run_get_shape( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunShape", + "200": "WorkflowVersion", "400": "APIErrors", "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2608,106 +2913,20 @@ async def workflow_run_get_shape( ).data @validate_call - async def workflow_run_get_shape_with_http_info( + async def workflow_version_get_with_http_info( self, - tenant: Annotated[ + workflow: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The workflow id" ), ], - workflow_run: Annotated[ - str, + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", + description="The workflow version. If not supplied, the latest version is fetched." ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunShape]: - """Get workflow run - - Get a workflow run for a tenant - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_get_shape_serialize( - tenant=tenant, - workflow_run=workflow_run, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunShape", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def workflow_run_get_shape_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2719,372 +2938,15 @@ async def workflow_run_get_shape_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get workflow run - - Get a workflow run for a tenant - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + ) -> ApiResponse[WorkflowVersion]: + """Get workflow version - _param = self._workflow_run_get_shape_serialize( - tenant=tenant, - workflow_run=workflow_run, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + Get a workflow version for a tenant - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunShape", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _workflow_run_get_shape_serialize( - self, - tenant, - workflow_run, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - if workflow_run is not None: - _path_params["workflow-run"] = workflow_run - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/shape", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def workflow_run_list( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunList: - """Get workflow runs - - Get all workflow runs for a tenant - - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param kinds: A list of workflow kinds to filter by - :type kinds: List[WorkflowKind] - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime - :param order_by_field: The order by field - :type order_by_field: WorkflowRunOrderByField - :param order_by_direction: The order by direction - :type order_by_direction: WorkflowRunOrderByDirection - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - event_id=event_id, - workflow_id=workflow_id, - parent_workflow_run_id=parent_workflow_run_id, - parent_step_run_id=parent_step_run_id, - statuses=statuses, - kinds=kinds, - additional_metadata=additional_metadata, - created_after=created_after, - created_before=created_before, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", - "400": "APIErrors", - "403": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def workflow_run_list_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunList]: - """Get workflow runs - - Get all workflow runs for a tenant - - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param kinds: A list of workflow kinds to filter by - :type kinds: List[WorkflowKind] - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime - :param order_by_field: The order by field - :type order_by_field: WorkflowRunOrderByField - :param order_by_direction: The order by direction - :type order_by_direction: WorkflowRunOrderByDirection + :param workflow: The workflow id (required) + :type workflow: str + :param version: The workflow version. If not supplied, the latest version is fetched. + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3107,21 +2969,9 @@ async def workflow_run_list_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - event_id=event_id, - workflow_id=workflow_id, - parent_workflow_run_id=parent_workflow_run_id, - parent_step_run_id=parent_step_run_id, - statuses=statuses, - kinds=kinds, - additional_metadata=additional_metadata, - created_after=created_after, - created_before=created_before, - order_by_field=order_by_field, - order_by_direction=order_by_direction, + _param = self._workflow_version_get_serialize( + workflow=workflow, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3129,9 +2979,10 @@ async def workflow_run_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", + "200": "WorkflowVersion", "400": "APIErrors", "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -3143,62 +2994,19 @@ async def workflow_run_list_with_http_info( ) @validate_call - async def workflow_run_list_without_preload_content( + async def workflow_version_get_without_preload_content( self, - tenant: Annotated[ + workflow: Annotated[ str, Field( - min_length=36, strict=True, max_length=36, description="The tenant id" + min_length=36, strict=True, max_length=36, description="The workflow id" ), ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ + version: Annotated[ Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), ] = None, _request_timeout: Union[ None, @@ -3212,38 +3020,14 @@ async def workflow_run_list_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow runs + """Get workflow version - Get all workflow runs for a tenant + Get a workflow version for a tenant - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param kinds: A list of workflow kinds to filter by - :type kinds: List[WorkflowKind] - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime - :param order_by_field: The order by field - :type order_by_field: WorkflowRunOrderByField - :param order_by_direction: The order by direction - :type order_by_direction: WorkflowRunOrderByDirection + :param workflow: The workflow id (required) + :type workflow: str + :param version: The workflow version. If not supplied, the latest version is fetched. + :type version: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3266,21 +3050,9 @@ async def workflow_run_list_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_run_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - event_id=event_id, - workflow_id=workflow_id, - parent_workflow_run_id=parent_workflow_run_id, - parent_step_run_id=parent_step_run_id, - statuses=statuses, - kinds=kinds, - additional_metadata=additional_metadata, - created_after=created_after, - created_before=created_before, - order_by_field=order_by_field, - order_by_direction=order_by_direction, + _param = self._workflow_version_get_serialize( + workflow=workflow, + version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3288,31 +3060,20 @@ async def workflow_run_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", + "200": "WorkflowVersion", "400": "APIErrors", "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_list_serialize( + def _workflow_version_get_serialize( self, - tenant, - offset, - limit, - event_id, - workflow_id, - parent_workflow_run_id, - parent_step_run_id, - statuses, - kinds, - additional_metadata, - created_after, - created_before, - order_by_field, - order_by_direction, + workflow, + version, _request_auth, _content_type, _headers, @@ -3321,11 +3082,7 @@ def _workflow_run_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - "statuses": "multi", - "kinds": "multi", - "additionalMetadata": "multi", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3335,91 +3092,28 @@ def _workflow_run_list_serialize( _body_params: Optional[bytes] = None # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant + if workflow is not None: + _path_params["workflow"] = workflow # process the query parameters - if offset is not None: - - _query_params.append(("offset", offset)) - - if limit is not None: - - _query_params.append(("limit", limit)) - - if event_id is not None: - - _query_params.append(("eventId", event_id)) - - if workflow_id is not None: - - _query_params.append(("workflowId", workflow_id)) - - if parent_workflow_run_id is not None: - - _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) - - if parent_step_run_id is not None: - - _query_params.append(("parentStepRunId", parent_step_run_id)) - - if statuses is not None: - - _query_params.append(("statuses", statuses)) - - if kinds is not None: - - _query_params.append(("kinds", kinds)) - - if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - "createdAfter", - created_after.isoformat(), - ) - ) - else: - _query_params.append(("createdAfter", created_after)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - "createdBefore", - created_before.isoformat(), - ) - ) - else: - _query_params.append(("createdBefore", created_before)) - - if order_by_field is not None: - - _query_params.append(("orderByField", order_by_field.value)) - - if order_by_direction is not None: + if version is not None: - _query_params.append(("orderByDirection", order_by_direction.value)) + _query_params.append(("version", version)) # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows/runs", + resource_path="/api/v1/workflows/{workflow}/versions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3433,7 +3127,7 @@ def _workflow_run_list_serialize( ) @validate_call - async def workflow_version_get( + async def workflow_version_get_definition( self, workflow: Annotated[ str, @@ -3458,10 +3152,10 @@ async def workflow_version_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowVersion: - """Get workflow version + ) -> WorkflowVersionDefinition: + """Get workflow version definition - Get a workflow version for a tenant + Get a workflow version definition for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -3489,7 +3183,7 @@ async def workflow_version_get( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_version_get_definition_serialize( workflow=workflow, version=version, _request_auth=_request_auth, @@ -3499,7 +3193,7 @@ async def workflow_version_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", + "200": "WorkflowVersionDefinition", "400": "APIErrors", "403": "APIErrors", "404": "APIErrors", @@ -3514,7 +3208,7 @@ async def workflow_version_get( ).data @validate_call - async def workflow_version_get_with_http_info( + async def workflow_version_get_definition_with_http_info( self, workflow: Annotated[ str, @@ -3539,10 +3233,10 @@ async def workflow_version_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowVersion]: - """Get workflow version + ) -> ApiResponse[WorkflowVersionDefinition]: + """Get workflow version definition - Get a workflow version for a tenant + Get a workflow version definition for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -3570,7 +3264,7 @@ async def workflow_version_get_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_version_get_definition_serialize( workflow=workflow, version=version, _request_auth=_request_auth, @@ -3580,7 +3274,7 @@ async def workflow_version_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", + "200": "WorkflowVersionDefinition", "400": "APIErrors", "403": "APIErrors", "404": "APIErrors", @@ -3595,7 +3289,7 @@ async def workflow_version_get_with_http_info( ) @validate_call - async def workflow_version_get_without_preload_content( + async def workflow_version_get_definition_without_preload_content( self, workflow: Annotated[ str, @@ -3621,9 +3315,9 @@ async def workflow_version_get_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow version + """Get workflow version definition - Get a workflow version for a tenant + Get a workflow version definition for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -3651,7 +3345,7 @@ async def workflow_version_get_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_version_get_definition_serialize( workflow=workflow, version=version, _request_auth=_request_auth, @@ -3661,7 +3355,7 @@ async def workflow_version_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", + "200": "WorkflowVersionDefinition", "400": "APIErrors", "403": "APIErrors", "404": "APIErrors", @@ -3671,7 +3365,7 @@ async def workflow_version_get_without_preload_content( ) return response_data.response - def _workflow_version_get_serialize( + def _workflow_version_get_definition_serialize( self, workflow, version, @@ -3705,17 +3399,16 @@ def _workflow_version_get_serialize( # process the body parameter # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( method="GET", - resource_path="/api/v1/workflows/{workflow}/versions", + resource_path="/api/v1/workflows/{workflow}/versions/definition", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/hatchet_sdk/clients/rest/api/workflow_run_api.py b/hatchet_sdk/clients/rest/api/workflow_run_api.py index 5583e223..c0f22759 100644 --- a/hatchet_sdk/clients/rest/api/workflow_run_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_run_api.py @@ -19,19 +19,13 @@ from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( - EventUpdateCancel200Response, -) -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( - ReplayWorkflowRunsRequest, -) -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( - ReplayWorkflowRunsResponse, -) from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( TriggerWorkflowRunRequest, ) from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( + WorkflowRunCancel200Response, +) from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( WorkflowRunsCancelRequest, ) @@ -74,7 +68,7 @@ async def workflow_run_cancel( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventUpdateCancel200Response: + ) -> WorkflowRunCancel200Response: """Cancel workflow runs Cancel a batch of workflow runs @@ -115,7 +109,7 @@ async def workflow_run_cancel( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", + "200": "WorkflowRunCancel200Response", "400": "APIErrors", "403": "APIErrors", } @@ -152,7 +146,7 @@ async def workflow_run_cancel_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventUpdateCancel200Response]: + ) -> ApiResponse[WorkflowRunCancel200Response]: """Cancel workflow runs Cancel a batch of workflow runs @@ -193,7 +187,7 @@ async def workflow_run_cancel_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", + "200": "WorkflowRunCancel200Response", "400": "APIErrors", "403": "APIErrors", } @@ -271,7 +265,7 @@ async def workflow_run_cancel_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventUpdateCancel200Response", + "200": "WorkflowRunCancel200Response", "400": "APIErrors", "403": "APIErrors", } @@ -312,10 +306,9 @@ def _workflow_run_cancel_serialize( _body_params = workflow_runs_cancel_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -645,10 +638,9 @@ def _workflow_run_create_serialize( _body_params = trigger_workflow_run_request # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` if _content_type: @@ -677,604 +669,3 @@ def _workflow_run_create_serialize( _host=_host, _request_auth=_request_auth, ) - - @validate_call - async def workflow_run_get_input( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, object]: - """Get workflow run input - - Get the input for a workflow run. - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_get_input_serialize( - tenant=tenant, - workflow_run=workflow_run, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def workflow_run_get_input_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, object]]: - """Get workflow run input - - Get the input for a workflow run. - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_get_input_serialize( - tenant=tenant, - workflow_run=workflow_run, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def workflow_run_get_input_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get workflow run input - - Get the input for a workflow run. - - :param tenant: The tenant id (required) - :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_get_input_serialize( - tenant=tenant, - workflow_run=workflow_run, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _workflow_run_get_input_serialize( - self, - tenant, - workflow_run, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - if workflow_run is not None: - _path_params["workflow-run"] = workflow_run - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/input", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def workflow_run_update_replay( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ReplayWorkflowRunsResponse: - """Replay workflow runs - - Replays a list of workflow runs. - - :param tenant: The tenant id (required) - :type tenant: str - :param replay_workflow_runs_request: The workflow run ids to replay (required) - :type replay_workflow_runs_request: ReplayWorkflowRunsRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_update_replay_serialize( - tenant=tenant, - replay_workflow_runs_request=replay_workflow_runs_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def workflow_run_update_replay_with_http_info( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ReplayWorkflowRunsResponse]: - """Replay workflow runs - - Replays a list of workflow runs. - - :param tenant: The tenant id (required) - :type tenant: str - :param replay_workflow_runs_request: The workflow run ids to replay (required) - :type replay_workflow_runs_request: ReplayWorkflowRunsRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_update_replay_serialize( - tenant=tenant, - replay_workflow_runs_request=replay_workflow_runs_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def workflow_run_update_replay_without_preload_content( - self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Replay workflow runs - - Replays a list of workflow runs. - - :param tenant: The tenant id (required) - :type tenant: str - :param replay_workflow_runs_request: The workflow run ids to replay (required) - :type replay_workflow_runs_request: ReplayWorkflowRunsRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._workflow_run_update_replay_serialize( - tenant=tenant, - replay_workflow_runs_request=replay_workflow_runs_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _workflow_run_update_replay_serialize( - self, - tenant, - replay_workflow_runs_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if tenant is not None: - _path_params["tenant"] = tenant - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if replay_workflow_runs_request is not None: - _body_params = replay_workflow_runs_request - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) diff --git a/hatchet_sdk/clients/rest/api_client.py b/hatchet_sdk/clients/rest/api_client.py index a35d765c..2980d8c1 100644 --- a/hatchet_sdk/clients/rest/api_client.py +++ b/hatchet_sdk/clients/rest/api_client.py @@ -13,7 +13,6 @@ import datetime -import decimal import json import mimetypes import os @@ -69,7 +68,6 @@ class ApiClient: "bool": bool, "date": datetime.date, "datetime": datetime.datetime, - "decimal": decimal.Decimal, "object": object, } _pool = None @@ -222,7 +220,7 @@ def param_serialize( body = self.sanitize_for_serialization(body) # request url - if _host is None or self.configuration.ignore_operation_servers: + if _host is None: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -313,9 +311,12 @@ def response_deserialize( match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - return_data = self.deserialize( - response_text, response_type, content_type - ) + if response_type in ["bytearray", "str"]: + return_data = self.__deserialize_primitive( + response_text, response_type + ) + else: + return_data = self.deserialize(response_text, response_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -339,7 +340,6 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. - If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -361,8 +361,6 @@ def sanitize_for_serialization(self, obj): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, decimal.Decimal): - return str(obj) elif isinstance(obj, dict): obj_dict = obj @@ -381,36 +379,21 @@ def sanitize_for_serialization(self, obj): key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } - def deserialize( - self, response_text: str, response_type: str, content_type: Optional[str] - ): + def deserialize(self, response_text, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. - :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - if content_type is None: - try: - data = json.loads(response_text) - except ValueError: - data = response_text - elif content_type.startswith("application/json"): - if response_text == "": - data = "" - else: - data = json.loads(response_text) - elif content_type.startswith("text/plain"): + try: + data = json.loads(response_text) + except ValueError: data = response_text - else: - raise ApiException( - status=0, reason="Unsupported content type: {0}".format(content_type) - ) return self.__deserialize(data, response_type) @@ -452,8 +435,6 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) - elif klass == decimal.Decimal: - return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: diff --git a/hatchet_sdk/clients/rest/configuration.py b/hatchet_sdk/clients/rest/configuration.py index 03743d0b..e33efa68 100644 --- a/hatchet_sdk/clients/rest/configuration.py +++ b/hatchet_sdk/clients/rest/configuration.py @@ -39,9 +39,6 @@ class Configuration: """This class contains various settings of the API client. :param host: Base url. - :param ignore_operation_servers - Boolean to ignore operation servers for the API client. - Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -64,7 +61,6 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Number of retries for API requests. :Example: @@ -102,11 +98,7 @@ def __init__( server_variables=None, server_operation_index=None, server_operation_variables=None, - ignore_operation_servers=False, ssl_ca_cert=None, - retries=None, - *, - debug: Optional[bool] = None ) -> None: """Constructor""" self._base_path = "http://localhost" if host is None else host @@ -120,9 +112,6 @@ def __init__( self.server_operation_variables = server_operation_variables or {} """Default server variables """ - self.ignore_operation_servers = ignore_operation_servers - """Ignore operation servers - """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -166,10 +155,7 @@ def __init__( self.logger_file = None """Debug file location """ - if debug is not None: - self.debug = debug - else: - self.__debug = False + self.debug = False """Debug switch """ @@ -209,7 +195,7 @@ def __init__( self.safe_chars_for_path_param = "" """Safe chars for path_param """ - self.retries = retries + self.retries = None """Adding retries to override urllib3 default value 3 """ # Enable client side validation diff --git a/hatchet_sdk/clients/rest/models/__init__.py b/hatchet_sdk/clients/rest/models/__init__.py index fab0ace1..244139e6 100644 --- a/hatchet_sdk/clients/rest/models/__init__.py +++ b/hatchet_sdk/clients/rest/models/__init__.py @@ -24,13 +24,6 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( - BulkCreateEventRequest, -) -from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( - BulkCreateEventResponse, -) -from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest from hatchet_sdk.clients.rest.models.create_api_token_request import ( CreateAPITokenRequest, ) @@ -59,9 +52,6 @@ EventOrderByDirection, ) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( - EventUpdateCancel200Response, -) from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( EventWorkflowRunSummary, ) @@ -181,6 +171,9 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( + WorkflowRunCancel200Response, +) from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( WorkflowRunOrderByDirection, @@ -188,7 +181,6 @@ from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( WorkflowRunOrderByField, ) -from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( WorkflowRunTriggeredBy, @@ -213,4 +205,3 @@ WorkflowVersionDefinition, ) from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta -from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount diff --git a/hatchet_sdk/clients/rest/models/api_errors.py b/hatchet_sdk/clients/rest/models/api_errors.py index e4dfed11..e41cf5fc 100644 --- a/hatchet_sdk/clients/rest/models/api_errors.py +++ b/hatchet_sdk/clients/rest/models/api_errors.py @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in errors (list) _items = [] if self.errors: - for _item_errors in self.errors: - if _item_errors: - _items.append(_item_errors.to_dict()) + for _item in self.errors: + if _item: + _items.append(_item.to_dict()) _dict["errors"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/event_list.py b/hatchet_sdk/clients/rest/models/event_list.py index 5c928005..e12aa656 100644 --- a/hatchet_sdk/clients/rest/models/event_list.py +++ b/hatchet_sdk/clients/rest/models/event_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py index b9dbc435..c01018b6 100644 --- a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +++ b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in diffs (list) _items = [] if self.diffs: - for _item_diffs in self.diffs: - if _item_diffs: - _items.append(_item_diffs.to_dict()) + for _item in self.diffs: + if _item: + _items.append(_item.to_dict()) _dict["diffs"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/job.py b/hatchet_sdk/clients/rest/models/job.py index c412ef68..aceaf6f4 100644 --- a/hatchet_sdk/clients/rest/models/job.py +++ b/hatchet_sdk/clients/rest/models/job.py @@ -95,9 +95,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: - for _item_steps in self.steps: - if _item_steps: - _items.append(_item_steps.to_dict()) + for _item in self.steps: + if _item: + _items.append(_item.to_dict()) _dict["steps"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/job_run.py b/hatchet_sdk/clients/rest/models/job_run.py index 3a7ec051..a9b0da3b 100644 --- a/hatchet_sdk/clients/rest/models/job_run.py +++ b/hatchet_sdk/clients/rest/models/job_run.py @@ -117,9 +117,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in step_runs (list) _items = [] if self.step_runs: - for _item_step_runs in self.step_runs: - if _item_step_runs: - _items.append(_item_step_runs.to_dict()) + for _item in self.step_runs: + if _item: + _items.append(_item.to_dict()) _dict["stepRuns"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py index b3590ab3..df9b60ac 100644 --- a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py +++ b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py index 589d4c45..6cfd61bb 100644 --- a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py +++ b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in pull_requests (list) _items = [] if self.pull_requests: - for _item_pull_requests in self.pull_requests: - if _item_pull_requests: - _items.append(_item_pull_requests.to_dict()) + for _item in self.pull_requests: + if _item: + _items.append(_item.to_dict()) _dict["pullRequests"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py index e86956d3..647bc276 100644 --- a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py +++ b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/list_sns_integrations.py b/hatchet_sdk/clients/rest/models/list_sns_integrations.py index 130e9127..ecf67484 100644 --- a/hatchet_sdk/clients/rest/models/list_sns_integrations.py +++ b/hatchet_sdk/clients/rest/models/list_sns_integrations.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/log_line_list.py b/hatchet_sdk/clients/rest/models/log_line_list.py index e05d186a..306ee2c7 100644 --- a/hatchet_sdk/clients/rest/models/log_line_list.py +++ b/hatchet_sdk/clients/rest/models/log_line_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py index d8a9609d..6f0f780f 100644 --- a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +++ b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in workflow_runs (list) _items = [] if self.workflow_runs: - for _item_workflow_runs in self.workflow_runs: - if _item_workflow_runs: - _items.append(_item_workflow_runs.to_dict()) + for _item in self.workflow_runs: + if _item: + _items.append(_item.to_dict()) _dict["workflowRuns"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/semaphore_slots.py b/hatchet_sdk/clients/rest/models/semaphore_slots.py index 1e7c6242..1ca45f37 100644 --- a/hatchet_sdk/clients/rest/models/semaphore_slots.py +++ b/hatchet_sdk/clients/rest/models/semaphore_slots.py @@ -31,19 +31,25 @@ class SemaphoreSlots(BaseModel): SemaphoreSlots """ # noqa: E501 - step_run_id: StrictStr = Field(description="The step run id.", alias="stepRunId") - action_id: StrictStr = Field(description="The action id.", alias="actionId") + slot: StrictStr = Field(description="The slot name.") + step_run_id: Optional[StrictStr] = Field( + default=None, description="The step run id.", alias="stepRunId" + ) + action_id: Optional[StrictStr] = Field( + default=None, description="The action id.", alias="actionId" + ) started_at: Optional[datetime] = Field( default=None, description="The time this slot was started.", alias="startedAt" ) timeout_at: Optional[datetime] = Field( default=None, description="The time this slot will timeout.", alias="timeoutAt" ) - workflow_run_id: StrictStr = Field( - description="The workflow run id.", alias="workflowRunId" + workflow_run_id: Optional[StrictStr] = Field( + default=None, description="The workflow run id.", alias="workflowRunId" ) - status: StepRunStatus + status: Optional[StepRunStatus] = None __properties: ClassVar[List[str]] = [ + "slot", "stepRunId", "actionId", "startedAt", @@ -102,6 +108,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { + "slot": obj.get("slot"), "stepRunId": obj.get("stepRunId"), "actionId": obj.get("actionId"), "startedAt": obj.get("startedAt"), diff --git a/hatchet_sdk/clients/rest/models/step_run.py b/hatchet_sdk/clients/rest/models/step_run.py index 7e6b4b22..7fa8d91a 100644 --- a/hatchet_sdk/clients/rest/models/step_run.py +++ b/hatchet_sdk/clients/rest/models/step_run.py @@ -39,9 +39,7 @@ class StepRun(BaseModel): job_run: Optional[JobRun] = Field(default=None, alias="jobRun") step_id: StrictStr = Field(alias="stepId") step: Optional[Step] = None - child_workflows_count: Optional[StrictInt] = Field( - default=None, alias="childWorkflowsCount" - ) + children: Optional[List[StrictStr]] = None parents: Optional[List[StrictStr]] = None child_workflow_runs: Optional[List[StrictStr]] = Field( default=None, alias="childWorkflowRuns" @@ -74,7 +72,7 @@ class StepRun(BaseModel): "jobRun", "stepId", "step", - "childWorkflowsCount", + "children", "parents", "childWorkflowRuns", "workerId", @@ -171,7 +169,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "step": ( Step.from_dict(obj["step"]) if obj.get("step") is not None else None ), - "childWorkflowsCount": obj.get("childWorkflowsCount"), + "children": obj.get("children"), "parents": obj.get("parents"), "childWorkflowRuns": obj.get("childWorkflowRuns"), "workerId": obj.get("workerId"), diff --git a/hatchet_sdk/clients/rest/models/step_run_archive.py b/hatchet_sdk/clients/rest/models/step_run_archive.py index 7476174d..ccae3d28 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive.py @@ -35,7 +35,6 @@ class StepRunArchive(BaseModel): output: Optional[StrictStr] = None started_at: Optional[datetime] = Field(default=None, alias="startedAt") error: Optional[StrictStr] = None - retry_count: StrictInt = Field(alias="retryCount") created_at: datetime = Field(alias="createdAt") started_at_epoch: Optional[StrictInt] = Field(default=None, alias="startedAtEpoch") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") @@ -57,7 +56,6 @@ class StepRunArchive(BaseModel): "output", "startedAt", "error", - "retryCount", "createdAt", "startedAtEpoch", "finishedAt", @@ -126,7 +124,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "output": obj.get("output"), "startedAt": obj.get("startedAt"), "error": obj.get("error"), - "retryCount": obj.get("retryCount"), "createdAt": obj.get("createdAt"), "startedAtEpoch": obj.get("startedAtEpoch"), "finishedAt": obj.get("finishedAt"), diff --git a/hatchet_sdk/clients/rest/models/step_run_archive_list.py b/hatchet_sdk/clients/rest/models/step_run_archive_list.py index eb4bcef2..fcc1419c 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/step_run_event.py b/hatchet_sdk/clients/rest/models/step_run_event.py index c5909d24..841ba053 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event.py +++ b/hatchet_sdk/clients/rest/models/step_run_event.py @@ -35,8 +35,7 @@ class StepRunEvent(BaseModel): id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") - step_run_id: Optional[StrictStr] = Field(default=None, alias="stepRunId") - workflow_run_id: Optional[StrictStr] = Field(default=None, alias="workflowRunId") + step_run_id: StrictStr = Field(alias="stepRunId") reason: StepRunEventReason severity: StepRunEventSeverity message: StrictStr @@ -47,7 +46,6 @@ class StepRunEvent(BaseModel): "timeFirstSeen", "timeLastSeen", "stepRunId", - "workflowRunId", "reason", "severity", "message", @@ -109,7 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "timeFirstSeen": obj.get("timeFirstSeen"), "timeLastSeen": obj.get("timeLastSeen"), "stepRunId": obj.get("stepRunId"), - "workflowRunId": obj.get("workflowRunId"), "reason": obj.get("reason"), "severity": obj.get("severity"), "message": obj.get("message"), diff --git a/hatchet_sdk/clients/rest/models/step_run_event_list.py b/hatchet_sdk/clients/rest/models/step_run_event_list.py index f146eb8e..a46f2089 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/step_run_event_reason.py b/hatchet_sdk/clients/rest/models/step_run_event_reason.py index 348f7596..617006cd 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_reason.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_reason.py @@ -42,8 +42,6 @@ class StepRunEventReason(str, Enum): TIMED_OUT = "TIMED_OUT" SLOT_RELEASED = "SLOT_RELEASED" RETRIED_BY_USER = "RETRIED_BY_USER" - WORKFLOW_RUN_GROUP_KEY_SUCCEEDED = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED" - WORKFLOW_RUN_GROUP_KEY_FAILED = "WORKFLOW_RUN_GROUP_KEY_FAILED" @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py index 73d67df4..9e1a4fc1 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py @@ -80,9 +80,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/tenant_invite_list.py b/hatchet_sdk/clients/rest/models/tenant_invite_list.py index 0ed078ef..95e4ba4d 100644 --- a/hatchet_sdk/clients/rest/models/tenant_invite_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_invite_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/tenant_list.py b/hatchet_sdk/clients/rest/models/tenant_list.py index 2dbb320e..623d6206 100644 --- a/hatchet_sdk/clients/rest/models/tenant_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/tenant_member_list.py b/hatchet_sdk/clients/rest/models/tenant_member_list.py index 5aabdcd1..6627c281 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_member_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py index 5b83ae45..fc348a5e 100644 --- a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py @@ -76,13 +76,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of total if self.total: _dict["total"] = self.total.to_dict() - # override the default output from pydantic by calling `to_dict()` of each value in workflow (dict) - _field_dict = {} - if self.workflow: - for _key_workflow in self.workflow: - if self.workflow[_key_workflow]: - _field_dict[_key_workflow] = self.workflow[_key_workflow].to_dict() - _dict["workflow"] = _field_dict return _dict @classmethod @@ -101,14 +94,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("total") is not None else None ), - "workflow": ( - dict( - (_k, QueueMetrics.from_dict(_v)) - for _k, _v in obj["workflow"].items() - ) - if obj.get("workflow") is not None - else None - ), } ) return _obj diff --git a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py index b9e5181f..c8f10af0 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py @@ -75,9 +75,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in limits (list) _items = [] if self.limits: - for _item_limits in self.limits: - if _item_limits: - _items.append(_item_limits.to_dict()) + for _item in self.limits: + if _item: + _items.append(_item.to_dict()) _dict["limits"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py index 98b8041b..1f45b260 100644 --- a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +++ b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py index a221e182..2d9e08c7 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py index ec813a38..30915cd0 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py @@ -75,9 +75,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in requests (list) _items = [] if self.requests: - for _item_requests in self.requests: - if _item_requests: - _items.append(_item_requests.to_dict()) + for _item in self.requests: + if _item: + _items.append(_item.to_dict()) _dict["requests"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/worker.py b/hatchet_sdk/clients/rest/models/worker.py index 0d89492a..48e6eda8 100644 --- a/hatchet_sdk/clients/rest/models/worker.py +++ b/hatchet_sdk/clients/rest/models/worker.py @@ -169,23 +169,23 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in slots (list) _items = [] if self.slots: - for _item_slots in self.slots: - if _item_slots: - _items.append(_item_slots.to_dict()) + for _item in self.slots: + if _item: + _items.append(_item.to_dict()) _dict["slots"] = _items # override the default output from pydantic by calling `to_dict()` of each item in recent_step_runs (list) _items = [] if self.recent_step_runs: - for _item_recent_step_runs in self.recent_step_runs: - if _item_recent_step_runs: - _items.append(_item_recent_step_runs.to_dict()) + for _item in self.recent_step_runs: + if _item: + _items.append(_item.to_dict()) _dict["recentStepRuns"] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: - for _item_labels in self.labels: - if _item_labels: - _items.append(_item_labels.to_dict()) + for _item in self.labels: + if _item: + _items.append(_item.to_dict()) _dict["labels"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/worker_list.py b/hatchet_sdk/clients/rest/models/worker_list.py index bb02d792..3ffa4349 100644 --- a/hatchet_sdk/clients/rest/models/worker_list.py +++ b/hatchet_sdk/clients/rest/models/worker_list.py @@ -78,9 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/workflow.py b/hatchet_sdk/clients/rest/models/workflow.py index 59e07b08..1d772ff0 100644 --- a/hatchet_sdk/clients/rest/models/workflow.py +++ b/hatchet_sdk/clients/rest/models/workflow.py @@ -96,23 +96,23 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in versions (list) _items = [] if self.versions: - for _item_versions in self.versions: - if _item_versions: - _items.append(_item_versions.to_dict()) + for _item in self.versions: + if _item: + _items.append(_item.to_dict()) _dict["versions"] = _items # override the default output from pydantic by calling `to_dict()` of each item in tags (list) _items = [] if self.tags: - for _item_tags in self.tags: - if _item_tags: - _items.append(_item_tags.to_dict()) + for _item in self.tags: + if _item: + _items.append(_item.to_dict()) _dict["tags"] = _items # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: - for _item_jobs in self.jobs: - if _item_jobs: - _items.append(_item_jobs.to_dict()) + for _item in self.jobs: + if _item: + _items.append(_item.to_dict()) _dict["jobs"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/workflow_list.py b/hatchet_sdk/clients/rest/models/workflow_list.py index 9eb14aee..72f9fb90 100644 --- a/hatchet_sdk/clients/rest/models/workflow_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_list.py @@ -80,9 +80,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: diff --git a/hatchet_sdk/clients/rest/models/workflow_run.py b/hatchet_sdk/clients/rest/models/workflow_run.py index 903da30f..3362b830 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run.py +++ b/hatchet_sdk/clients/rest/models/workflow_run.py @@ -125,9 +125,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in job_runs (list) _items = [] if self.job_runs: - for _item_job_runs in self.job_runs: - if _item_job_runs: - _items.append(_item_job_runs.to_dict()) + for _item in self.job_runs: + if _item: + _items.append(_item.to_dict()) _dict["jobRuns"] = _items # override the default output from pydantic by calling `to_dict()` of triggered_by if self.triggered_by: diff --git a/hatchet_sdk/clients/rest/models/workflow_run_list.py b/hatchet_sdk/clients/rest/models/workflow_run_list.py index a56d3feb..e57a14f4 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_list.py @@ -75,9 +75,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: diff --git a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py index 8cbe1c11..a69fc9de 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py @@ -23,6 +23,7 @@ from typing_extensions import Self from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.rest.models.event import Event class WorkflowRunTriggeredBy(BaseModel): @@ -31,16 +32,16 @@ class WorkflowRunTriggeredBy(BaseModel): """ # noqa: E501 metadata: APIResourceMeta - parent_workflow_run_id: Optional[StrictStr] = Field( - default=None, alias="parentWorkflowRunId" - ) + parent_id: StrictStr = Field(alias="parentId") event_id: Optional[StrictStr] = Field(default=None, alias="eventId") + event: Optional[Event] = None cron_parent_id: Optional[StrictStr] = Field(default=None, alias="cronParentId") cron_schedule: Optional[StrictStr] = Field(default=None, alias="cronSchedule") __properties: ClassVar[List[str]] = [ "metadata", - "parentWorkflowRunId", + "parentId", "eventId", + "event", "cronParentId", "cronSchedule", ] @@ -85,6 +86,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict["metadata"] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of event + if self.event: + _dict["event"] = self.event.to_dict() return _dict @classmethod @@ -103,8 +107,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("metadata") is not None else None ), - "parentWorkflowRunId": obj.get("parentWorkflowRunId"), + "parentId": obj.get("parentId"), "eventId": obj.get("eventId"), + "event": ( + Event.from_dict(obj["event"]) + if obj.get("event") is not None + else None + ), "cronParentId": obj.get("cronParentId"), "cronSchedule": obj.get("cronSchedule"), } diff --git a/hatchet_sdk/clients/rest/models/workflow_triggers.py b/hatchet_sdk/clients/rest/models/workflow_triggers.py index fd2f07ef..d3fff3f1 100644 --- a/hatchet_sdk/clients/rest/models/workflow_triggers.py +++ b/hatchet_sdk/clients/rest/models/workflow_triggers.py @@ -92,16 +92,16 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: - for _item_events in self.events: - if _item_events: - _items.append(_item_events.to_dict()) + for _item in self.events: + if _item: + _items.append(_item.to_dict()) _dict["events"] = _items # override the default output from pydantic by calling `to_dict()` of each item in crons (list) _items = [] if self.crons: - for _item_crons in self.crons: - if _item_crons: - _items.append(_item_crons.to_dict()) + for _item in self.crons: + if _item: + _items.append(_item.to_dict()) _dict["crons"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/workflow_version.py b/hatchet_sdk/clients/rest/models/workflow_version.py index 47554e56..67c85009 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version.py +++ b/hatchet_sdk/clients/rest/models/workflow_version.py @@ -38,14 +38,6 @@ class WorkflowVersion(BaseModel): version: StrictStr = Field(description="The version of the workflow.") order: StrictInt workflow_id: StrictStr = Field(alias="workflowId") - sticky: Optional[StrictStr] = Field( - default=None, description="The sticky strategy of the workflow." - ) - default_priority: Optional[StrictInt] = Field( - default=None, - description="The default priority of the workflow.", - alias="defaultPriority", - ) workflow: Optional[Workflow] = None concurrency: Optional[WorkflowConcurrency] = None triggers: Optional[WorkflowTriggers] = None @@ -56,8 +48,6 @@ class WorkflowVersion(BaseModel): "version", "order", "workflowId", - "sticky", - "defaultPriority", "workflow", "concurrency", "triggers", @@ -117,9 +107,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: - for _item_jobs in self.jobs: - if _item_jobs: - _items.append(_item_jobs.to_dict()) + for _item in self.jobs: + if _item: + _items.append(_item.to_dict()) _dict["jobs"] = _items return _dict @@ -142,8 +132,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "version": obj.get("version"), "order": obj.get("order"), "workflowId": obj.get("workflowId"), - "sticky": obj.get("sticky"), - "defaultPriority": obj.get("defaultPriority"), "workflow": ( Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None diff --git a/hatchet_sdk/clients/rest/rest.py b/hatchet_sdk/clients/rest/rest.py index 35284aab..67566fa1 100644 --- a/hatchet_sdk/clients/rest/rest.py +++ b/hatchet_sdk/clients/rest/rest.py @@ -81,7 +81,7 @@ def __init__(self, configuration) -> None: self.retry_client = aiohttp_retry.RetryClient( client_session=self.pool_manager, retry_options=aiohttp_retry.ExponentialRetry( - attempts=retries, factor=2.0, start_timeout=0.1, max_timeout=120.0 + attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 ), ) else: @@ -159,10 +159,10 @@ async def request( data.add_field(k, v) args["data"] = data - # Pass a `bytes` or `str` parameter directly in the body to support + # Pass a `bytes` parameter directly in the body to support # other content types than Json when `body` argument is provided # in serialized form - elif isinstance(body, str) or isinstance(body, bytes): + elif isinstance(body, bytes): args["data"] = body else: # Cannot generate the request from given parameters diff --git a/hatchet_sdk/contracts/events_pb2.py b/hatchet_sdk/contracts/events_pb2.py index a0166ace..e105621a 100644 --- a/hatchet_sdk/contracts/events_pb2.py +++ b/hatchet_sdk/contracts/events_pb2.py @@ -15,7 +15,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65vents.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb4\x01\n\x05\x45vent\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x0f\n\x07\x65ventId\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\" \n\x06\x45vents\x12\x16\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x06.Event\"\x92\x01\n\rPutLogRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x12\n\x05level\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08metadata\x18\x05 \x01(\tB\x08\n\x06_level\"\x10\n\x0ePutLogResponse\"|\n\x15PutStreamEventRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\x0c\x12\x10\n\x08metadata\x18\x05 \x01(\t\"\x18\n\x16PutStreamEventResponse\"9\n\x14\x42ulkPushEventRequest\x12!\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x11.PushEventRequest\"\x9c\x01\n\x10PushEventRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"%\n\x12ReplayEventRequest\x12\x0f\n\x07\x65ventId\x18\x01 \x01(\t2\x88\x02\n\rEventsService\x12#\n\x04Push\x12\x11.PushEventRequest\x1a\x06.Event\"\x00\x12,\n\x08\x42ulkPush\x12\x15.BulkPushEventRequest\x1a\x07.Events\"\x00\x12\x32\n\x11ReplaySingleEvent\x12\x13.ReplayEventRequest\x1a\x06.Event\"\x00\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse\"\x00\x12\x43\n\x0ePutStreamEvent\x12\x16.PutStreamEventRequest\x1a\x17.PutStreamEventResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65vents.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb4\x01\n\x05\x45vent\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x0f\n\x07\x65ventId\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"\x92\x01\n\rPutLogRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x12\n\x05level\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08metadata\x18\x05 \x01(\tB\x08\n\x06_level\"\x10\n\x0ePutLogResponse\"|\n\x15PutStreamEventRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\x0c\x12\x10\n\x08metadata\x18\x05 \x01(\t\"\x18\n\x16PutStreamEventResponse\"\x9c\x01\n\x10PushEventRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"%\n\x12ReplayEventRequest\x12\x0f\n\x07\x65ventId\x18\x01 \x01(\t2\xda\x01\n\rEventsService\x12#\n\x04Push\x12\x11.PushEventRequest\x1a\x06.Event\"\x00\x12\x32\n\x11ReplaySingleEvent\x12\x13.ReplayEventRequest\x1a\x06.Event\"\x00\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse\"\x00\x12\x43\n\x0ePutStreamEvent\x12\x16.PutStreamEventRequest\x1a\x17.PutStreamEventResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -25,22 +25,18 @@ _globals['DESCRIPTOR']._serialized_options = b'ZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contracts' _globals['_EVENT']._serialized_start=50 _globals['_EVENT']._serialized_end=230 - _globals['_EVENTS']._serialized_start=232 - _globals['_EVENTS']._serialized_end=264 - _globals['_PUTLOGREQUEST']._serialized_start=267 - _globals['_PUTLOGREQUEST']._serialized_end=413 - _globals['_PUTLOGRESPONSE']._serialized_start=415 - _globals['_PUTLOGRESPONSE']._serialized_end=431 - _globals['_PUTSTREAMEVENTREQUEST']._serialized_start=433 - _globals['_PUTSTREAMEVENTREQUEST']._serialized_end=557 - _globals['_PUTSTREAMEVENTRESPONSE']._serialized_start=559 - _globals['_PUTSTREAMEVENTRESPONSE']._serialized_end=583 - _globals['_BULKPUSHEVENTREQUEST']._serialized_start=585 - _globals['_BULKPUSHEVENTREQUEST']._serialized_end=642 - _globals['_PUSHEVENTREQUEST']._serialized_start=645 - _globals['_PUSHEVENTREQUEST']._serialized_end=801 - _globals['_REPLAYEVENTREQUEST']._serialized_start=803 - _globals['_REPLAYEVENTREQUEST']._serialized_end=840 - _globals['_EVENTSSERVICE']._serialized_start=843 - _globals['_EVENTSSERVICE']._serialized_end=1107 + _globals['_PUTLOGREQUEST']._serialized_start=233 + _globals['_PUTLOGREQUEST']._serialized_end=379 + _globals['_PUTLOGRESPONSE']._serialized_start=381 + _globals['_PUTLOGRESPONSE']._serialized_end=397 + _globals['_PUTSTREAMEVENTREQUEST']._serialized_start=399 + _globals['_PUTSTREAMEVENTREQUEST']._serialized_end=523 + _globals['_PUTSTREAMEVENTRESPONSE']._serialized_start=525 + _globals['_PUTSTREAMEVENTRESPONSE']._serialized_end=549 + _globals['_PUSHEVENTREQUEST']._serialized_start=552 + _globals['_PUSHEVENTREQUEST']._serialized_end=708 + _globals['_REPLAYEVENTREQUEST']._serialized_start=710 + _globals['_REPLAYEVENTREQUEST']._serialized_end=747 + _globals['_EVENTSSERVICE']._serialized_start=750 + _globals['_EVENTSSERVICE']._serialized_end=968 # @@protoc_insertion_point(module_scope) diff --git a/hatchet_sdk/contracts/events_pb2.pyi b/hatchet_sdk/contracts/events_pb2.pyi index e9132fb2..40447467 100644 --- a/hatchet_sdk/contracts/events_pb2.pyi +++ b/hatchet_sdk/contracts/events_pb2.pyi @@ -1,8 +1,7 @@ from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union +from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -22,12 +21,6 @@ class Event(_message.Message): additionalMetadata: str def __init__(self, tenantId: _Optional[str] = ..., eventId: _Optional[str] = ..., key: _Optional[str] = ..., payload: _Optional[str] = ..., eventTimestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., additionalMetadata: _Optional[str] = ...) -> None: ... -class Events(_message.Message): - __slots__ = ("events",) - EVENTS_FIELD_NUMBER: _ClassVar[int] - events: _containers.RepeatedCompositeFieldContainer[Event] - def __init__(self, events: _Optional[_Iterable[_Union[Event, _Mapping]]] = ...) -> None: ... - class PutLogRequest(_message.Message): __slots__ = ("stepRunId", "createdAt", "message", "level", "metadata") STEPRUNID_FIELD_NUMBER: _ClassVar[int] @@ -62,12 +55,6 @@ class PutStreamEventResponse(_message.Message): __slots__ = () def __init__(self) -> None: ... -class BulkPushEventRequest(_message.Message): - __slots__ = ("events",) - EVENTS_FIELD_NUMBER: _ClassVar[int] - events: _containers.RepeatedCompositeFieldContainer[PushEventRequest] - def __init__(self, events: _Optional[_Iterable[_Union[PushEventRequest, _Mapping]]] = ...) -> None: ... - class PushEventRequest(_message.Message): __slots__ = ("key", "payload", "eventTimestamp", "additionalMetadata") KEY_FIELD_NUMBER: _ClassVar[int] diff --git a/hatchet_sdk/contracts/events_pb2_grpc.py b/hatchet_sdk/contracts/events_pb2_grpc.py index 344d3798..66fae0dd 100644 --- a/hatchet_sdk/contracts/events_pb2_grpc.py +++ b/hatchet_sdk/contracts/events_pb2_grpc.py @@ -19,11 +19,6 @@ def __init__(self, channel): request_serializer=events__pb2.PushEventRequest.SerializeToString, response_deserializer=events__pb2.Event.FromString, ) - self.BulkPush = channel.unary_unary( - '/EventsService/BulkPush', - request_serializer=events__pb2.BulkPushEventRequest.SerializeToString, - response_deserializer=events__pb2.Events.FromString, - ) self.ReplaySingleEvent = channel.unary_unary( '/EventsService/ReplaySingleEvent', request_serializer=events__pb2.ReplayEventRequest.SerializeToString, @@ -50,12 +45,6 @@ def Push(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def BulkPush(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def ReplaySingleEvent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -82,11 +71,6 @@ def add_EventsServiceServicer_to_server(servicer, server): request_deserializer=events__pb2.PushEventRequest.FromString, response_serializer=events__pb2.Event.SerializeToString, ), - 'BulkPush': grpc.unary_unary_rpc_method_handler( - servicer.BulkPush, - request_deserializer=events__pb2.BulkPushEventRequest.FromString, - response_serializer=events__pb2.Events.SerializeToString, - ), 'ReplaySingleEvent': grpc.unary_unary_rpc_method_handler( servicer.ReplaySingleEvent, request_deserializer=events__pb2.ReplayEventRequest.FromString, @@ -129,23 +113,6 @@ def Push(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod - def BulkPush(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/EventsService/BulkPush', - events__pb2.BulkPushEventRequest.SerializeToString, - events__pb2.Events.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - @staticmethod def ReplaySingleEvent(request, target, diff --git a/hatchet_sdk/contracts/workflows_pb2.py b/hatchet_sdk/contracts/workflows_pb2.py index 0d4a0c6e..bb9b72e7 100644 --- a/hatchet_sdk/contracts/workflows_pb2.py +++ b/hatchet_sdk/contracts/workflows_pb2.py @@ -15,7 +15,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fworkflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"\xd0\x01\n\x17WorkflowConcurrencyOpts\x12\x13\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x36\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategyH\x02\x88\x01\x01\x12\x17\n\nexpression\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_actionB\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\r\n\x0b_expression\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xe1\x01\n\x13\x44\x65siredWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\x08required\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12/\n\ncomparator\x18\x04 \x01(\x0e\x32\x16.WorkerLabelComparatorH\x03\x88\x01\x01\x12\x13\n\x06weight\x18\x05 \x01(\x05H\x04\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValueB\x0b\n\t_requiredB\r\n\x0b_comparatorB\t\n\x07_weight\"\xcb\x02\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x1aI\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.DesiredWorkerLabels:\x02\x38\x01\"1\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05units\x18\x02 \x01(\x05\"\x16\n\x14ListWorkflowsRequest\"\x93\x02\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_key\"\xb2\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x05\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"\xf7\x02\n\x16TriggerWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\t\x12\x16\n\tparent_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x05 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x06 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1e\n\x11\x64\x65sired_worker_id\x18\x08 \x01(\tH\x05\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x06\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x14\n\x12_desired_worker_idB\x0b\n\t_priority\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*l\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03*\x85\x01\n\x15WorkerLabelComparator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x05*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\x8a\x02\n\x0fWorkflowService\x12\x34\n\x0bPutWorkflow\x12\x13.PutWorkflowRequest\x1a\x10.WorkflowVersion\x12>\n\x10ScheduleWorkflow\x12\x18.ScheduleWorkflowRequest\x1a\x10.WorkflowVersion\x12\x44\n\x0fTriggerWorkflow\x12\x17.TriggerWorkflowRequest\x1a\x18.TriggerWorkflowResponse\x12;\n\x0cPutRateLimit\x12\x14.PutRateLimitRequest\x1a\x15.PutRateLimitResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/admin/contractsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fworkflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"n\n\x17WorkflowConcurrencyOpts\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\x12\x10\n\x08max_runs\x18\x02 \x01(\x05\x12\x31\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategy\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xe1\x01\n\x13\x44\x65siredWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\x08required\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12/\n\ncomparator\x18\x04 \x01(\x0e\x32\x16.WorkerLabelComparatorH\x03\x88\x01\x01\x12\x13\n\x06weight\x18\x05 \x01(\x05H\x04\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValueB\x0b\n\t_requiredB\r\n\x0b_comparatorB\t\n\x07_weight\"\xcb\x02\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x1aI\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.DesiredWorkerLabels:\x02\x38\x01\"1\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05units\x18\x02 \x01(\x05\"\x16\n\x14ListWorkflowsRequest\"\x93\x02\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_key\"\xb2\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x05\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"\xf7\x02\n\x16TriggerWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\t\x12\x16\n\tparent_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x05 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x06 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1e\n\x11\x64\x65sired_worker_id\x18\x08 \x01(\tH\x05\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x06\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x14\n\x12_desired_worker_idB\x0b\n\t_priority\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*l\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03*\x85\x01\n\x15WorkerLabelComparator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x05*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\x8a\x02\n\x0fWorkflowService\x12\x34\n\x0bPutWorkflow\x12\x13.PutWorkflowRequest\x1a\x10.WorkflowVersion\x12>\n\x10ScheduleWorkflow\x12\x18.ScheduleWorkflowRequest\x1a\x10.WorkflowVersion\x12\x44\n\x0fTriggerWorkflow\x12\x17.TriggerWorkflowRequest\x1a\x18.TriggerWorkflowResponse\x12;\n\x0cPutRateLimit\x12\x14.PutRateLimitRequest\x1a\x15.PutRateLimitResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/admin/contractsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -25,50 +25,50 @@ _globals['DESCRIPTOR']._serialized_options = b'Z@github.com/hatchet-dev/hatchet/internal/services/admin/contracts' _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._options = None _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_options = b'8\001' - _globals['_STICKYSTRATEGY']._serialized_start=2774 - _globals['_STICKYSTRATEGY']._serialized_end=2810 - _globals['_WORKFLOWKIND']._serialized_start=2812 - _globals['_WORKFLOWKIND']._serialized_end=2862 - _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_start=2864 - _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_end=2972 - _globals['_WORKERLABELCOMPARATOR']._serialized_start=2975 - _globals['_WORKERLABELCOMPARATOR']._serialized_end=3108 - _globals['_RATELIMITDURATION']._serialized_start=3110 - _globals['_RATELIMITDURATION']._serialized_end=3203 + _globals['_STICKYSTRATEGY']._serialized_start=2675 + _globals['_STICKYSTRATEGY']._serialized_end=2711 + _globals['_WORKFLOWKIND']._serialized_start=2713 + _globals['_WORKFLOWKIND']._serialized_end=2763 + _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_start=2765 + _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_end=2873 + _globals['_WORKERLABELCOMPARATOR']._serialized_start=2876 + _globals['_WORKERLABELCOMPARATOR']._serialized_end=3009 + _globals['_RATELIMITDURATION']._serialized_start=3011 + _globals['_RATELIMITDURATION']._serialized_end=3104 _globals['_PUTWORKFLOWREQUEST']._serialized_start=52 _globals['_PUTWORKFLOWREQUEST']._serialized_end=114 _globals['_CREATEWORKFLOWVERSIONOPTS']._serialized_start=117 _globals['_CREATEWORKFLOWVERSIONOPTS']._serialized_end=692 - _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_start=695 - _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_end=903 - _globals['_CREATEWORKFLOWJOBOPTS']._serialized_start=905 - _globals['_CREATEWORKFLOWJOBOPTS']._serialized_end=1009 - _globals['_DESIREDWORKERLABELS']._serialized_start=1012 - _globals['_DESIREDWORKERLABELS']._serialized_end=1237 - _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_start=1240 - _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_end=1571 - _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_start=1498 - _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_end=1571 - _globals['_CREATESTEPRATELIMIT']._serialized_start=1573 - _globals['_CREATESTEPRATELIMIT']._serialized_end=1622 - _globals['_LISTWORKFLOWSREQUEST']._serialized_start=1624 - _globals['_LISTWORKFLOWSREQUEST']._serialized_end=1646 - _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_start=1649 - _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_end=1924 - _globals['_WORKFLOWVERSION']._serialized_start=1927 - _globals['_WORKFLOWVERSION']._serialized_end=2105 - _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_start=2107 - _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_end=2170 - _globals['_WORKFLOWTRIGGERCRONREF']._serialized_start=2172 - _globals['_WORKFLOWTRIGGERCRONREF']._serialized_end=2229 - _globals['_TRIGGERWORKFLOWREQUEST']._serialized_start=2232 - _globals['_TRIGGERWORKFLOWREQUEST']._serialized_end=2607 - _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_start=2609 - _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_end=2659 - _globals['_PUTRATELIMITREQUEST']._serialized_start=2661 - _globals['_PUTRATELIMITREQUEST']._serialized_end=2748 - _globals['_PUTRATELIMITRESPONSE']._serialized_start=2750 - _globals['_PUTRATELIMITRESPONSE']._serialized_end=2772 - _globals['_WORKFLOWSERVICE']._serialized_start=3206 - _globals['_WORKFLOWSERVICE']._serialized_end=3472 + _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_start=694 + _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_end=804 + _globals['_CREATEWORKFLOWJOBOPTS']._serialized_start=806 + _globals['_CREATEWORKFLOWJOBOPTS']._serialized_end=910 + _globals['_DESIREDWORKERLABELS']._serialized_start=913 + _globals['_DESIREDWORKERLABELS']._serialized_end=1138 + _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_start=1141 + _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_end=1472 + _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_start=1399 + _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_end=1472 + _globals['_CREATESTEPRATELIMIT']._serialized_start=1474 + _globals['_CREATESTEPRATELIMIT']._serialized_end=1523 + _globals['_LISTWORKFLOWSREQUEST']._serialized_start=1525 + _globals['_LISTWORKFLOWSREQUEST']._serialized_end=1547 + _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_start=1550 + _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_end=1825 + _globals['_WORKFLOWVERSION']._serialized_start=1828 + _globals['_WORKFLOWVERSION']._serialized_end=2006 + _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_start=2008 + _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_end=2071 + _globals['_WORKFLOWTRIGGERCRONREF']._serialized_start=2073 + _globals['_WORKFLOWTRIGGERCRONREF']._serialized_end=2130 + _globals['_TRIGGERWORKFLOWREQUEST']._serialized_start=2133 + _globals['_TRIGGERWORKFLOWREQUEST']._serialized_end=2508 + _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_start=2510 + _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_end=2560 + _globals['_PUTRATELIMITREQUEST']._serialized_start=2562 + _globals['_PUTRATELIMITREQUEST']._serialized_end=2649 + _globals['_PUTRATELIMITRESPONSE']._serialized_start=2651 + _globals['_PUTRATELIMITRESPONSE']._serialized_end=2673 + _globals['_WORKFLOWSERVICE']._serialized_start=3107 + _globals['_WORKFLOWSERVICE']._serialized_end=3373 # @@protoc_insertion_point(module_scope) diff --git a/hatchet_sdk/contracts/workflows_pb2.pyi b/hatchet_sdk/contracts/workflows_pb2.pyi index bd9f058a..b58fa382 100644 --- a/hatchet_sdk/contracts/workflows_pb2.pyi +++ b/hatchet_sdk/contracts/workflows_pb2.pyi @@ -105,16 +105,14 @@ class CreateWorkflowVersionOpts(_message.Message): def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., version: _Optional[str] = ..., event_triggers: _Optional[_Iterable[str]] = ..., cron_triggers: _Optional[_Iterable[str]] = ..., scheduled_triggers: _Optional[_Iterable[_Union[_timestamp_pb2.Timestamp, _Mapping]]] = ..., jobs: _Optional[_Iterable[_Union[CreateWorkflowJobOpts, _Mapping]]] = ..., concurrency: _Optional[_Union[WorkflowConcurrencyOpts, _Mapping]] = ..., schedule_timeout: _Optional[str] = ..., cron_input: _Optional[str] = ..., on_failure_job: _Optional[_Union[CreateWorkflowJobOpts, _Mapping]] = ..., sticky: _Optional[_Union[StickyStrategy, str]] = ..., kind: _Optional[_Union[WorkflowKind, str]] = ..., default_priority: _Optional[int] = ...) -> None: ... class WorkflowConcurrencyOpts(_message.Message): - __slots__ = ("action", "max_runs", "limit_strategy", "expression") + __slots__ = ("action", "max_runs", "limit_strategy") ACTION_FIELD_NUMBER: _ClassVar[int] MAX_RUNS_FIELD_NUMBER: _ClassVar[int] LIMIT_STRATEGY_FIELD_NUMBER: _ClassVar[int] - EXPRESSION_FIELD_NUMBER: _ClassVar[int] action: str max_runs: int limit_strategy: ConcurrencyLimitStrategy - expression: str - def __init__(self, action: _Optional[str] = ..., max_runs: _Optional[int] = ..., limit_strategy: _Optional[_Union[ConcurrencyLimitStrategy, str]] = ..., expression: _Optional[str] = ...) -> None: ... + def __init__(self, action: _Optional[str] = ..., max_runs: _Optional[int] = ..., limit_strategy: _Optional[_Union[ConcurrencyLimitStrategy, str]] = ...) -> None: ... class CreateWorkflowJobOpts(_message.Message): __slots__ = ("name", "description", "steps") From d07900e35af4d5f382b2da3b1fc3a19012c01e72 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Wed, 9 Oct 2024 10:29:30 -0400 Subject: [PATCH 03/33] feat: gen cloud api --- generate.sh | 103 +- hatchet_sdk/clients/cloud_rest/__init__.py | 93 + .../clients/cloud_rest/api/__init__.py | 15 + .../clients/cloud_rest/api/billing_api.py | 847 ++++++ .../clients/cloud_rest/api/build_api.py | 303 ++ .../cloud_rest/api/feature_flags_api.py | 303 ++ .../clients/cloud_rest/api/github_api.py | 1374 +++++++++ hatchet_sdk/clients/cloud_rest/api/log_api.py | 950 +++++++ .../cloud_rest/api/managed_worker_api.py | 2524 +++++++++++++++++ .../clients/cloud_rest/api/metadata_api.py | 281 ++ .../clients/cloud_rest/api/metrics_api.py | 991 +++++++ .../clients/cloud_rest/api/tenant_api.py | 306 ++ .../clients/cloud_rest/api/user_api.py | 509 ++++ .../clients/cloud_rest/api/workflow_api.py | 357 +++ hatchet_sdk/clients/cloud_rest/api_client.py | 773 +++++ .../clients/cloud_rest/api_response.py | 21 + .../clients/cloud_rest/configuration.py | 468 +++ hatchet_sdk/clients/cloud_rest/exceptions.py | 199 ++ .../clients/cloud_rest/models/__init__.py | 66 + .../cloud_rest/models/api_cloud_metadata.py | 91 + .../clients/cloud_rest/models/api_error.py | 93 + .../clients/cloud_rest/models/api_errors.py | 95 + .../cloud_rest/models/api_resource_meta.py | 93 + .../billing_portal_link_get200_response.py | 87 + .../clients/cloud_rest/models/build.py | 104 + .../clients/cloud_rest/models/build_step.py | 95 + .../clients/cloud_rest/models/coupon.py | 102 + .../cloud_rest/models/coupon_frequency.py | 37 + .../models/create_build_step_request.py | 89 + ...ate_managed_worker_build_config_request.py | 104 + .../models/create_managed_worker_request.py | 102 + ...e_managed_worker_runtime_config_request.py | 99 + .../clients/cloud_rest/models/event_object.py | 110 + .../cloud_rest/models/event_object_event.py | 87 + .../cloud_rest/models/event_object_fly.py | 93 + .../cloud_rest/models/event_object_fly_app.py | 89 + .../cloud_rest/models/event_object_log.py | 87 + .../models/github_app_installation.py | 97 + .../cloud_rest/models/github_branch.py | 89 + .../clients/cloud_rest/models/github_repo.py | 89 + .../cloud_rest/models/histogram_bucket.py | 93 + .../models/infra_as_code_request.py | 95 + .../clients/cloud_rest/models/instance.py | 103 + .../cloud_rest/models/instance_list.py | 101 + .../list_github_app_installations_response.py | 101 + .../clients/cloud_rest/models/log_line.py | 92 + .../cloud_rest/models/log_line_list.py | 101 + .../cloud_rest/models/managed_worker.py | 112 + .../models/managed_worker_build_config.py | 112 + .../cloud_rest/models/managed_worker_event.py | 101 + .../models/managed_worker_event_list.py | 101 + .../models/managed_worker_event_status.py | 39 + .../cloud_rest/models/managed_worker_list.py | 101 + .../models/managed_worker_region.py | 68 + .../models/managed_worker_runtime_config.py | 104 + .../cloud_rest/models/pagination_response.py | 91 + .../models/runtime_config_actions_response.py | 87 + .../cloud_rest/models/sample_histogram.py | 99 + .../models/sample_histogram_pair.py | 93 + .../cloud_rest/models/sample_stream.py | 98 + .../cloud_rest/models/subscription_plan.py | 95 + .../cloud_rest/models/tenant_billing_state.py | 121 + .../models/tenant_payment_method.py | 93 + .../cloud_rest/models/tenant_subscription.py | 94 + .../models/tenant_subscription_status.py | 39 + .../models/update_managed_worker_request.py | 102 + .../models/update_tenant_subscription.py | 89 + .../models/workflow_run_events_metric.py | 98 + .../workflow_run_events_metrics_counts.py | 95 + hatchet_sdk/clients/cloud_rest/rest.py | 215 ++ 70 files changed, 15312 insertions(+), 36 deletions(-) create mode 100644 hatchet_sdk/clients/cloud_rest/__init__.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/__init__.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/billing_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/build_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/github_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/log_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/metadata_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/metrics_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/tenant_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/user_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api/workflow_api.py create mode 100644 hatchet_sdk/clients/cloud_rest/api_client.py create mode 100644 hatchet_sdk/clients/cloud_rest/api_response.py create mode 100644 hatchet_sdk/clients/cloud_rest/configuration.py create mode 100644 hatchet_sdk/clients/cloud_rest/exceptions.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/__init__.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/api_error.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/api_errors.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/build.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/build_step.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/coupon.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/event_object.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/event_object_event.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/event_object_fly.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/event_object_log.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/github_app_installation.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/github_branch.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/github_repo.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/instance.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/instance_list.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/log_line.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/log_line_list.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/pagination_response.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/sample_histogram.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/sample_stream.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/subscription_plan.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py create mode 100644 hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py create mode 100644 hatchet_sdk/clients/cloud_rest/rest.py diff --git a/generate.sh b/generate.sh index 9eb0134c..96caa1c6 100755 --- a/generate.sh +++ b/generate.sh @@ -1,39 +1,20 @@ #!/bin/bash # -# Builds python auto-generated protobuf files for both OSS and Cloud versions +# Builds python auto-generated protobuf files set -eux -# Parse command line options -mode="oss" -while getopts ":n:" opt; do - case $opt in - n) - mode=$OPTARG - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - :) - echo "Option -$OPTARG requires an argument." >&2 - exit 1 - ;; - esac -done +ROOT_DIR=$(pwd) -# Set the submodule name based on the mode -if [ "$mode" = "cloud" ]; then - submodule_name="hatchet-cloud" +# Check if hatchet-cloud submodule exists and has been pulled +if [ -d "hatchet-cloud" ] && [ "$(ls -A hatchet-cloud)" ]; then + echo "hatchet-cloud submodule detected" + CLOUD_MODE=true else - submodule_name="hatchet" + echo "hatchet-cloud submodule not detected or empty" + CLOUD_MODE=false fi -echo "Mode: $mode" -echo "Submodule name: $submodule_name" - -ROOT_DIR=$(pwd) - # deps version=7.3.0 @@ -44,7 +25,7 @@ openapi-generator-cli version || npm install @openapitools/openapi-generator-cli # fi # generate deps from hatchet repo -cd $submodule_name/ && sh ./hack/oas/generate-server.sh && cd $ROOT_DIR +cd hatchet/ && sh ./hack/oas/generate-server.sh && cd $ROOT_DIR # generate python rest client @@ -55,7 +36,7 @@ mkdir -p $dst_dir tmp_dir=./tmp # generate into tmp folder -openapi-generator-cli generate -i ./$submodule_name/bin/oas/openapi.yaml -g python -o ./tmp --skip-validate-spec \ +openapi-generator-cli generate -i ./hatchet/bin/oas/openapi.yaml -g python -o ./tmp --skip-validate-spec \ --library asyncio \ --global-property=apiTests=false \ --global-property=apiDocs=true \ @@ -70,7 +51,7 @@ mv $tmp_dir/hatchet_sdk/clients/rest/exceptions.py $dst_dir/exceptions.py mv $tmp_dir/hatchet_sdk/clients/rest/__init__.py $dst_dir/__init__.py mv $tmp_dir/hatchet_sdk/clients/rest/rest.py $dst_dir/rest.py -openapi-generator-cli generate -i ./$submodule_name/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ +openapi-generator-cli generate -i ./hatchet/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ --library asyncio \ --global-property=apis,models \ --global-property=apiTests=false \ @@ -86,13 +67,19 @@ cp $tmp_dir/hatchet_sdk/clients/rest/api/__init__.py $dst_dir/api/__init__.py # remove tmp folder rm -rf $tmp_dir -# Generate protobuf files +# Generate protobuf files for both hatchet and hatchet-cloud (if exists) +generate_proto() { + local submodule=$1 + local proto_file=$2 + poetry run python -m grpc_tools.protoc --proto_path=$submodule/api-contracts/$proto_file \ + --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts \ + --grpc_python_out=./hatchet_sdk/contracts $proto_file.proto +} + proto_files=("dispatcher" "events" "workflows") for proto in "${proto_files[@]}"; do - poetry run python -m grpc_tools.protoc --proto_path=$submodule_name/api-contracts/$proto \ - --python_out=./hatchet_sdk/contracts --pyi_out=./hatchet_sdk/contracts \ - --grpc_python_out=./hatchet_sdk/contracts $proto.proto + generate_proto "hatchet" $proto done # Fix relative imports in _grpc.py files @@ -104,10 +91,54 @@ else find ./hatchet_sdk/contracts -type f -name '*_grpc.py' -print0 | xargs -0 sed -i 's/^import \([^ ]*\)_pb2/from . import \1_pb2/' fi +if [ "$CLOUD_MODE" = true ]; then + echo "Generating cloud-specific OpenAPI" + + # Generate cloud-specific OpenAPI + cloud_dst_dir=./hatchet_sdk/clients/cloud_rest + cloud_tmp_dir=./cloud_tmp + + mkdir -p $cloud_dst_dir + + # generate into cloud tmp folder + openapi-generator-cli generate -i ./hatchet-cloud/bin/oas/openapi.yaml -g python -o ./cloud_tmp --skip-validate-spec \ + --library asyncio \ + --global-property=apiTests=false \ + --global-property=apiDocs=true \ + --global-property=modelTests=false \ + --global-property=modelDocs=true \ + --package-name hatchet_sdk.clients.cloud_rest + + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/api_client.py $cloud_dst_dir/api_client.py + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/configuration.py $cloud_dst_dir/configuration.py + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/api_response.py $cloud_dst_dir/api_response.py + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/exceptions.py $cloud_dst_dir/exceptions.py + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/__init__.py $cloud_dst_dir/__init__.py + mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/rest.py $cloud_dst_dir/rest.py + + openapi-generator-cli generate -i ./hatchet-cloud/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ + --library asyncio \ + --global-property=apis,models \ + --global-property=apiTests=false \ + --global-property=apiDocs=false \ + --global-property=modelTests=false \ + --global-property=modelDocs=false \ + --package-name hatchet_sdk.clients.cloud_rest + + # copy the __init__ files from cloud tmp to the destination since they are not generated for some reason + cp $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/models/__init__.py $cloud_dst_dir/models/__init__.py + cp $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/api/__init__.py $cloud_dst_dir/api/__init__.py + + # remove cloud tmp folder + rm -rf $cloud_tmp_dir + + echo "Generation completed for both OSS and Cloud versions" +else + echo "Generation completed for OSS version only" +fi + # ensure that pre-commit is applied without errors pre-commit run --all-files || pre-commit run --all-files # apply patch to openapi-generator generated code patch -p1 --no-backup-if-mismatch <./openapi_patch.patch - -echo "Generation completed for $mode mode" diff --git a/hatchet_sdk/clients/cloud_rest/__init__.py b/hatchet_sdk/clients/cloud_rest/__init__.py new file mode 100644 index 00000000..c2dd8931 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/__init__.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from hatchet_sdk.clients.cloud_rest.api.billing_api import BillingApi +from hatchet_sdk.clients.cloud_rest.api.build_api import BuildApi +from hatchet_sdk.clients.cloud_rest.api.feature_flags_api import FeatureFlagsApi +from hatchet_sdk.clients.cloud_rest.api.github_api import GithubApi +from hatchet_sdk.clients.cloud_rest.api.log_api import LogApi +from hatchet_sdk.clients.cloud_rest.api.managed_worker_api import ManagedWorkerApi +from hatchet_sdk.clients.cloud_rest.api.metadata_api import MetadataApi +from hatchet_sdk.clients.cloud_rest.api.metrics_api import MetricsApi +from hatchet_sdk.clients.cloud_rest.api.tenant_api import TenantApi +from hatchet_sdk.clients.cloud_rest.api.user_api import UserApi +from hatchet_sdk.clients.cloud_rest.api.workflow_api import WorkflowApi + +# import ApiClient +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient +from hatchet_sdk.clients.cloud_rest.configuration import Configuration +from hatchet_sdk.clients.cloud_rest.exceptions import OpenApiException +from hatchet_sdk.clients.cloud_rest.exceptions import ApiTypeError +from hatchet_sdk.clients.cloud_rest.exceptions import ApiValueError +from hatchet_sdk.clients.cloud_rest.exceptions import ApiKeyError +from hatchet_sdk.clients.cloud_rest.exceptions import ApiAttributeError +from hatchet_sdk.clients.cloud_rest.exceptions import ApiException + +# import models into sdk package +from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata +from hatchet_sdk.clients.cloud_rest.models.api_error import APIError +from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response +from hatchet_sdk.clients.cloud_rest.models.build import Build +from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep +from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon +from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject +from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent +from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly +from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp +from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation +from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch +from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo +from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.instance import Instance +from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse +from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine +from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList +from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse +from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair +from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream +from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts diff --git a/hatchet_sdk/clients/cloud_rest/api/__init__.py b/hatchet_sdk/clients/cloud_rest/api/__init__.py new file mode 100644 index 00000000..5e487f82 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/__init__.py @@ -0,0 +1,15 @@ +# flake8: noqa + +# import apis into api package +from hatchet_sdk.clients.cloud_rest.api.billing_api import BillingApi +from hatchet_sdk.clients.cloud_rest.api.build_api import BuildApi +from hatchet_sdk.clients.cloud_rest.api.feature_flags_api import FeatureFlagsApi +from hatchet_sdk.clients.cloud_rest.api.github_api import GithubApi +from hatchet_sdk.clients.cloud_rest.api.log_api import LogApi +from hatchet_sdk.clients.cloud_rest.api.managed_worker_api import ManagedWorkerApi +from hatchet_sdk.clients.cloud_rest.api.metadata_api import MetadataApi +from hatchet_sdk.clients.cloud_rest.api.metrics_api import MetricsApi +from hatchet_sdk.clients.cloud_rest.api.tenant_api import TenantApi +from hatchet_sdk.clients.cloud_rest.api.user_api import UserApi +from hatchet_sdk.clients.cloud_rest.api.workflow_api import WorkflowApi + diff --git a/hatchet_sdk/clients/cloud_rest/api/billing_api.py b/hatchet_sdk/clients/cloud_rest/api/billing_api.py new file mode 100644 index 00000000..9e91eba4 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/billing_api.py @@ -0,0 +1,847 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class BillingApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def billing_portal_link_get( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BillingPortalLinkGet200Response: + """Create a link to the billing portal + + Get the billing portal link + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._billing_portal_link_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingPortalLinkGet200Response", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def billing_portal_link_get_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BillingPortalLinkGet200Response]: + """Create a link to the billing portal + + Get the billing portal link + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._billing_portal_link_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingPortalLinkGet200Response", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def billing_portal_link_get_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a link to the billing portal + + Get the billing portal link + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._billing_portal_link_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingPortalLinkGet200Response", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _billing_portal_link_get_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/billing/tenants/{tenant}/billing-portal-link', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def lago_message_create( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Receive a webhook message from Lago + + Receive a webhook message from Lago + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lago_message_create_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def lago_message_create_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Receive a webhook message from Lago + + Receive a webhook message from Lago + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lago_message_create_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def lago_message_create_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Receive a webhook message from Lago + + Receive a webhook message from Lago + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._lago_message_create_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _lago_message_create_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/billing/lago/webhook', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def subscription_upsert( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TenantSubscription: + """Create a new subscription + + Update a subscription + + :param tenant: The tenant id (required) + :type tenant: str + :param update_tenant_subscription: + :type update_tenant_subscription: UpdateTenantSubscription + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._subscription_upsert_serialize( + tenant=tenant, + update_tenant_subscription=update_tenant_subscription, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantSubscription", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def subscription_upsert_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TenantSubscription]: + """Create a new subscription + + Update a subscription + + :param tenant: The tenant id (required) + :type tenant: str + :param update_tenant_subscription: + :type update_tenant_subscription: UpdateTenantSubscription + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._subscription_upsert_serialize( + tenant=tenant, + update_tenant_subscription=update_tenant_subscription, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantSubscription", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def subscription_upsert_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new subscription + + Update a subscription + + :param tenant: The tenant id (required) + :type tenant: str + :param update_tenant_subscription: + :type update_tenant_subscription: UpdateTenantSubscription + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._subscription_upsert_serialize( + tenant=tenant, + update_tenant_subscription=update_tenant_subscription, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantSubscription", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _subscription_upsert_serialize( + self, + tenant, + update_tenant_subscription, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_tenant_subscription is not None: + _body_params = update_tenant_subscription + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/billing/tenants/{tenant}/subscription', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/build_api.py b/hatchet_sdk/clients/cloud_rest/api/build_api.py new file mode 100644 index 00000000..5408cebe --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/build_api.py @@ -0,0 +1,303 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.build import Build + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class BuildApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def build_get( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Build: + """Get Build + + Get a build + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_get_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Build", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def build_get_with_http_info( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Build]: + """Get Build + + Get a build + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_get_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Build", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def build_get_without_preload_content( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Build + + Get a build + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_get_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Build", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _build_get_serialize( + self, + build, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if build is not None: + _path_params['build'] = build + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/build/{build}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py new file mode 100644 index 00000000..31cb4503 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py @@ -0,0 +1,303 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Dict +from typing_extensions import Annotated + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class FeatureFlagsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def feature_flags_list( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, str]: + """List Feature Flags + + Get all feature flags for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._feature_flags_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, str]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def feature_flags_list_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, str]]: + """List Feature Flags + + Get all feature flags for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._feature_flags_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, str]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def feature_flags_list_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Feature Flags + + Get all feature flags for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._feature_flags_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, str]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _feature_flags_list_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/tenants/{tenant}/feature-flags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/github_api.py b/hatchet_sdk/clients/cloud_rest/api/github_api.py new file mode 100644 index 00000000..34fc20b7 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/github_api.py @@ -0,0 +1,1374 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import List +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch +from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class GithubApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def github_app_list_branches( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], + gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GithubBranch]: + """List Github App branches + + List Github App branches + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param gh_repo_owner: The repository owner (required) + :type gh_repo_owner: str + :param gh_repo_name: The repository name (required) + :type gh_repo_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_branches_serialize( + gh_installation=gh_installation, + gh_repo_owner=gh_repo_owner, + gh_repo_name=gh_repo_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubBranch]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def github_app_list_branches_with_http_info( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], + gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GithubBranch]]: + """List Github App branches + + List Github App branches + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param gh_repo_owner: The repository owner (required) + :type gh_repo_owner: str + :param gh_repo_name: The repository name (required) + :type gh_repo_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_branches_serialize( + gh_installation=gh_installation, + gh_repo_owner=gh_repo_owner, + gh_repo_name=gh_repo_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubBranch]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def github_app_list_branches_without_preload_content( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], + gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Github App branches + + List Github App branches + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param gh_repo_owner: The repository owner (required) + :type gh_repo_owner: str + :param gh_repo_name: The repository name (required) + :type gh_repo_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_branches_serialize( + gh_installation=gh_installation, + gh_repo_owner=gh_repo_owner, + gh_repo_name=gh_repo_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubBranch]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _github_app_list_branches_serialize( + self, + gh_installation, + gh_repo_owner, + gh_repo_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if gh_installation is not None: + _path_params['gh-installation'] = gh_installation + if gh_repo_owner is not None: + _path_params['gh-repo-owner'] = gh_repo_owner + if gh_repo_name is not None: + _path_params['gh-repo-name'] = gh_repo_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/github-app/installations/{gh-installation}/repos/{gh-repo-owner}/{gh-repo-name}/branches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def github_app_list_installations( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListGithubAppInstallationsResponse: + """List Github App installations + + List Github App installations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_installations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListGithubAppInstallationsResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def github_app_list_installations_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListGithubAppInstallationsResponse]: + """List Github App installations + + List Github App installations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_installations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListGithubAppInstallationsResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def github_app_list_installations_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Github App installations + + List Github App installations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_installations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListGithubAppInstallationsResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _github_app_list_installations_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/github-app/installations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def github_app_list_repos( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GithubRepo]: + """List Github App repositories + + List Github App repositories + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_repos_serialize( + gh_installation=gh_installation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubRepo]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def github_app_list_repos_with_http_info( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GithubRepo]]: + """List Github App repositories + + List Github App repositories + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_repos_serialize( + gh_installation=gh_installation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubRepo]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def github_app_list_repos_without_preload_content( + self, + gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Github App repositories + + List Github App repositories + + :param gh_installation: The installation id (required) + :type gh_installation: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_app_list_repos_serialize( + gh_installation=gh_installation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GithubRepo]", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _github_app_list_repos_serialize( + self, + gh_installation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if gh_installation is not None: + _path_params['gh-installation'] = gh_installation + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/github-app/installations/{gh-installation}/repos', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def github_update_global_webhook( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Github app global webhook + + Github App global webhook + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_global_webhook_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def github_update_global_webhook_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Github app global webhook + + Github App global webhook + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_global_webhook_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def github_update_global_webhook_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Github app global webhook + + Github App global webhook + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_global_webhook_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _github_update_global_webhook_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/github/webhook', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def github_update_tenant_webhook( + self, + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Github app tenant webhook + + Github App tenant webhook + + :param webhook: The webhook id (required) + :type webhook: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_tenant_webhook_serialize( + webhook=webhook, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def github_update_tenant_webhook_with_http_info( + self, + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Github app tenant webhook + + Github App tenant webhook + + :param webhook: The webhook id (required) + :type webhook: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_tenant_webhook_serialize( + webhook=webhook, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def github_update_tenant_webhook_without_preload_content( + self, + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Github app tenant webhook + + Github App tenant webhook + + :param webhook: The webhook id (required) + :type webhook: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._github_update_tenant_webhook_serialize( + webhook=webhook, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _github_update_tenant_webhook_serialize( + self, + webhook, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if webhook is not None: + _path_params['webhook'] = webhook + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/github/webhook/{webhook}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/log_api.py b/hatchet_sdk/clients/cloud_rest/api/log_api.py new file mode 100644 index 00000000..96136224 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/log_api.py @@ -0,0 +1,950 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import datetime +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject +from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class LogApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def build_logs_list( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LogLineList: + """Get Build Logs + + Get the build logs for a specific build of a managed worker + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_logs_list_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def build_logs_list_with_http_info( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LogLineList]: + """Get Build Logs + + Get the build logs for a specific build of a managed worker + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_logs_list_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def build_logs_list_without_preload_content( + self, + build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Build Logs + + Get the build logs for a specific build of a managed worker + + :param build: The build id (required) + :type build: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._build_logs_list_serialize( + build=build, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _build_logs_list_serialize( + self, + build, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if build is not None: + _path_params['build'] = build + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/build/{build}/logs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def log_create( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_object: Optional[List[EventObject]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Push Log Entry + + Push a log entry for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_object: + :type event_object: List[EventObject] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_create_serialize( + tenant=tenant, + event_object=event_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def log_create_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_object: Optional[List[EventObject]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Push Log Entry + + Push a log entry for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_object: + :type event_object: List[EventObject] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_create_serialize( + tenant=tenant, + event_object=event_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def log_create_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_object: Optional[List[EventObject]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Push Log Entry + + Push a log entry for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_object: + :type event_object: List[EventObject] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_create_serialize( + tenant=tenant, + event_object=event_object, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _log_create_serialize( + self, + tenant, + event_object, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'EventObject': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if event_object is not None: + _body_params = event_object + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/tenants/{tenant}/logs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def log_list( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LogLineList: + """List Logs + + Lists logs for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the logs should start + :type after: datetime + :param before: When the logs should end + :type before: datetime + :param search: The search query to filter for + :type search: str + :param direction: The direction to sort the logs + :type direction: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_list_serialize( + managed_worker=managed_worker, + after=after, + before=before, + search=search, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def log_list_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LogLineList]: + """List Logs + + Lists logs for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the logs should start + :type after: datetime + :param before: When the logs should end + :type before: datetime + :param search: The search query to filter for + :type search: str + :param direction: The direction to sort the logs + :type direction: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_list_serialize( + managed_worker=managed_worker, + after=after, + before=before, + search=search, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def log_list_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Logs + + Lists logs for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the logs should start + :type after: datetime + :param before: When the logs should end + :type before: datetime + :param search: The search query to filter for + :type search: str + :param direction: The direction to sort the logs + :type direction: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._log_list_serialize( + managed_worker=managed_worker, + after=after, + before=before, + search=search, + direction=direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _log_list_serialize( + self, + managed_worker, + after, + before, + search, + direction, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + if after is not None: + if isinstance(after, datetime): + _query_params.append( + ( + 'after', + after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('after', after)) + + if before is not None: + if isinstance(before, datetime): + _query_params.append( + ( + 'before', + before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('before', before)) + + if search is not None: + + _query_params.append(('search', search)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/logs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py new file mode 100644 index 00000000..9c4254fd --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py @@ -0,0 +1,2524 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList +from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class ManagedWorkerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def infra_as_code_create( + self, + infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Create Infra as Code + + Registers runtime configs via infra-as-code + + :param infra_as_code_request: The infra as code request id (required) + :type infra_as_code_request: str + :param infra_as_code_request2: + :type infra_as_code_request2: InfraAsCodeRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._infra_as_code_create_serialize( + infra_as_code_request=infra_as_code_request, + infra_as_code_request2=infra_as_code_request2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def infra_as_code_create_with_http_info( + self, + infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Create Infra as Code + + Registers runtime configs via infra-as-code + + :param infra_as_code_request: The infra as code request id (required) + :type infra_as_code_request: str + :param infra_as_code_request2: + :type infra_as_code_request2: InfraAsCodeRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._infra_as_code_create_serialize( + infra_as_code_request=infra_as_code_request, + infra_as_code_request2=infra_as_code_request2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def infra_as_code_create_without_preload_content( + self, + infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Infra as Code + + Registers runtime configs via infra-as-code + + :param infra_as_code_request: The infra as code request id (required) + :type infra_as_code_request: str + :param infra_as_code_request2: + :type infra_as_code_request2: InfraAsCodeRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._infra_as_code_create_serialize( + infra_as_code_request=infra_as_code_request, + infra_as_code_request2=infra_as_code_request2, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _infra_as_code_create_serialize( + self, + infra_as_code_request, + infra_as_code_request2, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if infra_as_code_request is not None: + _path_params['infra-as-code-request'] = infra_as_code_request + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if infra_as_code_request2 is not None: + _body_params = infra_as_code_request2 + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/infra-as-code/{infra-as-code-request}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_create( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorker: + """Create Managed Worker + + Create a managed worker for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param create_managed_worker_request: + :type create_managed_worker_request: CreateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_create_serialize( + tenant=tenant, + create_managed_worker_request=create_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_create_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorker]: + """Create Managed Worker + + Create a managed worker for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param create_managed_worker_request: + :type create_managed_worker_request: CreateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_create_serialize( + tenant=tenant, + create_managed_worker_request=create_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_create_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Managed Worker + + Create a managed worker for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param create_managed_worker_request: + :type create_managed_worker_request: CreateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_create_serialize( + tenant=tenant, + create_managed_worker_request=create_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_create_serialize( + self, + tenant, + create_managed_worker_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_managed_worker_request is not None: + _body_params = create_managed_worker_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/tenants/{tenant}/managed-worker', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_delete( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorker: + """Delete Managed Worker + + Delete a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_delete_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_delete_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorker]: + """Delete Managed Worker + + Delete a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_delete_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_delete_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Managed Worker + + Delete a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_delete_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_delete_serialize( + self, + managed_worker, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_events_list( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorkerEventList: + """Get Managed Worker Events + + Get events for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_events_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerEventList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_events_list_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorkerEventList]: + """Get Managed Worker Events + + Get events for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_events_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerEventList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_events_list_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Managed Worker Events + + Get events for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_events_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerEventList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_events_list_serialize( + self, + managed_worker, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_get( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorker: + """Get Managed Worker + + Get a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_get_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_get_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorker]: + """Get Managed Worker + + Get a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_get_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_get_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Managed Worker + + Get a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_get_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_get_serialize( + self, + managed_worker, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_instances_list( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InstanceList: + """List Instances + + Get all instances for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_instances_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstanceList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_instances_list_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InstanceList]: + """List Instances + + Get all instances for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_instances_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstanceList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_instances_list_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Instances + + Get all instances for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_instances_list_serialize( + managed_worker=managed_worker, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "InstanceList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_instances_list_serialize( + self, + managed_worker, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/instances', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_list( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorkerList: + """List Managed Workers + + Get all managed workers for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_list_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorkerList]: + """List Managed Workers + + Get all managed workers for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_list_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Managed Workers + + Get all managed workers for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorkerList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_list_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/tenants/{tenant}/managed-worker', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def managed_worker_update( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ManagedWorker: + """Update Managed Worker + + Update a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param update_managed_worker_request: + :type update_managed_worker_request: UpdateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_update_serialize( + managed_worker=managed_worker, + update_managed_worker_request=update_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def managed_worker_update_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ManagedWorker]: + """Update Managed Worker + + Update a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param update_managed_worker_request: + :type update_managed_worker_request: UpdateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_update_serialize( + managed_worker=managed_worker, + update_managed_worker_request=update_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def managed_worker_update_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Managed Worker + + Update a managed worker for the tenant + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param update_managed_worker_request: + :type update_managed_worker_request: UpdateManagedWorkerRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._managed_worker_update_serialize( + managed_worker=managed_worker, + update_managed_worker_request=update_managed_worker_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ManagedWorker", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _managed_worker_update_serialize( + self, + managed_worker, + update_managed_worker_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_managed_worker_request is not None: + _body_params = update_managed_worker_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def runtime_config_list_actions( + self, + runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RuntimeConfigActionsResponse: + """Get Runtime Config Actions + + Get a list of runtime config actions for a managed worker + + :param runtime_config: The runtime config id (required) + :type runtime_config: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._runtime_config_list_actions_serialize( + runtime_config=runtime_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RuntimeConfigActionsResponse", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def runtime_config_list_actions_with_http_info( + self, + runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RuntimeConfigActionsResponse]: + """Get Runtime Config Actions + + Get a list of runtime config actions for a managed worker + + :param runtime_config: The runtime config id (required) + :type runtime_config: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._runtime_config_list_actions_serialize( + runtime_config=runtime_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RuntimeConfigActionsResponse", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def runtime_config_list_actions_without_preload_content( + self, + runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Runtime Config Actions + + Get a list of runtime config actions for a managed worker + + :param runtime_config: The runtime config id (required) + :type runtime_config: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._runtime_config_list_actions_serialize( + runtime_config=runtime_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RuntimeConfigActionsResponse", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _runtime_config_list_actions_serialize( + self, + runtime_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if runtime_config is not None: + _path_params['runtime-config'] = runtime_config + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/runtime-config/{runtime-config}/actions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/metadata_api.py b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py new file mode 100644 index 00000000..a82b77a9 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py @@ -0,0 +1,281 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class MetadataApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def metadata_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> APICloudMetadata: + """Get metadata + + Gets metadata for the Hatchet instance + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metadata_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "APICloudMetadata", + '400': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def metadata_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[APICloudMetadata]: + """Get metadata + + Gets metadata for the Hatchet instance + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metadata_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "APICloudMetadata", + '400': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def metadata_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get metadata + + Gets metadata for the Hatchet instance + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metadata_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "APICloudMetadata", + '400': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _metadata_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/metadata', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/metrics_api.py b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py new file mode 100644 index 00000000..58f63b83 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py @@ -0,0 +1,991 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import datetime +from pydantic import Field +from typing import List, Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class MetricsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def metrics_cpu_get( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SampleStream]: + """Get CPU Metrics + + Get CPU metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_cpu_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def metrics_cpu_get_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SampleStream]]: + """Get CPU Metrics + + Get CPU metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_cpu_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def metrics_cpu_get_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get CPU Metrics + + Get CPU metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_cpu_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _metrics_cpu_get_serialize( + self, + managed_worker, + after, + before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + if after is not None: + if isinstance(after, datetime): + _query_params.append( + ( + 'after', + after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('after', after)) + + if before is not None: + if isinstance(before, datetime): + _query_params.append( + ( + 'before', + before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('before', before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/cpu', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def metrics_disk_get( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SampleStream]: + """Get Disk Metrics + + Get disk metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_disk_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def metrics_disk_get_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SampleStream]]: + """Get Disk Metrics + + Get disk metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_disk_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def metrics_disk_get_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Disk Metrics + + Get disk metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_disk_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _metrics_disk_get_serialize( + self, + managed_worker, + after, + before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + if after is not None: + if isinstance(after, datetime): + _query_params.append( + ( + 'after', + after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('after', after)) + + if before is not None: + if isinstance(before, datetime): + _query_params.append( + ( + 'before', + before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('before', before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/disk', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def metrics_memory_get( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[SampleStream]: + """Get Memory Metrics + + Get memory metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_memory_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def metrics_memory_get_with_http_info( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[SampleStream]]: + """Get Memory Metrics + + Get memory metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_memory_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def metrics_memory_get_without_preload_content( + self, + managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, + before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Memory Metrics + + Get memory metrics for a managed worker + + :param managed_worker: The managed worker id (required) + :type managed_worker: str + :param after: When the metrics should start + :type after: datetime + :param before: When the metrics should end + :type before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._metrics_memory_get_serialize( + managed_worker=managed_worker, + after=after, + before=before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[SampleStream]", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _metrics_memory_get_serialize( + self, + managed_worker, + after, + before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if managed_worker is not None: + _path_params['managed-worker'] = managed_worker + # process the query parameters + if after is not None: + if isinstance(after, datetime): + _query_params.append( + ( + 'after', + after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('after', after)) + + if before is not None: + if isinstance(before, datetime): + _query_params.append( + ( + 'before', + before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('before', before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/memory', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/tenant_api.py b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py new file mode 100644 index 00000000..b9a48c59 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class TenantApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def tenant_billing_state_get( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TenantBillingState: + """Get the billing state for a tenant + + Gets the billing state for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_billing_state_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantBillingState", + '400': "APIErrors", + '403': "APIError", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def tenant_billing_state_get_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TenantBillingState]: + """Get the billing state for a tenant + + Gets the billing state for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_billing_state_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantBillingState", + '400': "APIErrors", + '403': "APIError", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def tenant_billing_state_get_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the billing state for a tenant + + Gets the billing state for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_billing_state_get_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantBillingState", + '400': "APIErrors", + '403': "APIError", + '405': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tenant_billing_state_get_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/billing/tenants/{tenant}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/user_api.py b/hatchet_sdk/clients/cloud_rest/api/user_api.py new file mode 100644 index 00000000..c402c9c4 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/user_api.py @@ -0,0 +1,509 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class UserApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def user_update_github_app_oauth_callback( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Complete OAuth flow + + Completes the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_callback_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def user_update_github_app_oauth_callback_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Complete OAuth flow + + Completes the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_callback_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def user_update_github_app_oauth_callback_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Complete OAuth flow + + Completes the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_callback_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _user_update_github_app_oauth_callback_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/users/github-app/callback', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def user_update_github_app_oauth_start( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Start OAuth flow + + Starts the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_start_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def user_update_github_app_oauth_start_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Start OAuth flow + + Starts the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_start_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def user_update_github_app_oauth_start_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start OAuth flow + + Starts the OAuth flow + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._user_update_github_app_oauth_start_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '302': None, + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _user_update_github_app_oauth_start_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/users/github-app/start', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api/workflow_api.py b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py new file mode 100644 index 00000000..ccb52364 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py @@ -0,0 +1,357 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import datetime +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts + +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType + + +class WorkflowApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def workflow_run_events_get_metrics( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkflowRunEventsMetricsCounts: + """Get workflow runs + + Get a minute by minute breakdown of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param finished_before: The time before the workflow run was completed + :type finished_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_events_get_metrics_serialize( + tenant=tenant, + created_after=created_after, + finished_before=finished_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowRunEventsMetricsCounts", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def workflow_run_events_get_metrics_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkflowRunEventsMetricsCounts]: + """Get workflow runs + + Get a minute by minute breakdown of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param finished_before: The time before the workflow run was completed + :type finished_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_events_get_metrics_serialize( + tenant=tenant, + created_after=created_after, + finished_before=finished_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowRunEventsMetricsCounts", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def workflow_run_events_get_metrics_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get workflow runs + + Get a minute by minute breakdown of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param finished_before: The time before the workflow run was completed + :type finished_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_events_get_metrics_serialize( + tenant=tenant, + created_after=created_after, + finished_before=finished_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkflowRunEventsMetricsCounts", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _workflow_run_events_get_metrics_serialize( + self, + tenant, + created_after, + finished_before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + if created_after is not None: + if isinstance(created_after, datetime): + _query_params.append( + ( + 'createdAfter', + created_after.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('createdAfter', created_after)) + + if finished_before is not None: + if isinstance(finished_before, datetime): + _query_params.append( + ( + 'finishedBefore', + finished_before.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('finishedBefore', finished_before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/cloud/tenants/{tenant}/runs-metrics', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/cloud_rest/api_client.py b/hatchet_sdk/clients/cloud_rest/api_client.py new file mode 100644 index 00000000..187bf934 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api_client.py @@ -0,0 +1,773 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from hatchet_sdk.clients.cloud_rest.configuration import Configuration +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse, T as ApiResponseT +import hatchet_sdk.clients.cloud_rest.models +from hatchet_sdk.clients.cloud_rest import rest +from hatchet_sdk.clients.cloud_rest.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + async def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = await self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + if response_type in ["bytearray", "str"]: + return_data = self.__deserialize_primitive(response_text, response_type) + else: + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + + # fetch data from response object + try: + data = json.loads(response_text) + except ValueError: + data = response_text + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(hatchet_sdk.clients.cloud_rest.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/hatchet_sdk/clients/cloud_rest/api_response.py b/hatchet_sdk/clients/cloud_rest/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/hatchet_sdk/clients/cloud_rest/configuration.py b/hatchet_sdk/clients/cloud_rest/configuration.py new file mode 100644 index 00000000..09c41ade --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/configuration.py @@ -0,0 +1,468 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import logging +from logging import FileHandler +import sys +from typing import Optional +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = hatchet_sdk.clients.cloud_rest.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor + """ + self._base_path = "http://localhost" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("hatchet_sdk.clients.cloud_rest") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth['bearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if 'cookieAuth' in self.api_key: + auth['cookieAuth'] = { + 'type': 'api_key', + 'in': 'cookie', + 'key': 'hatchet', + 'value': self.get_api_key_with_prefix( + 'cookieAuth', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/hatchet_sdk/clients/cloud_rest/exceptions.py b/hatchet_sdk/clients/cloud_rest/exceptions.py new file mode 100644 index 00000000..205c95b6 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/exceptions.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/hatchet_sdk/clients/cloud_rest/models/__init__.py b/hatchet_sdk/clients/cloud_rest/models/__init__.py new file mode 100644 index 00000000..da5e8039 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/__init__.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +# flake8: noqa +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata +from hatchet_sdk.clients.cloud_rest.models.api_error import APIError +from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response +from hatchet_sdk.clients.cloud_rest.models.build import Build +from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep +from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon +from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject +from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent +from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly +from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp +from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation +from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch +from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo +from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.instance import Instance +from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse +from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine +from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList +from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse +from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair +from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream +from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts diff --git a/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py b/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py new file mode 100644 index 00000000..6aea38d5 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class APICloudMetadata(BaseModel): + """ + APICloudMetadata + """ # noqa: E501 + can_bill: Optional[StrictBool] = Field(default=None, description="whether the tenant can be billed", alias="canBill") + can_link_github: Optional[StrictBool] = Field(default=None, description="whether the tenant can link to GitHub", alias="canLinkGithub") + metrics_enabled: Optional[StrictBool] = Field(default=None, description="whether metrics are enabled for the tenant", alias="metricsEnabled") + __properties: ClassVar[List[str]] = ["canBill", "canLinkGithub", "metricsEnabled"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of APICloudMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of APICloudMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "canBill": obj.get("canBill"), + "canLinkGithub": obj.get("canLinkGithub"), + "metricsEnabled": obj.get("metricsEnabled") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_error.py b/hatchet_sdk/clients/cloud_rest/models/api_error.py new file mode 100644 index 00000000..bb448b2d --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/api_error.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class APIError(BaseModel): + """ + APIError + """ # noqa: E501 + code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") + var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") + description: StrictStr = Field(description="a description for this error") + docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") + __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of APIError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of APIError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_errors.py b/hatchet_sdk/clients/cloud_rest/models/api_errors.py new file mode 100644 index 00000000..5db2c014 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/api_errors.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.api_error import APIError +from typing import Optional, Set +from typing_extensions import Self + +class APIErrors(BaseModel): + """ + APIErrors + """ # noqa: E501 + errors: List[APIError] + __properties: ClassVar[List[str]] = ["errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of APIErrors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item in self.errors: + if _item: + _items.append(_item.to_dict()) + _dict['errors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of APIErrors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errors": [APIError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py b/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py new file mode 100644 index 00000000..69e062b1 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class APIResourceMeta(BaseModel): + """ + APIResourceMeta + """ # noqa: E501 + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") + created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") + updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") + __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of APIResourceMeta from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of APIResourceMeta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py b/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py new file mode 100644 index 00000000..a18b12b2 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BillingPortalLinkGet200Response(BaseModel): + """ + BillingPortalLinkGet200Response + """ # noqa: E501 + url: Optional[StrictStr] = Field(default=None, description="The url to the billing portal") + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingPortalLinkGet200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingPortalLinkGet200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/build.py b/hatchet_sdk/clients/cloud_rest/models/build.py new file mode 100644 index 00000000..d479fe30 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/build.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from typing import Optional, Set +from typing_extensions import Self + +class Build(BaseModel): + """ + Build + """ # noqa: E501 + metadata: Optional[APIResourceMeta] = None + status: StrictStr + status_detail: Optional[StrictStr] = Field(default=None, alias="statusDetail") + create_time: datetime = Field(alias="createTime") + start_time: Optional[datetime] = Field(default=None, alias="startTime") + finish_time: Optional[datetime] = Field(default=None, alias="finishTime") + build_config_id: StrictStr = Field(alias="buildConfigId") + __properties: ClassVar[List[str]] = ["metadata", "status", "statusDetail", "createTime", "startTime", "finishTime", "buildConfigId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Build from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Build from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "status": obj.get("status"), + "statusDetail": obj.get("statusDetail"), + "createTime": obj.get("createTime"), + "startTime": obj.get("startTime"), + "finishTime": obj.get("finishTime"), + "buildConfigId": obj.get("buildConfigId") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/build_step.py b/hatchet_sdk/clients/cloud_rest/models/build_step.py new file mode 100644 index 00000000..28d12826 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/build_step.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from typing import Optional, Set +from typing_extensions import Self + +class BuildStep(BaseModel): + """ + BuildStep + """ # noqa: E501 + metadata: APIResourceMeta + build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") + dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + __properties: ClassVar[List[str]] = ["metadata", "buildDir", "dockerfilePath"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BuildStep from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BuildStep from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon.py b/hatchet_sdk/clients/cloud_rest/models/coupon.py new file mode 100644 index 00000000..941a291c --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/coupon.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency +from typing import Optional, Set +from typing_extensions import Self + +class Coupon(BaseModel): + """ + Coupon + """ # noqa: E501 + name: StrictStr = Field(description="The name of the coupon.") + amount_cents: Optional[StrictInt] = Field(default=None, description="The amount off of the coupon.") + amount_cents_remaining: Optional[StrictInt] = Field(default=None, description="The amount remaining on the coupon.") + amount_currency: Optional[StrictStr] = Field(default=None, description="The currency of the coupon.") + frequency: CouponFrequency = Field(description="The frequency of the coupon.") + frequency_duration: Optional[StrictInt] = Field(default=None, description="The frequency duration of the coupon.") + frequency_duration_remaining: Optional[StrictInt] = Field(default=None, description="The frequency duration remaining of the coupon.") + percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The percentage off of the coupon.") + __properties: ClassVar[List[str]] = ["name", "amount_cents", "amount_cents_remaining", "amount_currency", "frequency", "frequency_duration", "frequency_duration_remaining", "percent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Coupon from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Coupon from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "amount_cents": obj.get("amount_cents"), + "amount_cents_remaining": obj.get("amount_cents_remaining"), + "amount_currency": obj.get("amount_currency"), + "frequency": obj.get("frequency"), + "frequency_duration": obj.get("frequency_duration"), + "frequency_duration_remaining": obj.get("frequency_duration_remaining"), + "percent": obj.get("percent") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py b/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py new file mode 100644 index 00000000..9ba1a381 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CouponFrequency(str, Enum): + """ + CouponFrequency + """ + + """ + allowed enum values + """ + ONCE = 'once' + RECURRING = 'recurring' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CouponFrequency from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py b/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py new file mode 100644 index 00000000..7b52e464 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateBuildStepRequest(BaseModel): + """ + CreateBuildStepRequest + """ # noqa: E501 + build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") + dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + __properties: ClassVar[List[str]] = ["buildDir", "dockerfilePath"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateBuildStepRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateBuildStepRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py new file mode 100644 index 00000000..1a97f7b2 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateManagedWorkerBuildConfigRequest(BaseModel): + """ + CreateManagedWorkerBuildConfigRequest + """ # noqa: E501 + github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + github_repository_owner: StrictStr = Field(alias="githubRepositoryOwner") + github_repository_name: StrictStr = Field(alias="githubRepositoryName") + github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") + steps: List[CreateBuildStepRequest] + __properties: ClassVar[List[str]] = ["githubInstallationId", "githubRepositoryOwner", "githubRepositoryName", "githubRepositoryBranch", "steps"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateManagedWorkerBuildConfigRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in steps (list) + _items = [] + if self.steps: + for _item in self.steps: + if _item: + _items.append(_item.to_dict()) + _dict['steps'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateManagedWorkerBuildConfigRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepositoryOwner": obj.get("githubRepositoryOwner"), + "githubRepositoryName": obj.get("githubRepositoryName"), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": [CreateBuildStepRequest.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py new file mode 100644 index 00000000..97666a06 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateManagedWorkerRequest(BaseModel): + """ + CreateManagedWorkerRequest + """ # noqa: E501 + name: StrictStr + build_config: CreateManagedWorkerBuildConfigRequest = Field(alias="buildConfig") + env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") + is_iac: StrictBool = Field(alias="isIac") + runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field(default=None, alias="runtimeConfig") + __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateManagedWorkerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict['buildConfig'] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of runtime_config + if self.runtime_config: + _dict['runtimeConfig'] = self.runtime_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateManagedWorkerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "buildConfig": CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfig": CreateManagedWorkerRuntimeConfigRequest.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py new file mode 100644 index 00000000..938f29bb --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from typing import Optional, Set +from typing_extensions import Self + +class CreateManagedWorkerRuntimeConfigRequest(BaseModel): + """ + CreateManagedWorkerRuntimeConfigRequest + """ # noqa: E501 + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(alias="numReplicas") + region: Optional[ManagedWorkerRegion] = Field(default=None, description="The region to deploy the worker to") + cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + actions: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["numReplicas", "region", "cpuKind", "cpus", "memoryMb", "actions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateManagedWorkerRuntimeConfigRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateManagedWorkerRuntimeConfigRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "numReplicas": obj.get("numReplicas"), + "region": obj.get("region"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "actions": obj.get("actions") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object.py b/hatchet_sdk/clients/cloud_rest/models/event_object.py new file mode 100644 index 00000000..33a2943b --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/event_object.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent +from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly +from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog +from typing import Optional, Set +from typing_extensions import Self + +class EventObject(BaseModel): + """ + EventObject + """ # noqa: E501 + event: Optional[EventObjectEvent] = None + fly: Optional[EventObjectFly] = None + host: Optional[StrictStr] = None + log: Optional[EventObjectLog] = None + message: Optional[StrictStr] = None + timestamp: Optional[datetime] = None + __properties: ClassVar[List[str]] = ["event", "fly", "host", "log", "message", "timestamp"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of event + if self.event: + _dict['event'] = self.event.to_dict() + # override the default output from pydantic by calling `to_dict()` of fly + if self.fly: + _dict['fly'] = self.fly.to_dict() + # override the default output from pydantic by calling `to_dict()` of log + if self.log: + _dict['log'] = self.log.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event": EventObjectEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, + "fly": EventObjectFly.from_dict(obj["fly"]) if obj.get("fly") is not None else None, + "host": obj.get("host"), + "log": EventObjectLog.from_dict(obj["log"]) if obj.get("log") is not None else None, + "message": obj.get("message"), + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_event.py b/hatchet_sdk/clients/cloud_rest/models/event_object_event.py new file mode 100644 index 00000000..4ac8a299 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_event.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EventObjectEvent(BaseModel): + """ + EventObjectEvent + """ # noqa: E501 + provider: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["provider"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventObjectEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventObjectEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "provider": obj.get("provider") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py b/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py new file mode 100644 index 00000000..75542efc --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp +from typing import Optional, Set +from typing_extensions import Self + +class EventObjectFly(BaseModel): + """ + EventObjectFly + """ # noqa: E501 + app: Optional[EventObjectFlyApp] = None + region: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app", "region"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventObjectFly from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of app + if self.app: + _dict['app'] = self.app.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventObjectFly from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app": EventObjectFlyApp.from_dict(obj["app"]) if obj.get("app") is not None else None, + "region": obj.get("region") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py b/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py new file mode 100644 index 00000000..8149e3e0 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EventObjectFlyApp(BaseModel): + """ + EventObjectFlyApp + """ # noqa: E501 + instance: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["instance", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventObjectFlyApp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventObjectFlyApp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instance": obj.get("instance"), + "name": obj.get("name") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_log.py b/hatchet_sdk/clients/cloud_rest/models/event_object_log.py new file mode 100644 index 00000000..c5647b85 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_log.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EventObjectLog(BaseModel): + """ + EventObjectLog + """ # noqa: E501 + level: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["level"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventObjectLog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventObjectLog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "level": obj.get("level") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py b/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py new file mode 100644 index 00000000..9e99d004 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from typing import Optional, Set +from typing_extensions import Self + +class GithubAppInstallation(BaseModel): + """ + GithubAppInstallation + """ # noqa: E501 + metadata: APIResourceMeta + installation_settings_url: StrictStr + account_name: StrictStr + account_avatar_url: StrictStr + __properties: ClassVar[List[str]] = ["metadata", "installation_settings_url", "account_name", "account_avatar_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GithubAppInstallation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GithubAppInstallation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "installation_settings_url": obj.get("installation_settings_url"), + "account_name": obj.get("account_name"), + "account_avatar_url": obj.get("account_avatar_url") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/github_branch.py b/hatchet_sdk/clients/cloud_rest/models/github_branch.py new file mode 100644 index 00000000..7ddd7b8f --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/github_branch.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GithubBranch(BaseModel): + """ + GithubBranch + """ # noqa: E501 + branch_name: StrictStr + is_default: StrictBool + __properties: ClassVar[List[str]] = ["branch_name", "is_default"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GithubBranch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GithubBranch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "branch_name": obj.get("branch_name"), + "is_default": obj.get("is_default") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/github_repo.py b/hatchet_sdk/clients/cloud_rest/models/github_repo.py new file mode 100644 index 00000000..edf734b9 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/github_repo.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GithubRepo(BaseModel): + """ + GithubRepo + """ # noqa: E501 + repo_owner: StrictStr + repo_name: StrictStr + __properties: ClassVar[List[str]] = ["repo_owner", "repo_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GithubRepo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GithubRepo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "repo_owner": obj.get("repo_owner"), + "repo_name": obj.get("repo_name") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py b/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py new file mode 100644 index 00000000..45614e61 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class HistogramBucket(BaseModel): + """ + HistogramBucket + """ # noqa: E501 + boundaries: Optional[StrictInt] = None + lower: Optional[Union[StrictFloat, StrictInt]] = None + upper: Optional[Union[StrictFloat, StrictInt]] = None + count: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["boundaries", "lower", "upper", "count"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HistogramBucket from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HistogramBucket from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "boundaries": obj.get("boundaries"), + "lower": obj.get("lower"), + "upper": obj.get("upper"), + "count": obj.get("count") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py new file mode 100644 index 00000000..cea57a63 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from typing import Optional, Set +from typing_extensions import Self + +class InfraAsCodeRequest(BaseModel): + """ + InfraAsCodeRequest + """ # noqa: E501 + runtime_configs: List[CreateManagedWorkerRuntimeConfigRequest] = Field(alias="runtimeConfigs") + __properties: ClassVar[List[str]] = ["runtimeConfigs"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InfraAsCodeRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list) + _items = [] + if self.runtime_configs: + for _item in self.runtime_configs: + if _item: + _items.append(_item.to_dict()) + _dict['runtimeConfigs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InfraAsCodeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "runtimeConfigs": [CreateManagedWorkerRuntimeConfigRequest.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/instance.py b/hatchet_sdk/clients/cloud_rest/models/instance.py new file mode 100644 index 00000000..53e85315 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/instance.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Instance(BaseModel): + """ + Instance + """ # noqa: E501 + instance_id: StrictStr = Field(alias="instanceId") + name: StrictStr + region: StrictStr + state: StrictStr + cpu_kind: StrictStr = Field(alias="cpuKind") + cpus: StrictInt + memory_mb: StrictInt = Field(alias="memoryMb") + disk_gb: StrictInt = Field(alias="diskGb") + commit_sha: StrictStr = Field(alias="commitSha") + __properties: ClassVar[List[str]] = ["instanceId", "name", "region", "state", "cpuKind", "cpus", "memoryMb", "diskGb", "commitSha"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Instance from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Instance from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instanceId": obj.get("instanceId"), + "name": obj.get("name"), + "region": obj.get("region"), + "state": obj.get("state"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "diskGb": obj.get("diskGb"), + "commitSha": obj.get("commitSha") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/instance_list.py b/hatchet_sdk/clients/cloud_rest/models/instance_list.py new file mode 100644 index 00000000..4d6f99ec --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/instance_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.instance import Instance +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from typing import Optional, Set +from typing_extensions import Self + +class InstanceList(BaseModel): + """ + InstanceList + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None + rows: Optional[List[Instance]] = None + __properties: ClassVar[List[str]] = ["pagination", "rows"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InstanceList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [Instance.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py b/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py new file mode 100644 index 00000000..c7d783ff --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListGithubAppInstallationsResponse(BaseModel): + """ + ListGithubAppInstallationsResponse + """ # noqa: E501 + pagination: PaginationResponse + rows: List[GithubAppInstallation] + __properties: ClassVar[List[str]] = ["pagination", "rows"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListGithubAppInstallationsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListGithubAppInstallationsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [GithubAppInstallation.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line.py b/hatchet_sdk/clients/cloud_rest/models/log_line.py new file mode 100644 index 00000000..277b9888 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/log_line.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class LogLine(BaseModel): + """ + LogLine + """ # noqa: E501 + timestamp: datetime + instance: StrictStr + line: StrictStr + __properties: ClassVar[List[str]] = ["timestamp", "instance", "line"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LogLine from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LogLine from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "instance": obj.get("instance"), + "line": obj.get("line") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line_list.py b/hatchet_sdk/clients/cloud_rest/models/log_line_list.py new file mode 100644 index 00000000..ca0b9b76 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/log_line_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from typing import Optional, Set +from typing_extensions import Self + +class LogLineList(BaseModel): + """ + LogLineList + """ # noqa: E501 + rows: Optional[List[LogLine]] = None + pagination: Optional[PaginationResponse] = None + __properties: ClassVar[List[str]] = ["rows", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LogLineList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LogLineList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rows": [LogLine.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker.py new file mode 100644 index 00000000..0f6adac9 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorker(BaseModel): + """ + ManagedWorker + """ # noqa: E501 + metadata: APIResourceMeta + name: StrictStr + build_config: ManagedWorkerBuildConfig = Field(alias="buildConfig") + is_iac: StrictBool = Field(alias="isIac") + env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") + runtime_configs: Optional[List[ManagedWorkerRuntimeConfig]] = Field(default=None, alias="runtimeConfigs") + __properties: ClassVar[List[str]] = ["metadata", "name", "buildConfig", "isIac", "envVars", "runtimeConfigs"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorker from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict['buildConfig'] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list) + _items = [] + if self.runtime_configs: + for _item in self.runtime_configs: + if _item: + _items.append(_item.to_dict()) + _dict['runtimeConfigs'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorker from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "buildConfig": ManagedWorkerBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfigs": [ManagedWorkerRuntimeConfig.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py new file mode 100644 index 00000000..1715b20f --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep +from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerBuildConfig(BaseModel): + """ + ManagedWorkerBuildConfig + """ # noqa: E501 + metadata: APIResourceMeta + github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + github_repository: GithubRepo = Field(alias="githubRepository") + github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") + steps: Optional[List[BuildStep]] = None + __properties: ClassVar[List[str]] = ["metadata", "githubInstallationId", "githubRepository", "githubRepositoryBranch", "steps"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerBuildConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of github_repository + if self.github_repository: + _dict['githubRepository'] = self.github_repository.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in steps (list) + _items = [] + if self.steps: + for _item in self.steps: + if _item: + _items.append(_item.to_dict()) + _dict['steps'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerBuildConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepository": GithubRepo.from_dict(obj["githubRepository"]) if obj.get("githubRepository") is not None else None, + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": [BuildStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py new file mode 100644 index 00000000..67323d4b --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerEvent(BaseModel): + """ + ManagedWorkerEvent + """ # noqa: E501 + id: StrictInt + time_first_seen: datetime = Field(alias="timeFirstSeen") + time_last_seen: datetime = Field(alias="timeLastSeen") + managed_worker_id: StrictStr = Field(alias="managedWorkerId") + status: ManagedWorkerEventStatus + message: StrictStr + data: Dict[str, Any] + __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "managedWorkerId", "status", "message", "data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "managedWorkerId": obj.get("managedWorkerId"), + "status": obj.get("status"), + "message": obj.get("message"), + "data": obj.get("data") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py new file mode 100644 index 00000000..22a5d3a3 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerEventList(BaseModel): + """ + ManagedWorkerEventList + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None + rows: Optional[List[ManagedWorkerEvent]] = None + __properties: ClassVar[List[str]] = ["pagination", "rows"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerEventList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerEventList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [ManagedWorkerEvent.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py new file mode 100644 index 00000000..176586ab --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ManagedWorkerEventStatus(str, Enum): + """ + ManagedWorkerEventStatus + """ + + """ + allowed enum values + """ + IN_PROGRESS = 'IN_PROGRESS' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' + CANCELLED = 'CANCELLED' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ManagedWorkerEventStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py new file mode 100644 index 00000000..297daf33 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerList(BaseModel): + """ + ManagedWorkerList + """ # noqa: E501 + rows: Optional[List[ManagedWorker]] = None + pagination: Optional[PaginationResponse] = None + __properties: ClassVar[List[str]] = ["rows", "pagination"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rows": [ManagedWorker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py new file mode 100644 index 00000000..d49aa594 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ManagedWorkerRegion(str, Enum): + """ + ManagedWorkerRegion + """ + + """ + allowed enum values + """ + AMS = 'ams' + ARN = 'arn' + ATL = 'atl' + BOG = 'bog' + BOS = 'bos' + CDG = 'cdg' + DEN = 'den' + DFW = 'dfw' + EWR = 'ewr' + EZE = 'eze' + GDL = 'gdl' + GIG = 'gig' + GRU = 'gru' + HKG = 'hkg' + IAD = 'iad' + JNB = 'jnb' + LAX = 'lax' + LHR = 'lhr' + MAD = 'mad' + MIA = 'mia' + NRT = 'nrt' + ORD = 'ord' + OTP = 'otp' + PHX = 'phx' + QRO = 'qro' + SCL = 'scl' + SEA = 'sea' + SIN = 'sin' + SJC = 'sjc' + SYD = 'syd' + WAW = 'waw' + YUL = 'yul' + YYZ = 'yyz' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ManagedWorkerRegion from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py new file mode 100644 index 00000000..86cfa94c --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerRuntimeConfig(BaseModel): + """ + ManagedWorkerRuntimeConfig + """ # noqa: E501 + metadata: APIResourceMeta + num_replicas: StrictInt = Field(alias="numReplicas") + cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpus: StrictInt = Field(description="The number of CPUs to use for the worker") + memory_mb: StrictInt = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + region: ManagedWorkerRegion = Field(description="The region that the worker is deployed to") + actions: Optional[List[StrictStr]] = Field(default=None, description="A list of actions this runtime config corresponds to") + __properties: ClassVar[List[str]] = ["metadata", "numReplicas", "cpuKind", "cpus", "memoryMb", "region", "actions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerRuntimeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerRuntimeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "numReplicas": obj.get("numReplicas"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "region": obj.get("region"), + "actions": obj.get("actions") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/pagination_response.py b/hatchet_sdk/clients/cloud_rest/models/pagination_response.py new file mode 100644 index 00000000..8d1ebd1e --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/pagination_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PaginationResponse(BaseModel): + """ + PaginationResponse + """ # noqa: E501 + current_page: Optional[StrictInt] = Field(default=None, description="the current page") + next_page: Optional[StrictInt] = Field(default=None, description="the next page") + num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") + __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PaginationResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaginationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py b/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py new file mode 100644 index 00000000..9ef008f6 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RuntimeConfigActionsResponse(BaseModel): + """ + RuntimeConfigActionsResponse + """ # noqa: E501 + actions: List[StrictStr] + __properties: ClassVar[List[str]] = ["actions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RuntimeConfigActionsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RuntimeConfigActionsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "actions": obj.get("actions") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py b/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py new file mode 100644 index 00000000..6d07a2fb --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket +from typing import Optional, Set +from typing_extensions import Self + +class SampleHistogram(BaseModel): + """ + SampleHistogram + """ # noqa: E501 + count: Optional[Union[StrictFloat, StrictInt]] = None + sum: Optional[Union[StrictFloat, StrictInt]] = None + buckets: Optional[List[HistogramBucket]] = None + __properties: ClassVar[List[str]] = ["count", "sum", "buckets"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SampleHistogram from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in buckets (list) + _items = [] + if self.buckets: + for _item in self.buckets: + if _item: + _items.append(_item.to_dict()) + _dict['buckets'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SampleHistogram from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "sum": obj.get("sum"), + "buckets": [HistogramBucket.from_dict(_item) for _item in obj["buckets"]] if obj.get("buckets") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py b/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py new file mode 100644 index 00000000..ec874700 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram +from typing import Optional, Set +from typing_extensions import Self + +class SampleHistogramPair(BaseModel): + """ + SampleHistogramPair + """ # noqa: E501 + timestamp: Optional[StrictInt] = None + histogram: Optional[SampleHistogram] = None + __properties: ClassVar[List[str]] = ["timestamp", "histogram"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SampleHistogramPair from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of histogram + if self.histogram: + _dict['histogram'] = self.histogram.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SampleHistogramPair from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "histogram": SampleHistogram.from_dict(obj["histogram"]) if obj.get("histogram") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_stream.py b/hatchet_sdk/clients/cloud_rest/models/sample_stream.py new file mode 100644 index 00000000..dbfb00e4 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/sample_stream.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair +from typing import Optional, Set +from typing_extensions import Self + +class SampleStream(BaseModel): + """ + SampleStream + """ # noqa: E501 + metric: Optional[Dict[str, StrictStr]] = None + values: Optional[List[List[StrictStr]]] = None + histograms: Optional[List[SampleHistogramPair]] = None + __properties: ClassVar[List[str]] = ["metric", "values", "histograms"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SampleStream from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in histograms (list) + _items = [] + if self.histograms: + for _item in self.histograms: + if _item: + _items.append(_item.to_dict()) + _dict['histograms'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SampleStream from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "values": obj.get("values"), + "histograms": [SampleHistogramPair.from_dict(_item) for _item in obj["histograms"]] if obj.get("histograms") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py b/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py new file mode 100644 index 00000000..424cfbc8 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SubscriptionPlan(BaseModel): + """ + SubscriptionPlan + """ # noqa: E501 + plan_code: StrictStr = Field(description="The code of the plan.") + name: StrictStr = Field(description="The name of the plan.") + description: StrictStr = Field(description="The description of the plan.") + amount_cents: StrictInt = Field(description="The price of the plan.") + period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") + __properties: ClassVar[List[str]] = ["plan_code", "name", "description", "amount_cents", "period"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubscriptionPlan from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubscriptionPlan from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "plan_code": obj.get("plan_code"), + "name": obj.get("name"), + "description": obj.get("description"), + "amount_cents": obj.get("amount_cents"), + "period": obj.get("period") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py new file mode 100644 index 00000000..b5859a1f --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon +from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription +from typing import Optional, Set +from typing_extensions import Self + +class TenantBillingState(BaseModel): + """ + TenantBillingState + """ # noqa: E501 + payment_methods: Optional[List[TenantPaymentMethod]] = Field(default=None, alias="paymentMethods") + subscription: TenantSubscription = Field(description="The subscription associated with this policy.") + plans: Optional[List[SubscriptionPlan]] = Field(default=None, description="A list of plans available for the tenant.") + coupons: Optional[List[Coupon]] = Field(default=None, description="A list of coupons applied to the tenant.") + __properties: ClassVar[List[str]] = ["paymentMethods", "subscription", "plans", "coupons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantBillingState from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in payment_methods (list) + _items = [] + if self.payment_methods: + for _item in self.payment_methods: + if _item: + _items.append(_item.to_dict()) + _dict['paymentMethods'] = _items + # override the default output from pydantic by calling `to_dict()` of subscription + if self.subscription: + _dict['subscription'] = self.subscription.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in plans (list) + _items = [] + if self.plans: + for _item in self.plans: + if _item: + _items.append(_item.to_dict()) + _dict['plans'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in coupons (list) + _items = [] + if self.coupons: + for _item in self.coupons: + if _item: + _items.append(_item.to_dict()) + _dict['coupons'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantBillingState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "paymentMethods": [TenantPaymentMethod.from_dict(_item) for _item in obj["paymentMethods"]] if obj.get("paymentMethods") is not None else None, + "subscription": TenantSubscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None, + "plans": [SubscriptionPlan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None, + "coupons": [Coupon.from_dict(_item) for _item in obj["coupons"]] if obj.get("coupons") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py b/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py new file mode 100644 index 00000000..31f10fb0 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TenantPaymentMethod(BaseModel): + """ + TenantPaymentMethod + """ # noqa: E501 + brand: StrictStr = Field(description="The brand of the payment method.") + last4: Optional[StrictStr] = Field(default=None, description="The last 4 digits of the card.") + expiration: Optional[StrictStr] = Field(default=None, description="The expiration date of the card.") + description: Optional[StrictStr] = Field(default=None, description="The description of the payment method.") + __properties: ClassVar[List[str]] = ["brand", "last4", "expiration", "description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantPaymentMethod from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantPaymentMethod from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "brand": obj.get("brand"), + "last4": obj.get("last4"), + "expiration": obj.get("expiration"), + "description": obj.get("description") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py new file mode 100644 index 00000000..9f160280 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus +from typing import Optional, Set +from typing_extensions import Self + +class TenantSubscription(BaseModel): + """ + TenantSubscription + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") + period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") + status: Optional[TenantSubscriptionStatus] = Field(default=None, description="The status of the tenant subscription.") + note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") + __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantSubscription from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantSubscription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py new file mode 100644 index 00000000..4df0c6bc --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TenantSubscriptionStatus(str, Enum): + """ + TenantSubscriptionStatus + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + PENDING = 'pending' + TERMINATED = 'terminated' + CANCELED = 'canceled' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TenantSubscriptionStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py new file mode 100644 index 00000000..a8991434 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from typing import Optional, Set +from typing_extensions import Self + +class UpdateManagedWorkerRequest(BaseModel): + """ + UpdateManagedWorkerRequest + """ # noqa: E501 + name: Optional[StrictStr] = None + build_config: Optional[CreateManagedWorkerBuildConfigRequest] = Field(default=None, alias="buildConfig") + env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of environment variables to set for the worker", alias="envVars") + is_iac: Optional[StrictBool] = Field(default=None, alias="isIac") + runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field(default=None, alias="runtimeConfig") + __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateManagedWorkerRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of build_config + if self.build_config: + _dict['buildConfig'] = self.build_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of runtime_config + if self.runtime_config: + _dict['runtimeConfig'] = self.runtime_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateManagedWorkerRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "buildConfig": CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfig": CreateManagedWorkerRuntimeConfigRequest.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py new file mode 100644 index 00000000..d2ae860e --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UpdateTenantSubscription(BaseModel): + """ + UpdateTenantSubscription + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The code of the plan.") + period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") + __properties: ClassVar[List[str]] = ["plan", "period"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateTenantSubscription from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateTenantSubscription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "period": obj.get("period") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py new file mode 100644 index 00000000..37840dce --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class WorkflowRunEventsMetric(BaseModel): + """ + WorkflowRunEventsMetric + """ # noqa: E501 + time: datetime + pending: StrictInt = Field(alias="PENDING") + running: StrictInt = Field(alias="RUNNING") + succeeded: StrictInt = Field(alias="SUCCEEDED") + failed: StrictInt = Field(alias="FAILED") + queued: StrictInt = Field(alias="QUEUED") + __properties: ClassVar[List[str]] = ["time", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkflowRunEventsMetric from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkflowRunEventsMetric from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "time": obj.get("time"), + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py new file mode 100644 index 00000000..17406b11 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric +from typing import Optional, Set +from typing_extensions import Self + +class WorkflowRunEventsMetricsCounts(BaseModel): + """ + WorkflowRunEventsMetricsCounts + """ # noqa: E501 + results: Optional[List[WorkflowRunEventsMetric]] = None + __properties: ClassVar[List[str]] = ["results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkflowRunEventsMetricsCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkflowRunEventsMetricsCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [WorkflowRunEventsMetric.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/rest.py b/hatchet_sdk/clients/cloud_rest/rest.py new file mode 100644 index 00000000..35fe64cc --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/rest.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl +from typing import Optional, Union + +import aiohttp +import aiohttp_retry + +from hatchet_sdk.clients.cloud_rest.exceptions import ApiException, ApiValueError + +RESTResponseType = aiohttp.ClientResponse + +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + maxsize = configuration.connection_pool_maxsize + + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector( + limit=maxsize, + ssl=ssl_context + ) + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + # https pool manager + self.pool_manager = aiohttp.ClientSession( + connector=connector, + trust_env=True + ) + + retries = configuration.retries + self.retry_client: Optional[aiohttp_retry.RetryClient] + if retries is not None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=0.0, + start_timeout=0.0, + max_timeout=120.0 + ) + ) + else: + self.retry_client = None + + async def close(self): + await self.pool_manager.close() + if self.retry_client is not None: + await self.retry_client.close() + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Execute request + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + # url already contains the URL query string + timeout = _request_timeout or 5 * 60 + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } + + if self.proxy: + args["proxy"] = self.proxy + if self.proxy_headers: + args["proxy_headers"] = self.proxy_headers + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body is not None: + body = json.dumps(body) + args["data"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + args["data"] = aiohttp.FormData(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by aiohttp + del headers['Content-Type'] + data = aiohttp.FormData() + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) + else: + data.add_field(k, v) + args["data"] = data + + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + if self.retry_client is not None and method in ALLOW_RETRY_METHODS: + pool_manager = self.retry_client + else: + pool_manager = self.pool_manager + + r = await pool_manager.request(**args) + + return RESTResponse(r) + + + + + From ab5d44daf85e1361e4109a2aba9db6fc6b33411c Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Wed, 9 Oct 2024 11:21:22 -0400 Subject: [PATCH 04/33] feat: expose cloud rest --- .gitmodules | 4 ++-- hatchet_sdk/clients/rest_client.py | 20 ++++++++++++++++ hatchet_sdk/worker/worker.py | 38 ++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index af5b788d..dc9476d0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "hatchet"] path = hatchet - url = git@github.com:hatchet-dev/hatchet.git - branch = feat/iac + url = https://github.com/hatchet-dev/hatchet.git + branch = main [submodule "hatchet-cloud"] path = hatchet-cloud url = https://github.com/hatchet-dev/hatchet-cloud.git diff --git a/hatchet_sdk/clients/rest_client.py b/hatchet_sdk/clients/rest_client.py index b3d502e0..f0fca4b7 100644 --- a/hatchet_sdk/clients/rest_client.py +++ b/hatchet_sdk/clients/rest_client.py @@ -3,6 +3,7 @@ import threading from typing import Any +from hatchet_sdk.clients.cloud_rest.api.managed_worker_api import ManagedWorkerApi from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi @@ -50,6 +51,10 @@ ) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion +from hatchet_sdk.clients.cloud_rest.configuration import Configuration as CloudConfiguration +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient as CloudApiClient + + class AsyncRestApi: def __init__(self, host: str, api_key: str, tenant_id: str): @@ -60,7 +65,15 @@ def __init__(self, host: str, api_key: str, tenant_id: str): access_token=api_key, ) + self.cloud_config = CloudConfiguration( + host=host, + access_token=api_key, + ) + self._api_client = None + self._cloud_api_client = None + self._managed_worker_api = None + self._workflow_api = None self._workflow_run_api = None self._step_run_api = None @@ -71,8 +84,15 @@ def __init__(self, host: str, api_key: str, tenant_id: str): def api_client(self): if self._api_client is None: self._api_client = ApiClient(configuration=self.config) + self._cloud_api_client = CloudApiClient(configuration=self.cloud_config) return self._api_client + @property + def managed_worker_api(self): + if self._managed_worker_api is None: + self._managed_worker_api = ManagedWorkerApi(self.api_client) + return self._managed_worker_api + @property def workflow_api(self): if self._workflow_api is None: diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index db944511..2d84e5d6 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -9,6 +9,9 @@ from typing import Any, Callable, Dict, Optional from hatchet_sdk.client import Client, new_client_raw +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion from hatchet_sdk.context import Context from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts from hatchet_sdk.loader import ClientConfig @@ -150,6 +153,41 @@ async def async_start( ) return + # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit + if not os.environ.get("HATCHET_CLOUD_REGISTER_ID"): + print("REGISTERING WORKER", os.environ.get("HATCHET_CLOUD_REGISTER_ID")) + + try: + print("1") + mw = CreateManagedWorkerRuntimeConfigRequest( + actions = self.action_registry.keys(), + num_replicas = 1, + cpu_kind = "shared", + cpus = 1, + memory_mb = 1024, + region = ManagedWorkerRegion.EWR + ) + print("2") + + req = InfraAsCodeRequest( + runtime_configs = [mw] + ) + + print("REQ", req.to_dict()) + + res = await self.client.rest.aio.managed_worker_api.infra_as_code_create( + infra_as_code_request=os.environ.get("HATCHET_CLOUD_REGISTER_ID"), + infra_as_code_request2=req, + _request_timeout=10, + ) + + print("RESPONSE", res) + + sys.exit(0) + except Exception as e: + print("ERROR", e) + sys.exit(1) + # non blocking setup if not _from_start: self.setup_loop(options.loop) From 92a219bef07b393d4bd600bd51daa5859fa069e2 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Wed, 9 Oct 2024 15:44:44 -0400 Subject: [PATCH 05/33] wip --- hatchet_sdk/clients/rest/__init__.py | 170 +- hatchet_sdk/clients/rest/api/__init__.py | 5 +- hatchet_sdk/clients/rest/api/api_token_api.py | 343 ++-- hatchet_sdk/clients/rest/api/default_api.py | 765 ++++---- hatchet_sdk/clients/rest/api/event_api.py | 774 ++++---- hatchet_sdk/clients/rest/api/github_api.py | 136 +- .../clients/rest/api/healthcheck_api.py | 142 +- hatchet_sdk/clients/rest/api/log_api.py | 230 +-- hatchet_sdk/clients/rest/api/metadata_api.py | 233 ++- hatchet_sdk/clients/rest/api/slack_api.py | 237 +-- hatchet_sdk/clients/rest/api/sns_api.py | 366 ++-- hatchet_sdk/clients/rest/api/step_run_api.py | 852 ++++---- hatchet_sdk/clients/rest/api/tenant_api.py | 1716 +++++++++-------- hatchet_sdk/clients/rest/api/user_api.py | 969 ++++++---- hatchet_sdk/clients/rest/api/worker_api.py | 367 ++-- hatchet_sdk/clients/rest/api/workflow_api.py | 1702 +++++++--------- .../clients/rest/api/workflow_run_api.py | 320 ++- .../clients/rest/api/workflow_runs_api.py | 270 ++- hatchet_sdk/clients/rest/api_client.py | 254 ++- hatchet_sdk/clients/rest/api_response.py | 11 +- hatchet_sdk/clients/rest/configuration.py | 212 +- hatchet_sdk/clients/rest/exceptions.py | 31 +- hatchet_sdk/clients/rest/models/__init__.py | 151 +- .../rest/models/accept_invite_request.py | 23 +- hatchet_sdk/clients/rest/models/api_error.py | 45 +- hatchet_sdk/clients/rest/models/api_errors.py | 33 +- hatchet_sdk/clients/rest/models/api_meta.py | 91 +- .../clients/rest/models/api_meta_auth.py | 24 +- .../rest/models/api_meta_integration.py | 27 +- .../clients/rest/models/api_meta_posthog.py | 31 +- .../clients/rest/models/api_resource_meta.py | 45 +- hatchet_sdk/clients/rest/models/api_token.py | 48 +- .../rest/models/create_api_token_request.py | 36 +- .../rest/models/create_api_token_response.py | 20 +- .../rest/models/create_event_request.py | 34 +- .../create_pull_request_from_step_run.py | 20 +- .../models/create_sns_integration_request.py | 24 +- ...create_tenant_alert_email_group_request.py | 20 +- .../models/create_tenant_invite_request.py | 24 +- .../rest/models/create_tenant_request.py | 21 +- hatchet_sdk/clients/rest/models/event.py | 88 +- hatchet_sdk/clients/rest/models/event_data.py | 20 +- .../clients/rest/models/event_key_list.py | 35 +- hatchet_sdk/clients/rest/models/event_list.py | 41 +- .../rest/models/event_order_by_direction.py | 8 +- .../rest/models/event_order_by_field.py | 6 +- .../rest/models/event_workflow_run_summary.py | 60 +- .../rest/models/get_step_run_diff_response.py | 33 +- hatchet_sdk/clients/rest/models/job.py | 69 +- hatchet_sdk/clients/rest/models/job_run.py | 101 +- .../clients/rest/models/job_run_status.py | 14 +- .../rest/models/list_api_tokens_response.py | 41 +- .../models/list_pull_requests_response.py | 33 +- .../rest/models/list_slack_webhooks.py | 41 +- .../rest/models/list_sns_integrations.py | 41 +- hatchet_sdk/clients/rest/models/log_line.py | 34 +- .../clients/rest/models/log_line_level.py | 12 +- .../clients/rest/models/log_line_list.py | 41 +- .../models/log_line_order_by_direction.py | 8 +- .../rest/models/log_line_order_by_field.py | 6 +- .../rest/models/pagination_response.py | 36 +- .../clients/rest/models/pull_request.py | 52 +- .../clients/rest/models/pull_request_state.py | 8 +- .../clients/rest/models/queue_metrics.py | 40 +- .../clients/rest/models/recent_step_runs.py | 57 +- .../rest/models/reject_invite_request.py | 23 +- .../rest/models/replay_event_request.py | 27 +- .../models/replay_workflow_runs_request.py | 27 +- .../models/replay_workflow_runs_response.py | 33 +- .../rest/models/rerun_step_run_request.py | 20 +- .../clients/rest/models/semaphore_slots.py | 71 +- .../clients/rest/models/slack_webhook.py | 76 +- .../clients/rest/models/sns_integration.py | 59 +- hatchet_sdk/clients/rest/models/step.py | 66 +- hatchet_sdk/clients/rest/models/step_run.py | 137 +- .../clients/rest/models/step_run_archive.py | 83 +- .../rest/models/step_run_archive_list.py | 41 +- .../clients/rest/models/step_run_diff.py | 28 +- .../clients/rest/models/step_run_event.py | 57 +- .../rest/models/step_run_event_list.py | 41 +- .../rest/models/step_run_event_reason.py | 32 +- .../rest/models/step_run_event_severity.py | 10 +- .../clients/rest/models/step_run_status.py | 20 +- hatchet_sdk/clients/rest/models/tenant.py | 61 +- .../rest/models/tenant_alert_email_group.py | 35 +- .../models/tenant_alert_email_group_list.py | 45 +- .../rest/models/tenant_alerting_settings.py | 95 +- .../clients/rest/models/tenant_invite.py | 63 +- .../clients/rest/models/tenant_invite_list.py | 41 +- .../clients/rest/models/tenant_list.py | 41 +- .../clients/rest/models/tenant_member.py | 59 +- .../clients/rest/models/tenant_member_list.py | 41 +- .../clients/rest/models/tenant_member_role.py | 10 +- .../rest/models/tenant_queue_metrics.py | 37 +- .../clients/rest/models/tenant_resource.py | 14 +- .../rest/models/tenant_resource_limit.py | 86 +- .../rest/models/tenant_resource_policy.py | 37 +- .../models/trigger_workflow_run_request.py | 30 +- ...update_tenant_alert_email_group_request.py | 20 +- .../models/update_tenant_invite_request.py | 23 +- .../rest/models/update_tenant_request.py | 90 +- .../rest/models/update_worker_request.py | 26 +- hatchet_sdk/clients/rest/models/user.py | 73 +- .../models/user_change_password_request.py | 27 +- .../clients/rest/models/user_login_request.py | 23 +- .../rest/models/user_register_request.py | 28 +- .../models/user_tenant_memberships_list.py | 41 +- .../clients/rest/models/user_tenant_public.py | 25 +- .../clients/rest/models/webhook_worker.py | 37 +- .../models/webhook_worker_create_request.py | 36 +- .../models/webhook_worker_create_response.py | 33 +- .../rest/models/webhook_worker_created.py | 39 +- .../models/webhook_worker_list_response.py | 41 +- .../rest/models/webhook_worker_request.py | 47 +- .../webhook_worker_request_list_response.py | 37 +- .../models/webhook_worker_request_method.py | 10 +- hatchet_sdk/clients/rest/models/worker.py | 180 +- .../clients/rest/models/worker_label.py | 41 +- .../clients/rest/models/worker_list.py | 41 +- hatchet_sdk/clients/rest/models/workflow.py | 83 +- .../rest/models/workflow_concurrency.py | 58 +- .../clients/rest/models/workflow_kind.py | 10 +- .../clients/rest/models/workflow_list.py | 49 +- .../clients/rest/models/workflow_metrics.py | 38 +- .../clients/rest/models/workflow_run.py | 124 +- .../models/workflow_run_cancel200_response.py | 27 +- .../clients/rest/models/workflow_run_list.py | 41 +- .../models/workflow_run_order_by_direction.py | 8 +- .../models/workflow_run_order_by_field.py | 12 +- .../rest/models/workflow_run_status.py | 16 +- .../rest/models/workflow_run_triggered_by.py | 58 +- .../models/workflow_runs_cancel_request.py | 27 +- .../rest/models/workflow_runs_metrics.py | 36 +- .../models/workflow_runs_metrics_counts.py | 40 +- .../clients/rest/models/workflow_tag.py | 21 +- .../rest/models/workflow_trigger_cron_ref.py | 23 +- .../rest/models/workflow_trigger_event_ref.py | 23 +- .../clients/rest/models/workflow_triggers.py | 72 +- .../clients/rest/models/workflow_version.py | 85 +- .../models/workflow_version_definition.py | 24 +- .../rest/models/workflow_version_meta.py | 56 +- hatchet_sdk/clients/rest/rest.py | 69 +- 142 files changed, 7073 insertions(+), 8138 deletions(-) diff --git a/hatchet_sdk/clients/rest/__init__.py b/hatchet_sdk/clients/rest/__init__.py index de23ce32..ce52b51d 100644 --- a/hatchet_sdk/clients/rest/__init__.py +++ b/hatchet_sdk/clients/rest/__init__.py @@ -18,14 +18,13 @@ # import apis into sdk package from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi -from hatchet_sdk.clients.rest.api.default_api import DefaultApi from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.github_api import GithubApi from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi -from hatchet_sdk.clients.rest.api.slack_api import SlackApi from hatchet_sdk.clients.rest.api.sns_api import SNSApi +from hatchet_sdk.clients.rest.api.slack_api import SlackApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi from hatchet_sdk.clients.rest.api.tenant_api import TenantApi from hatchet_sdk.clients.rest.api.user_api import UserApi @@ -33,20 +32,18 @@ from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi -from hatchet_sdk.clients.rest.api_client import ApiClient +from hatchet_sdk.clients.rest.api.default_api import DefaultApi # import ApiClient from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.api_client import ApiClient from hatchet_sdk.clients.rest.configuration import Configuration -from hatchet_sdk.clients.rest.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) -from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest +from hatchet_sdk.clients.rest.exceptions import OpenApiException +from hatchet_sdk.clients.rest.exceptions import ApiTypeError +from hatchet_sdk.clients.rest.exceptions import ApiValueError +from hatchet_sdk.clients.rest.exceptions import ApiKeyError +from hatchet_sdk.clients.rest.exceptions import ApiAttributeError +from hatchet_sdk.clients.rest.exceptions import ApiException # import models into sdk package from hatchet_sdk.clients.rest.models.api_error import APIError @@ -57,57 +54,34 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.create_api_token_request import ( - CreateAPITokenRequest, -) -from hatchet_sdk.clients.rest.models.create_api_token_response import ( - CreateAPITokenResponse, -) +from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest +from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest +from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest -from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import ( - CreatePullRequestFromStepRun, -) -from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( - CreateSNSIntegrationRequest, -) -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( - CreateTenantAlertEmailGroupRequest, -) -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( - CreateTenantInviteRequest, -) +from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import CreatePullRequestFromStepRun +from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import ( - EventOrderByDirection, -) +from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( - EventWorkflowRunSummary, -) -from hatchet_sdk.clients.rest.models.get_step_run_diff_response import ( - GetStepRunDiffResponse, -) +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary +from hatchet_sdk.clients.rest.models.get_step_run_diff_response import GetStepRunDiffResponse from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run import JobRun from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( - ListAPITokensResponse, -) -from hatchet_sdk.clients.rest.models.list_pull_requests_response import ( - ListPullRequestsResponse, -) -from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse +from hatchet_sdk.clients.rest.models.list_pull_requests_response import ListPullRequestsResponse from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( - LogLineOrderByDirection, -) +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.pull_request import PullRequest @@ -116,16 +90,12 @@ from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( - ReplayWorkflowRunsRequest, -) -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( - ReplayWorkflowRunsResponse, -) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive @@ -137,15 +107,9 @@ from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( - TenantAlertEmailGroup, -) -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( - TenantAlertEmailGroupList, -) -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( - TenantAlertingSettings, -) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_list import TenantList @@ -156,45 +120,25 @@ from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( - TriggerWorkflowRunRequest, -) -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( - UpdateTenantAlertEmailGroupRequest, -) -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( - UpdateTenantInviteRequest, -) +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import ( - UserChangePasswordRequest, -) +from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( - UserTenantMembershipsList, -) +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( - WebhookWorkerCreateRequest, -) -from hatchet_sdk.clients.rest.models.webhook_worker_create_response import ( - WebhookWorkerCreateResponse, -) +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest +from hatchet_sdk.clients.rest.models.webhook_worker_create_response import WebhookWorkerCreateResponse from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( - WebhookWorkerListResponse, -) +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( - WebhookWorkerRequestListResponse, -) -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( - WebhookWorkerRequestMethod, -) +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod from hatchet_sdk.clients.rest.models.worker import Worker from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel from hatchet_sdk.clients.rest.models.worker_list import WorkerList @@ -204,37 +148,19 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( - WorkflowRunCancel200Response, -) +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( - WorkflowRunOrderByDirection, -) -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( - WorkflowRunOrderByField, -) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( - WorkflowRunTriggeredBy, -) -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( - WorkflowRunsCancelRequest, -) +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics -from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( - WorkflowRunsMetricsCounts, -) +from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import WorkflowRunsMetricsCounts from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( - WorkflowTriggerCronRef, -) -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( - WorkflowTriggerEventRef, -) +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import ( - WorkflowVersionDefinition, -) +from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta diff --git a/hatchet_sdk/clients/rest/api/__init__.py b/hatchet_sdk/clients/rest/api/__init__.py index 718a6534..0e873f57 100644 --- a/hatchet_sdk/clients/rest/api/__init__.py +++ b/hatchet_sdk/clients/rest/api/__init__.py @@ -2,14 +2,13 @@ # import apis into api package from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi -from hatchet_sdk.clients.rest.api.default_api import DefaultApi from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.github_api import GithubApi from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi -from hatchet_sdk.clients.rest.api.slack_api import SlackApi from hatchet_sdk.clients.rest.api.sns_api import SNSApi +from hatchet_sdk.clients.rest.api.slack_api import SlackApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi from hatchet_sdk.clients.rest.api.tenant_api import TenantApi from hatchet_sdk.clients.rest.api.user_api import UserApi @@ -17,3 +16,5 @@ from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi +from hatchet_sdk.clients.rest.api.default_api import DefaultApi + diff --git a/hatchet_sdk/clients/rest/api/api_token_api.py b/hatchet_sdk/clients/rest/api/api_token_api.py index 5b32d0aa..097cd1e4 100644 --- a/hatchet_sdk/clients/rest/api/api_token_api.py +++ b/hatchet_sdk/clients/rest/api/api_token_api.py @@ -12,22 +12,19 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field +from typing import Optional from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest +from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.create_api_token_request import ( - CreateAPITokenRequest, -) -from hatchet_sdk.clients.rest.models.create_api_token_response import ( - CreateAPITokenResponse, -) -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( - ListAPITokensResponse, -) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -43,22 +40,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def api_token_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -93,7 +87,7 @@ async def api_token_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -101,16 +95,17 @@ async def api_token_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAPITokenResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "CreateAPITokenResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -118,22 +113,19 @@ async def api_token_create( response_types_map=_response_types_map, ).data + @validate_call async def api_token_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -168,7 +160,7 @@ async def api_token_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -176,16 +168,17 @@ async def api_token_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAPITokenResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "CreateAPITokenResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -193,22 +186,19 @@ async def api_token_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def api_token_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -243,7 +233,7 @@ async def api_token_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -251,19 +241,21 @@ async def api_token_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateAPITokenResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "CreateAPITokenResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _api_token_create_serialize( self, tenant, @@ -276,7 +268,8 @@ def _api_token_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -287,7 +280,7 @@ def _api_token_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -295,27 +288,37 @@ def _api_token_create_serialize( if create_api_token_request is not None: _body_params = create_api_token_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/api-tokens", + method='POST', + resource_path='/api/v1/tenants/{tenant}/api-tokens', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -325,24 +328,23 @@ def _api_token_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def api_token_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -375,23 +377,24 @@ async def api_token_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAPITokensResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "ListAPITokensResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -399,21 +402,18 @@ async def api_token_list( response_types_map=_response_types_map, ).data + @validate_call async def api_token_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -446,23 +446,24 @@ async def api_token_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAPITokensResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "ListAPITokensResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -470,21 +471,18 @@ async def api_token_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def api_token_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -517,26 +515,28 @@ async def api_token_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAPITokensResponse", - "400": "APIErrors", - "403": "APIErrors", + '200': "ListAPITokensResponse", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _api_token_list_serialize( self, tenant, @@ -548,7 +548,8 @@ def _api_token_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -559,23 +560,30 @@ def _api_token_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/api-tokens", + method='GET', + resource_path='/api/v1/tenants/{tenant}/api-tokens', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -585,24 +593,23 @@ def _api_token_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def api_token_update_revoke( self, - api_token: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The API token" - ), - ], + api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -635,23 +642,24 @@ async def api_token_update_revoke( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -659,21 +667,18 @@ async def api_token_update_revoke( response_types_map=_response_types_map, ).data + @validate_call async def api_token_update_revoke_with_http_info( self, - api_token: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The API token" - ), - ], + api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -706,23 +711,24 @@ async def api_token_update_revoke_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -730,21 +736,18 @@ async def api_token_update_revoke_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def api_token_update_revoke_without_preload_content( self, - api_token: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The API token" - ), - ], + api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -777,26 +780,28 @@ async def api_token_update_revoke_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _api_token_update_revoke_serialize( self, api_token, @@ -808,7 +813,8 @@ def _api_token_update_revoke_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -819,23 +825,30 @@ def _api_token_update_revoke_serialize( # process the path parameters if api_token is not None: - _path_params["api-token"] = api_token + _path_params['api-token'] = api_token # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/api-tokens/{api-token}", + method='POST', + resource_path='/api/v1/api-tokens/{api-token}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -845,5 +858,7 @@ def _api_token_update_revoke_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/default_api.py b/hatchet_sdk/clients/rest/api/default_api.py index 5cd078e4..902461ab 100644 --- a/hatchet_sdk/clients/rest/api/default_api.py +++ b/hatchet_sdk/clients/rest/api/default_api.py @@ -12,27 +12,22 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field +from typing import Optional from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest +from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( - UpdateTenantInviteRequest, -) -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( - WebhookWorkerCreateRequest, -) -from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( - WebhookWorkerListResponse, -) -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( - WebhookWorkerRequestListResponse, -) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -48,30 +43,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def tenant_invite_delete( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -106,7 +90,7 @@ async def tenant_invite_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -114,15 +98,16 @@ async def tenant_invite_delete( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -130,30 +115,19 @@ async def tenant_invite_delete( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_delete_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -188,7 +162,7 @@ async def tenant_invite_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -196,15 +170,16 @@ async def tenant_invite_delete_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -212,30 +187,19 @@ async def tenant_invite_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_delete_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -270,7 +234,7 @@ async def tenant_invite_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -278,18 +242,20 @@ async def tenant_invite_delete_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_delete_serialize( self, tenant, @@ -302,7 +268,8 @@ def _tenant_invite_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -313,25 +280,32 @@ def _tenant_invite_delete_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if tenant_invite is not None: - _path_params["tenant-invite"] = tenant_invite + _path_params['tenant-invite'] = tenant_invite # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/tenants/{tenant}/invites/{tenant-invite}", + method='DELETE', + resource_path='/api/v1/tenants/{tenant}/invites/{tenant-invite}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -341,36 +315,25 @@ def _tenant_invite_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_invite_update( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], - update_tenant_invite_request: Annotated[ - UpdateTenantInviteRequest, Field(description="The tenant invite to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -407,7 +370,7 @@ async def tenant_invite_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -416,15 +379,16 @@ async def tenant_invite_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -432,33 +396,20 @@ async def tenant_invite_update( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_update_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], - update_tenant_invite_request: Annotated[ - UpdateTenantInviteRequest, Field(description="The tenant invite to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -495,7 +446,7 @@ async def tenant_invite_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -504,15 +455,16 @@ async def tenant_invite_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -520,33 +472,20 @@ async def tenant_invite_update_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_update_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - tenant_invite: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant invite id", - ), - ], - update_tenant_invite_request: Annotated[ - UpdateTenantInviteRequest, Field(description="The tenant invite to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -583,7 +522,7 @@ async def tenant_invite_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -592,18 +531,20 @@ async def tenant_invite_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInvite", - "400": "APIErrors", + '200': "TenantInvite", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_update_serialize( self, tenant, @@ -617,7 +558,8 @@ def _tenant_invite_update_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -628,9 +570,9 @@ def _tenant_invite_update_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if tenant_invite is not None: - _path_params["tenant-invite"] = tenant_invite + _path_params['tenant-invite'] = tenant_invite # process the query parameters # process the header parameters # process the form parameters @@ -638,27 +580,37 @@ def _tenant_invite_update_serialize( if update_tenant_invite_request is not None: _body_params = update_tenant_invite_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/tenants/{tenant}/invites/{tenant-invite}", + method='PATCH', + resource_path='/api/v1/tenants/{tenant}/invites/{tenant-invite}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -668,25 +620,24 @@ def _tenant_invite_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def webhook_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -721,7 +672,7 @@ async def webhook_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -729,17 +680,18 @@ async def webhook_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerCreated", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerCreated", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -747,22 +699,19 @@ async def webhook_create( response_types_map=_response_types_map, ).data + @validate_call async def webhook_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -797,7 +746,7 @@ async def webhook_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -805,17 +754,18 @@ async def webhook_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerCreated", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerCreated", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -823,22 +773,19 @@ async def webhook_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def webhook_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -873,7 +820,7 @@ async def webhook_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -881,20 +828,22 @@ async def webhook_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerCreated", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerCreated", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _webhook_create_serialize( self, tenant, @@ -907,7 +856,8 @@ def _webhook_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -918,7 +868,7 @@ def _webhook_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -926,27 +876,37 @@ def _webhook_create_serialize( if webhook_worker_create_request is not None: _body_params = webhook_worker_create_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/webhook-workers", + method='POST', + resource_path='/api/v1/tenants/{tenant}/webhook-workers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -956,24 +916,23 @@ def _webhook_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def webhook_delete( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1006,24 +965,25 @@ async def webhook_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1031,21 +991,18 @@ async def webhook_delete( response_types_map=_response_types_map, ).data + @validate_call async def webhook_delete_with_http_info( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1078,24 +1035,25 @@ async def webhook_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1103,21 +1061,18 @@ async def webhook_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def webhook_delete_without_preload_content( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1150,27 +1105,29 @@ async def webhook_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _webhook_delete_serialize( self, webhook, @@ -1182,7 +1139,8 @@ def _webhook_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1193,23 +1151,30 @@ def _webhook_delete_serialize( # process the path parameters if webhook is not None: - _path_params["webhook"] = webhook + _path_params['webhook'] = webhook # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/webhook-workers/{webhook}", + method='DELETE', + resource_path='/api/v1/webhook-workers/{webhook}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1219,24 +1184,23 @@ def _webhook_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def webhook_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1269,24 +1233,25 @@ async def webhook_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1294,21 +1259,18 @@ async def webhook_list( response_types_map=_response_types_map, ).data + @validate_call async def webhook_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1341,24 +1303,25 @@ async def webhook_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1366,21 +1329,18 @@ async def webhook_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def webhook_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1413,27 +1373,29 @@ async def webhook_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _webhook_list_serialize( self, tenant, @@ -1445,7 +1407,8 @@ def _webhook_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1456,23 +1419,30 @@ def _webhook_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/webhook-workers", + method='GET', + resource_path='/api/v1/tenants/{tenant}/webhook-workers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1482,24 +1452,23 @@ def _webhook_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def webhook_requests_list( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1532,24 +1501,25 @@ async def webhook_requests_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerRequestListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerRequestListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1557,21 +1527,18 @@ async def webhook_requests_list( response_types_map=_response_types_map, ).data + @validate_call async def webhook_requests_list_with_http_info( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1604,24 +1571,25 @@ async def webhook_requests_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerRequestListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerRequestListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1629,21 +1597,18 @@ async def webhook_requests_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def webhook_requests_list_without_preload_content( self, - webhook: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The webhook id" - ), - ], + webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1676,27 +1641,29 @@ async def webhook_requests_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WebhookWorkerRequestListResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "WebhookWorkerRequestListResponse", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _webhook_requests_list_serialize( self, webhook, @@ -1708,7 +1675,8 @@ def _webhook_requests_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1719,23 +1687,30 @@ def _webhook_requests_list_serialize( # process the path parameters if webhook is not None: - _path_params["webhook"] = webhook + _path_params['webhook'] = webhook # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/webhook-workers/{webhook}/requests", + method='GET', + resource_path='/api/v1/webhook-workers/{webhook}/requests', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1745,5 +1720,7 @@ def _webhook_requests_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/event_api.py b/hatchet_sdk/clients/rest/api/event_api.py index 6c730fba..0f6e5889 100644 --- a/hatchet_sdk/clients/rest/api/event_api.py +++ b/hatchet_sdk/clients/rest/api/event_api.py @@ -12,24 +12,25 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import ( - EventOrderByDirection, -) +from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -45,24 +46,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def event_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_event_request: Annotated[ - CreateEventRequest, Field(description="The event to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -97,7 +93,7 @@ async def event_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -105,17 +101,18 @@ async def event_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "Event", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -123,24 +120,19 @@ async def event_create( response_types_map=_response_types_map, ).data + @validate_call async def event_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_event_request: Annotated[ - CreateEventRequest, Field(description="The event to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -175,7 +167,7 @@ async def event_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -183,17 +175,18 @@ async def event_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "Event", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -201,24 +194,19 @@ async def event_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def event_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_event_request: Annotated[ - CreateEventRequest, Field(description="The event to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -253,7 +241,7 @@ async def event_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -261,20 +249,22 @@ async def event_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Event", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "Event", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _event_create_serialize( self, tenant, @@ -287,7 +277,8 @@ def _event_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -298,7 +289,7 @@ def _event_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -306,27 +297,37 @@ def _event_create_serialize( if create_event_request is not None: _body_params = create_event_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/events", + method='POST', + resource_path='/api/v1/tenants/{tenant}/events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -336,24 +337,23 @@ def _event_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def event_data_get( self, - event: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The event id" - ), - ], + event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -386,23 +386,24 @@ async def event_data_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_data_get_serialize( event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventData", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -410,21 +411,18 @@ async def event_data_get( response_types_map=_response_types_map, ).data + @validate_call async def event_data_get_with_http_info( self, - event: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The event id" - ), - ], + event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -457,23 +455,24 @@ async def event_data_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_data_get_serialize( event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventData", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -481,21 +480,18 @@ async def event_data_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def event_data_get_without_preload_content( self, - event: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The event id" - ), - ], + event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -528,26 +524,28 @@ async def event_data_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_data_get_serialize( event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventData", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventData", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _event_data_get_serialize( self, event, @@ -559,7 +557,8 @@ def _event_data_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -570,23 +569,30 @@ def _event_data_get_serialize( # process the path parameters if event is not None: - _path_params["event"] = event + _path_params['event'] = event # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/events/{event}/data", + method='GET', + resource_path='/api/v1/events/{event}/data', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -596,24 +602,23 @@ def _event_data_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def event_key_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -646,23 +651,24 @@ async def event_key_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_key_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventKeyList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -670,21 +676,18 @@ async def event_key_list( response_types_map=_response_types_map, ).data + @validate_call async def event_key_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -717,23 +720,24 @@ async def event_key_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_key_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventKeyList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -741,21 +745,18 @@ async def event_key_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def event_key_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -788,26 +789,28 @@ async def event_key_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_key_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventKeyList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventKeyList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _event_key_list_serialize( self, tenant, @@ -819,7 +822,8 @@ def _event_key_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -830,23 +834,30 @@ def _event_key_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/events/keys", + method='GET', + resource_path='/api/v1/tenants/{tenant}/events/keys', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -856,54 +867,32 @@ def _event_key_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def event_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -954,7 +943,7 @@ async def event_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_list_serialize( tenant=tenant, @@ -970,16 +959,17 @@ async def event_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -987,51 +977,27 @@ async def event_list( response_types_map=_response_types_map, ).data + @validate_call async def event_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1082,7 +1048,7 @@ async def event_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_list_serialize( tenant=tenant, @@ -1098,16 +1064,17 @@ async def event_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1115,51 +1082,27 @@ async def event_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def event_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - keys: Annotated[ - Optional[List[StrictStr]], Field(description="A list of keys to filter by") - ] = None, - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[EventOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[EventOrderByDirection], Field(description="The order direction") - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1210,7 +1153,7 @@ async def event_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_list_serialize( tenant=tenant, @@ -1226,19 +1169,21 @@ async def event_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _event_list_serialize( self, tenant, @@ -1260,10 +1205,10 @@ def _event_list_serialize( _host = None _collection_formats: Dict[str, str] = { - "keys": "multi", - "workflows": "multi", - "statuses": "multi", - "additionalMetadata": "multi", + 'keys': 'multi', + 'workflows': 'multi', + 'statuses': 'multi', + 'additionalMetadata': 'multi', } _path_params: Dict[str, str] = {} @@ -1275,59 +1220,66 @@ def _event_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if keys is not None: - - _query_params.append(("keys", keys)) - + + _query_params.append(('keys', keys)) + if workflows is not None: - - _query_params.append(("workflows", workflows)) - + + _query_params.append(('workflows', workflows)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if search is not None: - - _query_params.append(("search", search)) - + + _query_params.append(('search', search)) + if order_by_field is not None: - - _query_params.append(("orderByField", order_by_field.value)) - + + _query_params.append(('orderByField', order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(("orderByDirection", order_by_direction.value)) - + + _query_params.append(('orderByDirection', order_by_direction.value)) + if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - + + _query_params.append(('additionalMetadata', additional_metadata)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/events", + method='GET', + resource_path='/api/v1/tenants/{tenant}/events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1337,27 +1289,24 @@ def _event_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def event_update_replay( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_event_request: Annotated[ - ReplayEventRequest, Field(description="The event ids to replay") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1392,7 +1341,7 @@ async def event_update_replay( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1400,17 +1349,18 @@ async def event_update_replay( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1418,24 +1368,19 @@ async def event_update_replay( response_types_map=_response_types_map, ).data + @validate_call async def event_update_replay_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_event_request: Annotated[ - ReplayEventRequest, Field(description="The event ids to replay") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1470,7 +1415,7 @@ async def event_update_replay_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1478,17 +1423,18 @@ async def event_update_replay_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1496,24 +1442,19 @@ async def event_update_replay_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def event_update_replay_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_event_request: Annotated[ - ReplayEventRequest, Field(description="The event ids to replay") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1548,7 +1489,7 @@ async def event_update_replay_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1556,20 +1497,22 @@ async def event_update_replay_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "EventList", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "EventList", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _event_update_replay_serialize( self, tenant, @@ -1582,7 +1525,8 @@ def _event_update_replay_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1593,7 +1537,7 @@ def _event_update_replay_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -1601,27 +1545,37 @@ def _event_update_replay_serialize( if replay_event_request is not None: _body_params = replay_event_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/events/replay", + method='POST', + resource_path='/api/v1/tenants/{tenant}/events/replay', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1631,5 +1585,7 @@ def _event_update_replay_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/github_api.py b/hatchet_sdk/clients/rest/api/github_api.py index 121441df..05b1aadc 100644 --- a/hatchet_sdk/clients/rest/api/github_api.py +++ b/hatchet_sdk/clients/rest/api/github_api.py @@ -12,9 +12,11 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field from typing_extensions import Annotated from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized @@ -34,27 +36,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def sns_update( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event: Annotated[ - str, - Field( - min_length=1, strict=True, max_length=255, description="The event key" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +83,7 @@ async def sns_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -97,17 +91,18 @@ async def sns_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -115,27 +110,19 @@ async def sns_update( response_types_map=_response_types_map, ).data + @validate_call async def sns_update_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event: Annotated[ - str, - Field( - min_length=1, strict=True, max_length=255, description="The event key" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -170,7 +157,7 @@ async def sns_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -178,17 +165,18 @@ async def sns_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -196,27 +184,19 @@ async def sns_update_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def sns_update_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event: Annotated[ - str, - Field( - min_length=1, strict=True, max_length=255, description="The event key" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -251,7 +231,7 @@ async def sns_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -259,20 +239,22 @@ async def sns_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _sns_update_serialize( self, tenant, @@ -285,7 +267,8 @@ def _sns_update_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -296,25 +279,30 @@ def _sns_update_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if event is not None: - _path_params["event"] = event + _path_params['event'] = event # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/sns/{tenant}/{event}", + method='POST', + resource_path='/api/v1/sns/{tenant}/{event}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -324,5 +312,7 @@ def _sns_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/healthcheck_api.py b/hatchet_sdk/clients/rest/api/healthcheck_api.py index 7eb18a36..67dc9488 100644 --- a/hatchet_sdk/clients/rest/api/healthcheck_api.py +++ b/hatchet_sdk/clients/rest/api/healthcheck_api.py @@ -12,11 +12,11 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated + from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -34,6 +34,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def liveness_get( self, @@ -41,8 +42,9 @@ async def liveness_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -73,21 +75,22 @@ async def liveness_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -95,6 +98,7 @@ async def liveness_get( response_types_map=_response_types_map, ).data + @validate_call async def liveness_get_with_http_info( self, @@ -102,8 +106,9 @@ async def liveness_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -134,21 +139,22 @@ async def liveness_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -156,6 +162,7 @@ async def liveness_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def liveness_get_without_preload_content( self, @@ -163,8 +170,9 @@ async def liveness_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -195,24 +203,26 @@ async def liveness_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _liveness_get_serialize( self, _request_auth, @@ -223,7 +233,8 @@ def _liveness_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -238,12 +249,16 @@ def _liveness_get_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/live", + method='GET', + resource_path='/api/live', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -253,9 +268,12 @@ def _liveness_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def readiness_get( self, @@ -263,8 +281,9 @@ async def readiness_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -295,21 +314,22 @@ async def readiness_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -317,6 +337,7 @@ async def readiness_get( response_types_map=_response_types_map, ).data + @validate_call async def readiness_get_with_http_info( self, @@ -324,8 +345,9 @@ async def readiness_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -356,21 +378,22 @@ async def readiness_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -378,6 +401,7 @@ async def readiness_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def readiness_get_without_preload_content( self, @@ -385,8 +409,9 @@ async def readiness_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -417,24 +442,26 @@ async def readiness_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "500": None, + '200': None, + '500': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _readiness_get_serialize( self, _request_auth, @@ -445,7 +472,8 @@ def _readiness_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -460,12 +488,16 @@ def _readiness_get_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/ready", + method='GET', + resource_path='/api/ready', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -475,5 +507,7 @@ def _readiness_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/log_api.py b/hatchet_sdk/clients/rest/api/log_api.py index dd941af0..9f28aab7 100644 --- a/hatchet_sdk/clients/rest/api/log_api.py +++ b/hatchet_sdk/clients/rest/api/log_api.py @@ -12,19 +12,20 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( - LogLineOrderByDirection, -) +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,40 +41,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def log_line_list( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - levels: Annotated[ - Optional[List[LogLineLevel]], - Field(description="A list of levels to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[LogLineOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[LogLineOrderByDirection], Field(description="The order direction") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -118,7 +103,7 @@ async def log_line_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -131,16 +116,17 @@ async def log_line_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -148,40 +134,24 @@ async def log_line_list( response_types_map=_response_types_map, ).data + @validate_call async def log_line_list_with_http_info( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - levels: Annotated[ - Optional[List[LogLineLevel]], - Field(description="A list of levels to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[LogLineOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[LogLineOrderByDirection], Field(description="The order direction") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -226,7 +196,7 @@ async def log_line_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -239,16 +209,17 @@ async def log_line_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -256,40 +227,24 @@ async def log_line_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def log_line_list_without_preload_content( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - levels: Annotated[ - Optional[List[LogLineLevel]], - Field(description="A list of levels to filter by"), - ] = None, - search: Annotated[ - Optional[StrictStr], Field(description="The search query to filter for") - ] = None, - order_by_field: Annotated[ - Optional[LogLineOrderByField], Field(description="What to order by") - ] = None, - order_by_direction: Annotated[ - Optional[LogLineOrderByDirection], Field(description="The order direction") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -334,7 +289,7 @@ async def log_line_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -347,19 +302,21 @@ async def log_line_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + '200': "LogLineList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _log_line_list_serialize( self, step_run, @@ -378,7 +335,7 @@ def _log_line_list_serialize( _host = None _collection_formats: Dict[str, str] = { - "levels": "multi", + 'levels': 'multi', } _path_params: Dict[str, str] = {} @@ -390,47 +347,54 @@ def _log_line_list_serialize( # process the path parameters if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if levels is not None: - - _query_params.append(("levels", levels)) - + + _query_params.append(('levels', levels)) + if search is not None: - - _query_params.append(("search", search)) - + + _query_params.append(('search', search)) + if order_by_field is not None: - - _query_params.append(("orderByField", order_by_field.value)) - + + _query_params.append(('orderByField', order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(("orderByDirection", order_by_direction.value)) - + + _query_params.append(('orderByDirection', order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/step-runs/{step-run}/logs", + method='GET', + resource_path='/api/v1/step-runs/{step-run}/logs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -440,5 +404,7 @@ def _log_line_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/metadata_api.py b/hatchet_sdk/clients/rest/api/metadata_api.py index 44248e20..10bbf1b8 100644 --- a/hatchet_sdk/clients/rest/api/metadata_api.py +++ b/hatchet_sdk/clients/rest/api/metadata_api.py @@ -12,16 +12,17 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from typing import List from hatchet_sdk.clients.rest.models.api_errors import APIErrors from hatchet_sdk.clients.rest.models.api_meta import APIMeta from hatchet_sdk.clients.rest.models.api_meta_integration import APIMetaIntegration + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -37,6 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def cloud_metadata_get( self, @@ -44,8 +46,9 @@ async def cloud_metadata_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -76,21 +79,22 @@ async def cloud_metadata_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIErrors", - "400": "APIErrors", + '200': "APIErrors", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -98,6 +102,7 @@ async def cloud_metadata_get( response_types_map=_response_types_map, ).data + @validate_call async def cloud_metadata_get_with_http_info( self, @@ -105,8 +110,9 @@ async def cloud_metadata_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -137,21 +143,22 @@ async def cloud_metadata_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIErrors", - "400": "APIErrors", + '200': "APIErrors", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -159,6 +166,7 @@ async def cloud_metadata_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def cloud_metadata_get_without_preload_content( self, @@ -166,8 +174,9 @@ async def cloud_metadata_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -198,24 +207,26 @@ async def cloud_metadata_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIErrors", - "400": "APIErrors", + '200': "APIErrors", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _cloud_metadata_get_serialize( self, _request_auth, @@ -226,7 +237,8 @@ def _cloud_metadata_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -241,17 +253,22 @@ def _cloud_metadata_get_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/cloud/metadata", + method='GET', + resource_path='/api/v1/cloud/metadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -261,9 +278,12 @@ def _cloud_metadata_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def metadata_get( self, @@ -271,8 +291,9 @@ async def metadata_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -303,21 +324,22 @@ async def metadata_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIMeta", - "400": "APIErrors", + '200': "APIMeta", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -325,6 +347,7 @@ async def metadata_get( response_types_map=_response_types_map, ).data + @validate_call async def metadata_get_with_http_info( self, @@ -332,8 +355,9 @@ async def metadata_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -364,21 +388,22 @@ async def metadata_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIMeta", - "400": "APIErrors", + '200': "APIMeta", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -386,6 +411,7 @@ async def metadata_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def metadata_get_without_preload_content( self, @@ -393,8 +419,9 @@ async def metadata_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -425,24 +452,26 @@ async def metadata_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APIMeta", - "400": "APIErrors", + '200': "APIMeta", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _metadata_get_serialize( self, _request_auth, @@ -453,7 +482,8 @@ def _metadata_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -468,17 +498,22 @@ def _metadata_get_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/meta", + method='GET', + resource_path='/api/v1/meta', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -488,9 +523,12 @@ def _metadata_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def metadata_list_integrations( self, @@ -498,8 +536,9 @@ async def metadata_list_integrations( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -530,21 +569,22 @@ async def metadata_list_integrations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[APIMetaIntegration]", - "400": "APIErrors", + '200': "List[APIMetaIntegration]", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -552,6 +592,7 @@ async def metadata_list_integrations( response_types_map=_response_types_map, ).data + @validate_call async def metadata_list_integrations_with_http_info( self, @@ -559,8 +600,9 @@ async def metadata_list_integrations_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -591,21 +633,22 @@ async def metadata_list_integrations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[APIMetaIntegration]", - "400": "APIErrors", + '200': "List[APIMetaIntegration]", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -613,6 +656,7 @@ async def metadata_list_integrations_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def metadata_list_integrations_without_preload_content( self, @@ -620,8 +664,9 @@ async def metadata_list_integrations_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -652,24 +697,26 @@ async def metadata_list_integrations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[APIMetaIntegration]", - "400": "APIErrors", + '200': "List[APIMetaIntegration]", + '400': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _metadata_list_integrations_serialize( self, _request_auth, @@ -680,7 +727,8 @@ def _metadata_list_integrations_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -695,17 +743,24 @@ def _metadata_list_integrations_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/meta/integrations", + method='GET', + resource_path='/api/v1/meta/integrations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -715,5 +770,7 @@ def _metadata_list_integrations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/slack_api.py b/hatchet_sdk/clients/rest/api/slack_api.py index 6a0a0e43..d753a5b0 100644 --- a/hatchet_sdk/clients/rest/api/slack_api.py +++ b/hatchet_sdk/clients/rest/api/slack_api.py @@ -12,14 +12,16 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -35,24 +37,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def slack_webhook_delete( self, - slack: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The Slack webhook id", - ), - ], + slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -85,24 +81,25 @@ async def slack_webhook_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -110,24 +107,18 @@ async def slack_webhook_delete( response_types_map=_response_types_map, ).data + @validate_call async def slack_webhook_delete_with_http_info( self, - slack: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The Slack webhook id", - ), - ], + slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -160,24 +151,25 @@ async def slack_webhook_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -185,24 +177,18 @@ async def slack_webhook_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def slack_webhook_delete_without_preload_content( self, - slack: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The Slack webhook id", - ), - ], + slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -235,27 +221,29 @@ async def slack_webhook_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _slack_webhook_delete_serialize( self, slack, @@ -267,7 +255,8 @@ def _slack_webhook_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -278,23 +267,30 @@ def _slack_webhook_delete_serialize( # process the path parameters if slack is not None: - _path_params["slack"] = slack + _path_params['slack'] = slack # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/slack/{slack}", + method='DELETE', + resource_path='/api/v1/slack/{slack}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -304,24 +300,23 @@ def _slack_webhook_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def slack_webhook_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -354,24 +349,25 @@ async def slack_webhook_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSlackWebhooks", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSlackWebhooks", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -379,21 +375,18 @@ async def slack_webhook_list( response_types_map=_response_types_map, ).data + @validate_call async def slack_webhook_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -426,24 +419,25 @@ async def slack_webhook_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSlackWebhooks", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSlackWebhooks", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -451,21 +445,18 @@ async def slack_webhook_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def slack_webhook_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -498,27 +489,29 @@ async def slack_webhook_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSlackWebhooks", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSlackWebhooks", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _slack_webhook_list_serialize( self, tenant, @@ -530,7 +523,8 @@ def _slack_webhook_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -541,23 +535,30 @@ def _slack_webhook_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/slack", + method='GET', + resource_path='/api/v1/tenants/{tenant}/slack', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -567,5 +568,7 @@ def _slack_webhook_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/sns_api.py b/hatchet_sdk/clients/rest/api/sns_api.py index f3214c03..c9b16e6b 100644 --- a/hatchet_sdk/clients/rest/api/sns_api.py +++ b/hatchet_sdk/clients/rest/api/sns_api.py @@ -12,18 +12,19 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field +from typing import Optional from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest +from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( - CreateSNSIntegrationRequest, -) -from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -39,22 +40,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def sns_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +87,7 @@ async def sns_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -97,17 +95,18 @@ async def sns_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SNSIntegration", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '201': "SNSIntegration", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -115,22 +114,19 @@ async def sns_create( response_types_map=_response_types_map, ).data + @validate_call async def sns_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -165,7 +161,7 @@ async def sns_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -173,17 +169,18 @@ async def sns_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SNSIntegration", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '201': "SNSIntegration", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -191,22 +188,19 @@ async def sns_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def sns_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -241,7 +235,7 @@ async def sns_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -249,20 +243,22 @@ async def sns_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "SNSIntegration", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '201': "SNSIntegration", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _sns_create_serialize( self, tenant, @@ -275,7 +271,8 @@ def _sns_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -286,7 +283,7 @@ def _sns_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -294,27 +291,37 @@ def _sns_create_serialize( if create_sns_integration_request is not None: _body_params = create_sns_integration_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/sns", + method='POST', + resource_path='/api/v1/tenants/{tenant}/sns', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -324,27 +331,23 @@ def _sns_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def sns_delete( self, - sns: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The SNS integration id", - ), - ], + sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -377,24 +380,25 @@ async def sns_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -402,24 +406,18 @@ async def sns_delete( response_types_map=_response_types_map, ).data + @validate_call async def sns_delete_with_http_info( self, - sns: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The SNS integration id", - ), - ], + sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -452,24 +450,25 @@ async def sns_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -477,24 +476,18 @@ async def sns_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def sns_delete_without_preload_content( self, - sns: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The SNS integration id", - ), - ], + sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -527,27 +520,29 @@ async def sns_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '204': None, + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _sns_delete_serialize( self, sns, @@ -559,7 +554,8 @@ def _sns_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -570,23 +566,30 @@ def _sns_delete_serialize( # process the path parameters if sns is not None: - _path_params["sns"] = sns + _path_params['sns'] = sns # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/sns/{sns}", + method='DELETE', + resource_path='/api/v1/sns/{sns}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -596,24 +599,23 @@ def _sns_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def sns_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -646,24 +648,25 @@ async def sns_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSNSIntegrations", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSNSIntegrations", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -671,21 +674,18 @@ async def sns_list( response_types_map=_response_types_map, ).data + @validate_call async def sns_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -718,24 +718,25 @@ async def sns_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSNSIntegrations", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSNSIntegrations", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -743,21 +744,18 @@ async def sns_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def sns_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -790,27 +788,29 @@ async def sns_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSNSIntegrations", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "ListSNSIntegrations", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _sns_list_serialize( self, tenant, @@ -822,7 +822,8 @@ def _sns_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -833,23 +834,30 @@ def _sns_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/sns", + method='GET', + resource_path='/api/v1/tenants/{tenant}/sns', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -859,5 +867,7 @@ def _sns_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/step_run_api.py b/hatchet_sdk/clients/rest/api/step_run_api.py index a52e91fe..4e7e924e 100644 --- a/hatchet_sdk/clients/rest/api/step_run_api.py +++ b/hatchet_sdk/clients/rest/api/step_run_api.py @@ -12,17 +12,20 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field, StrictInt +from typing import Any, Dict, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive_list import StepRunArchiveList from hatchet_sdk.clients.rest.models.step_run_event_list import StepRunEventList + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -38,27 +41,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def step_run_get( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -93,7 +88,7 @@ async def step_run_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -101,17 +96,18 @@ async def step_run_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -119,27 +115,19 @@ async def step_run_get( response_types_map=_response_types_map, ).data + @validate_call async def step_run_get_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -174,7 +162,7 @@ async def step_run_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -182,17 +170,18 @@ async def step_run_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -200,27 +189,19 @@ async def step_run_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_get_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -255,7 +236,7 @@ async def step_run_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -263,20 +244,22 @@ async def step_run_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_get_serialize( self, tenant, @@ -289,7 +272,8 @@ def _step_run_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -300,25 +284,32 @@ def _step_run_get_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}", + method='GET', + resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -328,30 +319,24 @@ def _step_run_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def step_run_get_schema( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -386,7 +371,7 @@ async def step_run_get_schema( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -394,17 +379,18 @@ async def step_run_get_schema( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "object", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -412,27 +398,19 @@ async def step_run_get_schema( response_types_map=_response_types_map, ).data + @validate_call async def step_run_get_schema_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -467,7 +445,7 @@ async def step_run_get_schema_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -475,17 +453,18 @@ async def step_run_get_schema_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "object", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -493,27 +472,19 @@ async def step_run_get_schema_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_get_schema_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -548,7 +519,7 @@ async def step_run_get_schema_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -556,20 +527,22 @@ async def step_run_get_schema_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "object", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_get_schema_serialize( self, tenant, @@ -582,7 +555,8 @@ def _step_run_get_schema_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -593,25 +567,32 @@ def _step_run_get_schema_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/schema", + method='GET', + resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/schema', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -621,30 +602,25 @@ def _step_run_get_schema_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def step_run_list_archives( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -681,7 +657,7 @@ async def step_run_list_archives( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -690,17 +666,18 @@ async def step_run_list_archives( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunArchiveList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunArchiveList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -708,27 +685,20 @@ async def step_run_list_archives( response_types_map=_response_types_map, ).data + @validate_call async def step_run_list_archives_with_http_info( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -765,7 +735,7 @@ async def step_run_list_archives_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -774,17 +744,18 @@ async def step_run_list_archives_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunArchiveList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunArchiveList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -792,27 +763,20 @@ async def step_run_list_archives_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_list_archives_without_preload_content( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -849,7 +813,7 @@ async def step_run_list_archives_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -858,20 +822,22 @@ async def step_run_list_archives_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunArchiveList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunArchiveList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_list_archives_serialize( self, step_run, @@ -885,7 +851,8 @@ def _step_run_list_archives_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -896,31 +863,38 @@ def _step_run_list_archives_serialize( # process the path parameters if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/step-runs/{step-run}/archives", + method='GET', + resource_path='/api/v1/step-runs/{step-run}/archives', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -930,30 +904,25 @@ def _step_run_list_archives_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def step_run_list_events( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -990,7 +959,7 @@ async def step_run_list_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -999,17 +968,18 @@ async def step_run_list_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunEventList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1017,27 +987,20 @@ async def step_run_list_events( response_types_map=_response_types_map, ).data + @validate_call async def step_run_list_events_with_http_info( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1074,7 +1037,7 @@ async def step_run_list_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -1083,17 +1046,18 @@ async def step_run_list_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunEventList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1101,27 +1065,20 @@ async def step_run_list_events_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_list_events_without_preload_content( self, - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1158,7 +1115,7 @@ async def step_run_list_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -1167,20 +1124,22 @@ async def step_run_list_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRunEventList", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "StepRunEventList", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_list_events_serialize( self, step_run, @@ -1194,7 +1153,8 @@ def _step_run_list_events_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1205,31 +1165,38 @@ def _step_run_list_events_serialize( # process the path parameters if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/step-runs/{step-run}/events", + method='GET', + resource_path='/api/v1/step-runs/{step-run}/events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1239,30 +1206,24 @@ def _step_run_list_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def step_run_update_cancel( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1297,7 +1258,7 @@ async def step_run_update_cancel( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1305,16 +1266,17 @@ async def step_run_update_cancel( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1322,27 +1284,19 @@ async def step_run_update_cancel( response_types_map=_response_types_map, ).data + @validate_call async def step_run_update_cancel_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1377,7 +1331,7 @@ async def step_run_update_cancel_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1385,16 +1339,17 @@ async def step_run_update_cancel_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1402,27 +1357,19 @@ async def step_run_update_cancel_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_update_cancel_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1457,7 +1404,7 @@ async def step_run_update_cancel_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1465,19 +1412,21 @@ async def step_run_update_cancel_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_update_cancel_serialize( self, tenant, @@ -1490,7 +1439,8 @@ def _step_run_update_cancel_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1501,25 +1451,32 @@ def _step_run_update_cancel_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel", + method='POST', + resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1529,33 +1486,25 @@ def _step_run_update_cancel_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def step_run_update_rerun( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - rerun_step_run_request: Annotated[ - RerunStepRunRequest, Field(description="The input to the rerun") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1592,7 +1541,7 @@ async def step_run_update_rerun( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1601,16 +1550,17 @@ async def step_run_update_rerun( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1618,30 +1568,20 @@ async def step_run_update_rerun( response_types_map=_response_types_map, ).data + @validate_call async def step_run_update_rerun_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - rerun_step_run_request: Annotated[ - RerunStepRunRequest, Field(description="The input to the rerun") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1678,7 +1618,7 @@ async def step_run_update_rerun_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1687,16 +1627,17 @@ async def step_run_update_rerun_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1704,30 +1645,20 @@ async def step_run_update_rerun_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def step_run_update_rerun_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - step_run: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The step run id" - ), - ], - rerun_step_run_request: Annotated[ - RerunStepRunRequest, Field(description="The input to the rerun") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1764,7 +1695,7 @@ async def step_run_update_rerun_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1773,19 +1704,21 @@ async def step_run_update_rerun_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "StepRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "StepRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _step_run_update_rerun_serialize( self, tenant, @@ -1799,7 +1732,8 @@ def _step_run_update_rerun_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1810,9 +1744,9 @@ def _step_run_update_rerun_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if step_run is not None: - _path_params["step-run"] = step_run + _path_params['step-run'] = step_run # process the query parameters # process the header parameters # process the form parameters @@ -1820,27 +1754,37 @@ def _step_run_update_rerun_serialize( if rerun_step_run_request is not None: _body_params = rerun_step_run_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/rerun", + method='POST', + resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/rerun', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1850,5 +1794,7 @@ def _step_run_update_rerun_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/tenant_api.py b/hatchet_sdk/clients/rest/api/tenant_api.py index 5c6a8490..03eb4d0b 100644 --- a/hatchet_sdk/clients/rest/api/tenant_api.py +++ b/hatchet_sdk/clients/rest/api/tenant_api.py @@ -12,41 +12,32 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( - CreateTenantAlertEmailGroupRequest, -) -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( - CreateTenantInviteRequest, -) +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( - TenantAlertEmailGroup, -) -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( - TenantAlertEmailGroupList, -) -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( - TenantAlertingSettings, -) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_member import TenantMember from hatchet_sdk.clients.rest.models.tenant_member_list import TenantMemberList from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( - UpdateTenantAlertEmailGroupRequest, -) +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -62,25 +53,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def alert_email_group_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_alert_email_group_request: Annotated[ - CreateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to create"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -115,7 +100,7 @@ async def alert_email_group_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -123,16 +108,17 @@ async def alert_email_group_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '201': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -140,25 +126,19 @@ async def alert_email_group_create( response_types_map=_response_types_map, ).data + @validate_call async def alert_email_group_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_alert_email_group_request: Annotated[ - CreateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to create"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -193,7 +173,7 @@ async def alert_email_group_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -201,16 +181,17 @@ async def alert_email_group_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '201': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -218,25 +199,19 @@ async def alert_email_group_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def alert_email_group_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_alert_email_group_request: Annotated[ - CreateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to create"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -271,7 +246,7 @@ async def alert_email_group_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -279,19 +254,21 @@ async def alert_email_group_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '201': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _alert_email_group_create_serialize( self, tenant, @@ -304,7 +281,8 @@ def _alert_email_group_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -315,7 +293,7 @@ def _alert_email_group_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -323,27 +301,37 @@ def _alert_email_group_create_serialize( if create_tenant_alert_email_group_request is not None: _body_params = create_tenant_alert_email_group_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/alerting-email-groups", + method='POST', + resource_path='/api/v1/tenants/{tenant}/alerting-email-groups', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -353,27 +341,23 @@ def _alert_email_group_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def alert_email_group_delete( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -406,23 +390,24 @@ async def alert_email_group_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIError", + '204': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -430,24 +415,18 @@ async def alert_email_group_delete( response_types_map=_response_types_map, ).data + @validate_call async def alert_email_group_delete_with_http_info( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -480,23 +459,24 @@ async def alert_email_group_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIError", + '204': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -504,24 +484,18 @@ async def alert_email_group_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def alert_email_group_delete_without_preload_content( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -554,26 +528,28 @@ async def alert_email_group_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIError", + '204': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _alert_email_group_delete_serialize( self, alert_email_group, @@ -585,7 +561,8 @@ def _alert_email_group_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -596,23 +573,30 @@ def _alert_email_group_delete_serialize( # process the path parameters if alert_email_group is not None: - _path_params["alert-email-group"] = alert_email_group + _path_params['alert-email-group'] = alert_email_group # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/alerting-email-groups/{alert-email-group}", + method='DELETE', + resource_path='/api/v1/alerting-email-groups/{alert-email-group}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -622,24 +606,23 @@ def _alert_email_group_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def alert_email_group_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -672,23 +655,24 @@ async def alert_email_group_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroupList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroupList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -696,21 +680,18 @@ async def alert_email_group_list( response_types_map=_response_types_map, ).data + @validate_call async def alert_email_group_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -743,23 +724,24 @@ async def alert_email_group_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroupList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroupList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -767,21 +749,18 @@ async def alert_email_group_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def alert_email_group_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -814,26 +793,28 @@ async def alert_email_group_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroupList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroupList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _alert_email_group_list_serialize( self, tenant, @@ -845,7 +826,8 @@ def _alert_email_group_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -856,23 +838,30 @@ def _alert_email_group_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/alerting-email-groups", + method='GET', + resource_path='/api/v1/tenants/{tenant}/alerting-email-groups', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -882,31 +871,24 @@ def _alert_email_group_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def alert_email_group_update( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], - update_tenant_alert_email_group_request: Annotated[ - UpdateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to update"), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -941,7 +923,7 @@ async def alert_email_group_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -949,16 +931,17 @@ async def alert_email_group_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -966,28 +949,19 @@ async def alert_email_group_update( response_types_map=_response_types_map, ).data + @validate_call async def alert_email_group_update_with_http_info( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], - update_tenant_alert_email_group_request: Annotated[ - UpdateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to update"), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1022,7 +996,7 @@ async def alert_email_group_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -1030,16 +1004,17 @@ async def alert_email_group_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1047,28 +1022,19 @@ async def alert_email_group_update_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def alert_email_group_update_without_preload_content( self, - alert_email_group: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant alert email group id", - ), - ], - update_tenant_alert_email_group_request: Annotated[ - UpdateTenantAlertEmailGroupRequest, - Field(description="The tenant alert email group to update"), - ], + alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1103,7 +1069,7 @@ async def alert_email_group_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -1111,19 +1077,21 @@ async def alert_email_group_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertEmailGroup", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertEmailGroup", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _alert_email_group_update_serialize( self, alert_email_group, @@ -1136,7 +1104,8 @@ def _alert_email_group_update_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1147,7 +1116,7 @@ def _alert_email_group_update_serialize( # process the path parameters if alert_email_group is not None: - _path_params["alert-email-group"] = alert_email_group + _path_params['alert-email-group'] = alert_email_group # process the query parameters # process the header parameters # process the form parameters @@ -1155,27 +1124,37 @@ def _alert_email_group_update_serialize( if update_tenant_alert_email_group_request is not None: _body_params = update_tenant_alert_email_group_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/alerting-email-groups/{alert-email-group}", + method='PATCH', + resource_path='/api/v1/alerting-email-groups/{alert-email-group}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1185,24 +1164,23 @@ def _alert_email_group_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_alerting_settings_get( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1235,23 +1213,24 @@ async def tenant_alerting_settings_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertingSettings", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertingSettings", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1259,21 +1238,18 @@ async def tenant_alerting_settings_get( response_types_map=_response_types_map, ).data + @validate_call async def tenant_alerting_settings_get_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1306,23 +1282,24 @@ async def tenant_alerting_settings_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertingSettings", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertingSettings", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1330,21 +1307,18 @@ async def tenant_alerting_settings_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_alerting_settings_get_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1377,26 +1351,28 @@ async def tenant_alerting_settings_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantAlertingSettings", - "400": "APIErrors", - "403": "APIError", + '200': "TenantAlertingSettings", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_alerting_settings_get_serialize( self, tenant, @@ -1408,7 +1384,8 @@ def _tenant_alerting_settings_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1419,23 +1396,30 @@ def _tenant_alerting_settings_get_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/alerting/settings", + method='GET', + resource_path='/api/v1/tenants/{tenant}/alerting/settings', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1445,21 +1429,23 @@ def _tenant_alerting_settings_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_create( self, - create_tenant_request: Annotated[ - CreateTenantRequest, Field(description="The tenant to create") - ], + create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1492,23 +1478,24 @@ async def tenant_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1516,18 +1503,18 @@ async def tenant_create( response_types_map=_response_types_map, ).data + @validate_call async def tenant_create_with_http_info( self, - create_tenant_request: Annotated[ - CreateTenantRequest, Field(description="The tenant to create") - ], + create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1560,23 +1547,24 @@ async def tenant_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1584,18 +1572,18 @@ async def tenant_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_create_without_preload_content( self, - create_tenant_request: Annotated[ - CreateTenantRequest, Field(description="The tenant to create") - ], + create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1628,26 +1616,28 @@ async def tenant_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_create_serialize( self, create_tenant_request, @@ -1659,7 +1649,8 @@ def _tenant_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1676,27 +1667,37 @@ def _tenant_create_serialize( if create_tenant_request is not None: _body_params = create_tenant_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants", + method='POST', + resource_path='/api/v1/tenants', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1706,9 +1707,12 @@ def _tenant_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_invite_accept( self, @@ -1717,8 +1721,9 @@ async def tenant_invite_accept( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1751,23 +1756,24 @@ async def tenant_invite_accept( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1775,6 +1781,7 @@ async def tenant_invite_accept( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_accept_with_http_info( self, @@ -1783,8 +1790,9 @@ async def tenant_invite_accept_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1817,23 +1825,24 @@ async def tenant_invite_accept_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1841,6 +1850,7 @@ async def tenant_invite_accept_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_accept_without_preload_content( self, @@ -1849,8 +1859,9 @@ async def tenant_invite_accept_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1883,26 +1894,28 @@ async def tenant_invite_accept_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_accept_serialize( self, accept_invite_request, @@ -1914,7 +1927,8 @@ def _tenant_invite_accept_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1931,27 +1945,37 @@ def _tenant_invite_accept_serialize( if accept_invite_request is not None: _body_params = accept_invite_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/invites/accept", + method='POST', + resource_path='/api/v1/users/invites/accept', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1961,27 +1985,24 @@ def _tenant_invite_accept_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_invite_create( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_invite_request: Annotated[ - CreateTenantInviteRequest, Field(description="The tenant invite to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2016,7 +2037,7 @@ async def tenant_invite_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2024,16 +2045,17 @@ async def tenant_invite_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantInvite", - "400": "APIErrors", - "403": "APIError", + '201': "TenantInvite", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2041,24 +2063,19 @@ async def tenant_invite_create( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_create_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_invite_request: Annotated[ - CreateTenantInviteRequest, Field(description="The tenant invite to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2093,7 +2110,7 @@ async def tenant_invite_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2101,16 +2118,17 @@ async def tenant_invite_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantInvite", - "400": "APIErrors", - "403": "APIError", + '201': "TenantInvite", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2118,24 +2136,19 @@ async def tenant_invite_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_create_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - create_tenant_invite_request: Annotated[ - CreateTenantInviteRequest, Field(description="The tenant invite to create") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2170,7 +2183,7 @@ async def tenant_invite_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2178,19 +2191,21 @@ async def tenant_invite_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "201": "TenantInvite", - "400": "APIErrors", - "403": "APIError", + '201': "TenantInvite", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_create_serialize( self, tenant, @@ -2203,7 +2218,8 @@ def _tenant_invite_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2214,7 +2230,7 @@ def _tenant_invite_create_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -2222,27 +2238,37 @@ def _tenant_invite_create_serialize( if create_tenant_invite_request is not None: _body_params = create_tenant_invite_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/invites", + method='POST', + resource_path='/api/v1/tenants/{tenant}/invites', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2252,24 +2278,23 @@ def _tenant_invite_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_invite_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2302,23 +2327,24 @@ async def tenant_invite_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2326,21 +2352,18 @@ async def tenant_invite_list( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2373,23 +2396,24 @@ async def tenant_invite_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2397,21 +2421,18 @@ async def tenant_invite_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2444,26 +2465,28 @@ async def tenant_invite_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_list_serialize( self, tenant, @@ -2475,7 +2498,8 @@ def _tenant_invite_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2486,23 +2510,30 @@ def _tenant_invite_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/invites", + method='GET', + resource_path='/api/v1/tenants/{tenant}/invites', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2512,9 +2543,12 @@ def _tenant_invite_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_invite_reject( self, @@ -2523,8 +2557,9 @@ async def tenant_invite_reject( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2557,23 +2592,24 @@ async def tenant_invite_reject( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2581,6 +2617,7 @@ async def tenant_invite_reject( response_types_map=_response_types_map, ).data + @validate_call async def tenant_invite_reject_with_http_info( self, @@ -2589,8 +2626,9 @@ async def tenant_invite_reject_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2623,23 +2661,24 @@ async def tenant_invite_reject_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2647,6 +2686,7 @@ async def tenant_invite_reject_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_invite_reject_without_preload_content( self, @@ -2655,8 +2695,9 @@ async def tenant_invite_reject_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2689,26 +2730,28 @@ async def tenant_invite_reject_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "APIErrors", - "403": "APIError", + '200': None, + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_invite_reject_serialize( self, reject_invite_request, @@ -2720,7 +2763,8 @@ def _tenant_invite_reject_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2737,27 +2781,37 @@ def _tenant_invite_reject_serialize( if reject_invite_request is not None: _body_params = reject_invite_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/invites/reject", + method='POST', + resource_path='/api/v1/users/invites/reject', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2767,33 +2821,24 @@ def _tenant_invite_reject_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_member_delete( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - member: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant member id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2828,7 +2873,7 @@ async def tenant_member_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -2836,17 +2881,18 @@ async def tenant_member_delete( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": "TenantMember", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': "TenantMember", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2854,30 +2900,19 @@ async def tenant_member_delete( response_types_map=_response_types_map, ).data + @validate_call async def tenant_member_delete_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - member: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant member id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2912,7 +2947,7 @@ async def tenant_member_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -2920,17 +2955,18 @@ async def tenant_member_delete_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": "TenantMember", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': "TenantMember", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2938,30 +2974,19 @@ async def tenant_member_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_member_delete_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - member: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The tenant member id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2996,7 +3021,7 @@ async def tenant_member_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -3004,20 +3029,22 @@ async def tenant_member_delete_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": "TenantMember", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': "TenantMember", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_member_delete_serialize( self, tenant, @@ -3030,7 +3057,8 @@ def _tenant_member_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3041,25 +3069,32 @@ def _tenant_member_delete_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if member is not None: - _path_params["member"] = member + _path_params['member'] = member # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/tenants/{tenant}/members/{member}", + method='DELETE', + resource_path='/api/v1/tenants/{tenant}/members/{member}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3069,24 +3104,23 @@ def _tenant_member_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_member_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3119,23 +3153,24 @@ async def tenant_member_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantMemberList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantMemberList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3143,21 +3178,18 @@ async def tenant_member_list( response_types_map=_response_types_map, ).data + @validate_call async def tenant_member_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3190,23 +3222,24 @@ async def tenant_member_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantMemberList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantMemberList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3214,21 +3247,18 @@ async def tenant_member_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_member_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3261,26 +3291,28 @@ async def tenant_member_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantMemberList", - "400": "APIErrors", - "403": "APIError", + '200': "TenantMemberList", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_member_list_serialize( self, tenant, @@ -3292,7 +3324,8 @@ def _tenant_member_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3303,23 +3336,30 @@ def _tenant_member_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/members", + method='GET', + resource_path='/api/v1/tenants/{tenant}/members', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3329,24 +3369,23 @@ def _tenant_member_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_resource_policy_get( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3379,23 +3418,24 @@ async def tenant_resource_policy_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantResourcePolicy", - "400": "APIErrors", - "403": "APIError", + '200': "TenantResourcePolicy", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3403,21 +3443,18 @@ async def tenant_resource_policy_get( response_types_map=_response_types_map, ).data + @validate_call async def tenant_resource_policy_get_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3450,23 +3487,24 @@ async def tenant_resource_policy_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantResourcePolicy", - "400": "APIErrors", - "403": "APIError", + '200': "TenantResourcePolicy", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3474,21 +3512,18 @@ async def tenant_resource_policy_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_resource_policy_get_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3521,26 +3556,28 @@ async def tenant_resource_policy_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantResourcePolicy", - "400": "APIErrors", - "403": "APIError", + '200': "TenantResourcePolicy", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_resource_policy_get_serialize( self, tenant, @@ -3552,7 +3589,8 @@ def _tenant_resource_policy_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3563,23 +3601,30 @@ def _tenant_resource_policy_get_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/resource-policy", + method='GET', + resource_path='/api/v1/tenants/{tenant}/resource-policy', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3589,27 +3634,24 @@ def _tenant_resource_policy_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def tenant_update( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - update_tenant_request: Annotated[ - UpdateTenantRequest, Field(description="The tenant properties to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3644,7 +3686,7 @@ async def tenant_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3652,16 +3694,17 @@ async def tenant_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3669,24 +3712,19 @@ async def tenant_update( response_types_map=_response_types_map, ).data + @validate_call async def tenant_update_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - update_tenant_request: Annotated[ - UpdateTenantRequest, Field(description="The tenant properties to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3721,7 +3759,7 @@ async def tenant_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3729,16 +3767,17 @@ async def tenant_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3746,24 +3785,19 @@ async def tenant_update_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_update_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - update_tenant_request: Annotated[ - UpdateTenantRequest, Field(description="The tenant properties to update") - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3798,7 +3832,7 @@ async def tenant_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3806,19 +3840,21 @@ async def tenant_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Tenant", - "400": "APIErrors", - "403": "APIError", + '200': "Tenant", + '400': "APIErrors", + '403': "APIError", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_update_serialize( self, tenant, @@ -3831,7 +3867,8 @@ def _tenant_update_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3842,7 +3879,7 @@ def _tenant_update_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -3850,27 +3887,37 @@ def _tenant_update_serialize( if update_tenant_request is not None: _body_params = update_tenant_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/tenants/{tenant}", + method='PATCH', + resource_path='/api/v1/tenants/{tenant}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3880,9 +3927,12 @@ def _tenant_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_list_tenant_invites( self, @@ -3890,8 +3940,9 @@ async def user_list_tenant_invites( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3922,22 +3973,23 @@ async def user_list_tenant_invites( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIErrors", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3945,6 +3997,7 @@ async def user_list_tenant_invites( response_types_map=_response_types_map, ).data + @validate_call async def user_list_tenant_invites_with_http_info( self, @@ -3952,8 +4005,9 @@ async def user_list_tenant_invites_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3984,22 +4038,23 @@ async def user_list_tenant_invites_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIErrors", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -4007,6 +4062,7 @@ async def user_list_tenant_invites_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_list_tenant_invites_without_preload_content( self, @@ -4014,8 +4070,9 @@ async def user_list_tenant_invites_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4046,25 +4103,27 @@ async def user_list_tenant_invites_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantInviteList", - "400": "APIErrors", - "403": "APIErrors", + '200': "TenantInviteList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_list_tenant_invites_serialize( self, _request_auth, @@ -4075,7 +4134,8 @@ def _user_list_tenant_invites_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4090,17 +4150,23 @@ def _user_list_tenant_invites_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/invites", + method='GET', + resource_path='/api/v1/users/invites', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4110,5 +4176,7 @@ def _user_list_tenant_invites_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/user_api.py b/hatchet_sdk/clients/rest/api/user_api.py index a0617fd3..d1b57adc 100644 --- a/hatchet_sdk/clients/rest/api/user_api.py +++ b/hatchet_sdk/clients/rest/api/user_api.py @@ -12,22 +12,21 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import ( - UserChangePasswordRequest, -) +from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( - UserTenantMembershipsList, -) +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -43,6 +42,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def tenant_memberships_list( self, @@ -50,8 +50,9 @@ async def tenant_memberships_list( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -82,22 +83,23 @@ async def tenant_memberships_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserTenantMembershipsList", - "400": "APIErrors", - "403": "APIErrors", + '200': "UserTenantMembershipsList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -105,6 +107,7 @@ async def tenant_memberships_list( response_types_map=_response_types_map, ).data + @validate_call async def tenant_memberships_list_with_http_info( self, @@ -112,8 +115,9 @@ async def tenant_memberships_list_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -144,22 +148,23 @@ async def tenant_memberships_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserTenantMembershipsList", - "400": "APIErrors", - "403": "APIErrors", + '200': "UserTenantMembershipsList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -167,6 +172,7 @@ async def tenant_memberships_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_memberships_list_without_preload_content( self, @@ -174,8 +180,9 @@ async def tenant_memberships_list_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -206,25 +213,27 @@ async def tenant_memberships_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UserTenantMembershipsList", - "400": "APIErrors", - "403": "APIErrors", + '200': "UserTenantMembershipsList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_memberships_list_serialize( self, _request_auth, @@ -235,7 +244,8 @@ def _tenant_memberships_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -250,17 +260,23 @@ def _tenant_memberships_list_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/memberships", + method='GET', + resource_path='/api/v1/users/memberships', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -270,9 +286,12 @@ def _tenant_memberships_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_create( self, @@ -281,8 +300,9 @@ async def user_create( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -315,24 +335,25 @@ async def user_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -340,6 +361,7 @@ async def user_create( response_types_map=_response_types_map, ).data + @validate_call async def user_create_with_http_info( self, @@ -348,8 +370,9 @@ async def user_create_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -382,24 +405,25 @@ async def user_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -407,6 +431,7 @@ async def user_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_create_without_preload_content( self, @@ -415,8 +440,9 @@ async def user_create_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -449,27 +475,29 @@ async def user_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_create_serialize( self, user_register_request, @@ -481,7 +509,8 @@ def _user_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -498,27 +527,35 @@ def _user_create_serialize( if user_register_request is not None: _body_params = user_register_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/register", + method='POST', + resource_path='/api/v1/users/register', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -528,9 +565,12 @@ def _user_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_get_current( self, @@ -538,8 +578,9 @@ async def user_get_current( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -570,23 +611,24 @@ async def user_get_current( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -594,6 +636,7 @@ async def user_get_current( response_types_map=_response_types_map, ).data + @validate_call async def user_get_current_with_http_info( self, @@ -601,8 +644,9 @@ async def user_get_current_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -633,23 +677,24 @@ async def user_get_current_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -657,6 +702,7 @@ async def user_get_current_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_get_current_without_preload_content( self, @@ -664,8 +710,9 @@ async def user_get_current_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -696,26 +743,28 @@ async def user_get_current_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_get_current_serialize( self, _request_auth, @@ -726,7 +775,8 @@ def _user_get_current_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -741,17 +791,23 @@ def _user_get_current_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/current", + method='GET', + resource_path='/api/v1/users/current', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -761,9 +817,12 @@ def _user_get_current_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_github_oauth_callback( self, @@ -771,8 +830,9 @@ async def user_update_github_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -803,20 +863,21 @@ async def user_update_github_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -824,6 +885,7 @@ async def user_update_github_oauth_callback( response_types_map=_response_types_map, ).data + @validate_call async def user_update_github_oauth_callback_with_http_info( self, @@ -831,8 +893,9 @@ async def user_update_github_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -863,20 +926,21 @@ async def user_update_github_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -884,6 +948,7 @@ async def user_update_github_oauth_callback_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_github_oauth_callback_without_preload_content( self, @@ -891,8 +956,9 @@ async def user_update_github_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -923,23 +989,25 @@ async def user_update_github_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_github_oauth_callback_serialize( self, _request_auth, @@ -950,7 +1018,8 @@ def _user_update_github_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -965,12 +1034,16 @@ def _user_update_github_oauth_callback_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/github/callback", + method='GET', + resource_path='/api/v1/users/github/callback', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -980,9 +1053,12 @@ def _user_update_github_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_github_oauth_start( self, @@ -990,8 +1066,9 @@ async def user_update_github_oauth_start( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1022,20 +1099,21 @@ async def user_update_github_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1043,6 +1121,7 @@ async def user_update_github_oauth_start( response_types_map=_response_types_map, ).data + @validate_call async def user_update_github_oauth_start_with_http_info( self, @@ -1050,8 +1129,9 @@ async def user_update_github_oauth_start_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1082,20 +1162,21 @@ async def user_update_github_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1103,6 +1184,7 @@ async def user_update_github_oauth_start_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_github_oauth_start_without_preload_content( self, @@ -1110,8 +1192,9 @@ async def user_update_github_oauth_start_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1142,23 +1225,25 @@ async def user_update_github_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_github_oauth_start_serialize( self, _request_auth, @@ -1169,7 +1254,8 @@ def _user_update_github_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1184,12 +1270,16 @@ def _user_update_github_oauth_start_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/github/start", + method='GET', + resource_path='/api/v1/users/github/start', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1199,9 +1289,12 @@ def _user_update_github_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_google_oauth_callback( self, @@ -1209,8 +1302,9 @@ async def user_update_google_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1241,20 +1335,21 @@ async def user_update_google_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1262,6 +1357,7 @@ async def user_update_google_oauth_callback( response_types_map=_response_types_map, ).data + @validate_call async def user_update_google_oauth_callback_with_http_info( self, @@ -1269,8 +1365,9 @@ async def user_update_google_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1301,20 +1398,21 @@ async def user_update_google_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1322,6 +1420,7 @@ async def user_update_google_oauth_callback_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_google_oauth_callback_without_preload_content( self, @@ -1329,8 +1428,9 @@ async def user_update_google_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1361,23 +1461,25 @@ async def user_update_google_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_google_oauth_callback_serialize( self, _request_auth, @@ -1388,7 +1490,8 @@ def _user_update_google_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1403,12 +1506,16 @@ def _user_update_google_oauth_callback_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/google/callback", + method='GET', + resource_path='/api/v1/users/google/callback', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1418,9 +1525,12 @@ def _user_update_google_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_google_oauth_start( self, @@ -1428,8 +1538,9 @@ async def user_update_google_oauth_start( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1460,20 +1571,21 @@ async def user_update_google_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1481,6 +1593,7 @@ async def user_update_google_oauth_start( response_types_map=_response_types_map, ).data + @validate_call async def user_update_google_oauth_start_with_http_info( self, @@ -1488,8 +1601,9 @@ async def user_update_google_oauth_start_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1520,20 +1634,21 @@ async def user_update_google_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1541,6 +1656,7 @@ async def user_update_google_oauth_start_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_google_oauth_start_without_preload_content( self, @@ -1548,8 +1664,9 @@ async def user_update_google_oauth_start_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1580,23 +1697,25 @@ async def user_update_google_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_google_oauth_start_serialize( self, _request_auth, @@ -1607,7 +1726,8 @@ def _user_update_google_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1622,12 +1742,16 @@ def _user_update_google_oauth_start_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/google/start", + method='GET', + resource_path='/api/v1/users/google/start', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1637,9 +1761,12 @@ def _user_update_google_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_login( self, @@ -1648,8 +1775,9 @@ async def user_update_login( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1682,24 +1810,25 @@ async def user_update_login( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1707,6 +1836,7 @@ async def user_update_login( response_types_map=_response_types_map, ).data + @validate_call async def user_update_login_with_http_info( self, @@ -1715,8 +1845,9 @@ async def user_update_login_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1749,24 +1880,25 @@ async def user_update_login_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1774,6 +1906,7 @@ async def user_update_login_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_login_without_preload_content( self, @@ -1782,8 +1915,9 @@ async def user_update_login_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1816,27 +1950,29 @@ async def user_update_login_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_login_serialize( self, user_login_request, @@ -1848,7 +1984,8 @@ def _user_update_login_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1865,27 +2002,35 @@ def _user_update_login_serialize( if user_login_request is not None: _body_params = user_login_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = [] + _auth_settings: List[str] = [ + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/login", + method='POST', + resource_path='/api/v1/users/login', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1895,9 +2040,12 @@ def _user_update_login_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_logout( self, @@ -1905,8 +2053,9 @@ async def user_update_logout( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1937,23 +2086,24 @@ async def user_update_logout( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1961,6 +2111,7 @@ async def user_update_logout( response_types_map=_response_types_map, ).data + @validate_call async def user_update_logout_with_http_info( self, @@ -1968,8 +2119,9 @@ async def user_update_logout_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2000,23 +2152,24 @@ async def user_update_logout_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2024,6 +2177,7 @@ async def user_update_logout_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_logout_without_preload_content( self, @@ -2031,8 +2185,9 @@ async def user_update_logout_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2063,26 +2218,28 @@ async def user_update_logout_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_logout_serialize( self, _request_auth, @@ -2093,7 +2250,8 @@ def _user_update_logout_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2108,17 +2266,23 @@ def _user_update_logout_serialize( # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/logout", + method='POST', + resource_path='/api/v1/users/logout', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2128,9 +2292,12 @@ def _user_update_logout_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_password( self, @@ -2139,8 +2306,9 @@ async def user_update_password( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2173,24 +2341,25 @@ async def user_update_password( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2198,6 +2367,7 @@ async def user_update_password( response_types_map=_response_types_map, ).data + @validate_call async def user_update_password_with_http_info( self, @@ -2206,8 +2376,9 @@ async def user_update_password_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2240,24 +2411,25 @@ async def user_update_password_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2265,6 +2437,7 @@ async def user_update_password_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_password_without_preload_content( self, @@ -2273,8 +2446,9 @@ async def user_update_password_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2307,27 +2481,29 @@ async def user_update_password_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + '200': "User", + '400': "APIErrors", + '401': "APIErrors", + '405': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_password_serialize( self, user_change_password_request, @@ -2339,7 +2515,8 @@ def _user_update_password_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2356,27 +2533,36 @@ def _user_update_password_serialize( if user_change_password_request is not None: _body_params = user_change_password_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/users/password", + method='POST', + resource_path='/api/v1/users/password', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2386,9 +2572,12 @@ def _user_update_password_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_slack_oauth_callback( self, @@ -2396,8 +2585,9 @@ async def user_update_slack_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2428,20 +2618,21 @@ async def user_update_slack_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2449,6 +2640,7 @@ async def user_update_slack_oauth_callback( response_types_map=_response_types_map, ).data + @validate_call async def user_update_slack_oauth_callback_with_http_info( self, @@ -2456,8 +2648,9 @@ async def user_update_slack_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2488,20 +2681,21 @@ async def user_update_slack_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2509,6 +2703,7 @@ async def user_update_slack_oauth_callback_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_slack_oauth_callback_without_preload_content( self, @@ -2516,8 +2711,9 @@ async def user_update_slack_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2548,23 +2744,25 @@ async def user_update_slack_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_slack_oauth_callback_serialize( self, _request_auth, @@ -2575,7 +2773,8 @@ def _user_update_slack_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2590,12 +2789,17 @@ def _user_update_slack_oauth_callback_serialize( # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/slack/callback", + method='GET', + resource_path='/api/v1/users/slack/callback', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2605,24 +2809,23 @@ def _user_update_slack_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def user_update_slack_oauth_start( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2655,21 +2858,22 @@ async def user_update_slack_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2677,21 +2881,18 @@ async def user_update_slack_oauth_start( response_types_map=_response_types_map, ).data + @validate_call async def user_update_slack_oauth_start_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2724,21 +2925,22 @@ async def user_update_slack_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2746,21 +2948,18 @@ async def user_update_slack_oauth_start_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def user_update_slack_oauth_start_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2793,24 +2992,26 @@ async def user_update_slack_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "302": None, + '302': None, } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _user_update_slack_oauth_start_serialize( self, tenant, @@ -2822,7 +3023,8 @@ def _user_update_slack_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2833,18 +3035,23 @@ def _user_update_slack_oauth_start_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + + + # authentication setting - _auth_settings: List[str] = ["cookieAuth"] + _auth_settings: List[str] = [ + 'cookieAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/slack/start", + method='GET', + resource_path='/api/v1/tenants/{tenant}/slack/start', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2854,5 +3061,7 @@ def _user_update_slack_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/worker_api.py b/hatchet_sdk/clients/rest/api/worker_api.py index cc9a82a5..0139fba1 100644 --- a/hatchet_sdk/clients/rest/api/worker_api.py +++ b/hatchet_sdk/clients/rest/api/worker_api.py @@ -12,16 +12,19 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from pydantic import Field, StrictBool +from typing import Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest from hatchet_sdk.clients.rest.models.worker import Worker from hatchet_sdk.clients.rest.models.worker_list import WorkerList + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -37,24 +40,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def worker_get( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - recent_failed: Annotated[ - Optional[StrictBool], Field(description="Filter recent by failed") - ] = None, + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +87,7 @@ async def worker_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, @@ -97,16 +95,17 @@ async def worker_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -114,24 +113,19 @@ async def worker_get( response_types_map=_response_types_map, ).data + @validate_call async def worker_get_with_http_info( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - recent_failed: Annotated[ - Optional[StrictBool], Field(description="Filter recent by failed") - ] = None, + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -166,7 +160,7 @@ async def worker_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, @@ -174,16 +168,17 @@ async def worker_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -191,24 +186,19 @@ async def worker_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def worker_get_without_preload_content( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - recent_failed: Annotated[ - Optional[StrictBool], Field(description="Filter recent by failed") - ] = None, + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -243,7 +233,7 @@ async def worker_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, @@ -251,19 +241,21 @@ async def worker_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _worker_get_serialize( self, worker, @@ -276,7 +268,8 @@ def _worker_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -287,27 +280,34 @@ def _worker_get_serialize( # process the path parameters if worker is not None: - _path_params["worker"] = worker + _path_params['worker'] = worker # process the query parameters if recent_failed is not None: - - _query_params.append(("recentFailed", recent_failed)) - + + _query_params.append(('recentFailed', recent_failed)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workers/{worker}", + method='GET', + resource_path='/api/v1/workers/{worker}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -317,24 +317,23 @@ def _worker_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def worker_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -367,23 +366,24 @@ async def worker_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkerList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkerList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -391,21 +391,18 @@ async def worker_list( response_types_map=_response_types_map, ).data + @validate_call async def worker_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -438,23 +435,24 @@ async def worker_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkerList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkerList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -462,21 +460,18 @@ async def worker_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def worker_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -509,26 +504,28 @@ async def worker_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkerList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkerList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _worker_list_serialize( self, tenant, @@ -540,7 +537,8 @@ def _worker_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -551,23 +549,30 @@ def _worker_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/worker", + method='GET', + resource_path='/api/v1/tenants/{tenant}/worker', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -577,27 +582,24 @@ def _worker_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def worker_update( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - update_worker_request: Annotated[ - UpdateWorkerRequest, Field(description="The worker update") - ], + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -632,7 +634,7 @@ async def worker_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -640,16 +642,17 @@ async def worker_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -657,24 +660,19 @@ async def worker_update( response_types_map=_response_types_map, ).data + @validate_call async def worker_update_with_http_info( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - update_worker_request: Annotated[ - UpdateWorkerRequest, Field(description="The worker update") - ], + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -709,7 +707,7 @@ async def worker_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -717,16 +715,17 @@ async def worker_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -734,24 +733,19 @@ async def worker_update_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def worker_update_without_preload_content( self, - worker: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The worker id" - ), - ], - update_worker_request: Annotated[ - UpdateWorkerRequest, Field(description="The worker update") - ], + worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], + update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -786,7 +780,7 @@ async def worker_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -794,19 +788,21 @@ async def worker_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Worker", - "400": "APIErrors", - "403": "APIErrors", + '200': "Worker", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _worker_update_serialize( self, worker, @@ -819,7 +815,8 @@ def _worker_update_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -830,7 +827,7 @@ def _worker_update_serialize( # process the path parameters if worker is not None: - _path_params["worker"] = worker + _path_params['worker'] = worker # process the query parameters # process the header parameters # process the form parameters @@ -838,27 +835,37 @@ def _worker_update_serialize( if update_worker_request is not None: _body_params = update_worker_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/workers/{worker}", + method='PATCH', + resource_path='/api/v1/workers/{worker}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -868,5 +875,7 @@ def _worker_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/workflow_api.py b/hatchet_sdk/clients/rest/api/workflow_api.py index 71316035..836ee92f 100644 --- a/hatchet_sdk/clients/rest/api/workflow_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_api.py @@ -12,14 +12,14 @@ """ # noqa: E501 import warnings -from datetime import datetime +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from datetime import datetime +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.tenant_queue_metrics import TenantQueueMetrics from hatchet_sdk.clients.rest.models.workflow import Workflow from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind @@ -27,18 +27,15 @@ from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( - WorkflowRunOrderByDirection, -) -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( - WorkflowRunOrderByField, -) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import ( - WorkflowVersionDefinition, -) +from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -54,29 +51,20 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def tenant_get_queue_metrics( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -113,7 +101,7 @@ async def tenant_get_queue_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -122,17 +110,18 @@ async def tenant_get_queue_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantQueueMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "TenantQueueMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -140,29 +129,20 @@ async def tenant_get_queue_metrics( response_types_map=_response_types_map, ).data + @validate_call async def tenant_get_queue_metrics_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -199,7 +179,7 @@ async def tenant_get_queue_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -208,17 +188,18 @@ async def tenant_get_queue_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantQueueMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "TenantQueueMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -226,29 +207,20 @@ async def tenant_get_queue_metrics_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def tenant_get_queue_metrics_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflows: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of workflow IDs to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -285,7 +257,7 @@ async def tenant_get_queue_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -294,20 +266,22 @@ async def tenant_get_queue_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantQueueMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "TenantQueueMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _tenant_get_queue_metrics_serialize( self, tenant, @@ -322,8 +296,8 @@ def _tenant_get_queue_metrics_serialize( _host = None _collection_formats: Dict[str, str] = { - "workflows": "multi", - "additionalMetadata": "multi", + 'workflows': 'multi', + 'additionalMetadata': 'multi', } _path_params: Dict[str, str] = {} @@ -335,31 +309,38 @@ def _tenant_get_queue_metrics_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters if workflows is not None: - - _query_params.append(("workflows", workflows)) - + + _query_params.append(('workflows', workflows)) + if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - + + _query_params.append(('additionalMetadata', additional_metadata)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/queue-metrics", + method='GET', + resource_path='/api/v1/tenants/{tenant}/queue-metrics', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -369,24 +350,23 @@ def _tenant_get_queue_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_delete( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -419,24 +399,25 @@ async def workflow_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -444,21 +425,18 @@ async def workflow_delete( response_types_map=_response_types_map, ).data + @validate_call async def workflow_delete_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -491,24 +469,25 @@ async def workflow_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -516,21 +495,18 @@ async def workflow_delete_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_delete_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -563,27 +539,29 @@ async def workflow_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '204': None, + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_delete_serialize( self, workflow, @@ -595,7 +573,8 @@ def _workflow_delete_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -606,23 +585,30 @@ def _workflow_delete_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/workflows/{workflow}", + method='DELETE', + resource_path='/api/v1/workflows/{workflow}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -632,24 +618,23 @@ def _workflow_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_get( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -682,23 +667,24 @@ async def workflow_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Workflow", - "400": "APIErrors", - "403": "APIErrors", + '200': "Workflow", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -706,21 +692,18 @@ async def workflow_get( response_types_map=_response_types_map, ).data + @validate_call async def workflow_get_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -753,23 +736,24 @@ async def workflow_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Workflow", - "400": "APIErrors", - "403": "APIErrors", + '200': "Workflow", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -777,21 +761,18 @@ async def workflow_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_get_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -824,26 +805,28 @@ async def workflow_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Workflow", - "400": "APIErrors", - "403": "APIErrors", + '200': "Workflow", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_get_serialize( self, workflow, @@ -855,7 +838,8 @@ def _workflow_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -866,23 +850,30 @@ def _workflow_get_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workflows/{workflow}", + method='GET', + resource_path='/api/v1/workflows/{workflow}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -892,31 +883,25 @@ def _workflow_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_get_metrics( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - status: Annotated[ - Optional[WorkflowRunStatus], - Field(description="A status of workflow run statuses to filter by"), - ] = None, - group_key: Annotated[ - Optional[StrictStr], Field(description="A group key to filter metrics by") - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, + group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -953,7 +938,7 @@ async def workflow_get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -962,17 +947,18 @@ async def workflow_get_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -980,28 +966,20 @@ async def workflow_get_metrics( response_types_map=_response_types_map, ).data + @validate_call async def workflow_get_metrics_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - status: Annotated[ - Optional[WorkflowRunStatus], - Field(description="A status of workflow run statuses to filter by"), - ] = None, - group_key: Annotated[ - Optional[StrictStr], Field(description="A group key to filter metrics by") - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, + group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1038,7 +1016,7 @@ async def workflow_get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -1047,17 +1025,18 @@ async def workflow_get_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1065,28 +1044,20 @@ async def workflow_get_metrics_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_get_metrics_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - status: Annotated[ - Optional[WorkflowRunStatus], - Field(description="A status of workflow run statuses to filter by"), - ] = None, - group_key: Annotated[ - Optional[StrictStr], Field(description="A group key to filter metrics by") - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, + group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1123,7 +1094,7 @@ async def workflow_get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -1132,20 +1103,22 @@ async def workflow_get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowMetrics", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowMetrics", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_get_metrics_serialize( self, workflow, @@ -1159,7 +1132,8 @@ def _workflow_get_metrics_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1170,31 +1144,38 @@ def _workflow_get_metrics_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters if status is not None: - - _query_params.append(("status", status.value)) - + + _query_params.append(('status', status.value)) + if group_key is not None: - - _query_params.append(("groupKey", group_key)) - + + _query_params.append(('groupKey', group_key)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workflows/{workflow}/metrics", + method='GET', + resource_path='/api/v1/workflows/{workflow}/metrics', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1204,24 +1185,23 @@ def _workflow_get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1254,23 +1234,24 @@ async def workflow_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1278,21 +1259,18 @@ async def workflow_list( response_types_map=_response_types_map, ).data + @validate_call async def workflow_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1325,23 +1303,24 @@ async def workflow_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1349,21 +1328,18 @@ async def workflow_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1396,26 +1372,28 @@ async def workflow_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_list_serialize( self, tenant, @@ -1427,7 +1405,8 @@ def _workflow_list_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1438,23 +1417,30 @@ def _workflow_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows", + method='GET', + resource_path='/api/v1/tenants/{tenant}/workflows', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1464,33 +1450,24 @@ def _workflow_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_run_get( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1525,7 +1502,7 @@ async def workflow_run_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_serialize( tenant=tenant, @@ -1533,16 +1510,17 @@ async def workflow_run_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1550,30 +1528,19 @@ async def workflow_run_get( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_get_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1608,7 +1575,7 @@ async def workflow_run_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_serialize( tenant=tenant, @@ -1616,16 +1583,17 @@ async def workflow_run_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1633,30 +1601,19 @@ async def workflow_run_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_get_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1691,7 +1648,7 @@ async def workflow_run_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_serialize( tenant=tenant, @@ -1699,19 +1656,21 @@ async def workflow_run_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_get_serialize( self, tenant, @@ -1724,7 +1683,8 @@ def _workflow_run_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1735,25 +1695,32 @@ def _workflow_run_get_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant if workflow_run is not None: - _path_params["workflow-run"] = workflow_run + _path_params['workflow-run'] = workflow_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}", + method='GET', + resource_path='/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1763,52 +1730,30 @@ def _workflow_run_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_run_get_metrics( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1855,7 +1800,7 @@ async def workflow_run_get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_metrics_serialize( tenant=tenant, @@ -1869,16 +1814,17 @@ async def workflow_run_get_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunsMetrics", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1886,49 +1832,25 @@ async def workflow_run_get_metrics( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_get_metrics_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1975,7 +1897,7 @@ async def workflow_run_get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_metrics_serialize( tenant=tenant, @@ -1989,16 +1911,17 @@ async def workflow_run_get_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunsMetrics", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2006,49 +1929,25 @@ async def workflow_run_get_metrics_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_get_metrics_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2095,7 +1994,7 @@ async def workflow_run_get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_metrics_serialize( tenant=tenant, @@ -2109,19 +2008,21 @@ async def workflow_run_get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunsMetrics", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunsMetrics", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_get_metrics_serialize( self, tenant, @@ -2141,7 +2042,7 @@ def _workflow_run_get_metrics_serialize( _host = None _collection_formats: Dict[str, str] = { - "additionalMetadata": "multi", + 'additionalMetadata': 'multi', } _path_params: Dict[str, str] = {} @@ -2153,65 +2054,76 @@ def _workflow_run_get_metrics_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters if event_id is not None: - - _query_params.append(("eventId", event_id)) - + + _query_params.append(('eventId', event_id)) + if workflow_id is not None: - - _query_params.append(("workflowId", workflow_id)) - + + _query_params.append(('workflowId', workflow_id)) + if parent_workflow_run_id is not None: - - _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) - + + _query_params.append(('parentWorkflowRunId', parent_workflow_run_id)) + if parent_step_run_id is not None: - - _query_params.append(("parentStepRunId", parent_step_run_id)) - + + _query_params.append(('parentStepRunId', parent_step_run_id)) + if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - + + _query_params.append(('additionalMetadata', additional_metadata)) + if created_after is not None: if isinstance(created_after, datetime): _query_params.append( ( - "createdAfter", - created_after.isoformat(), + 'createdAfter', + created_after.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("createdAfter", created_after)) - + _query_params.append(('createdAfter', created_after)) + if created_before is not None: if isinstance(created_before, datetime): _query_params.append( ( - "createdBefore", - created_before.isoformat(), + 'createdBefore', + created_before.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("createdBefore", created_before)) - + _query_params.append(('createdBefore', created_before)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows/runs/metrics", + method='GET', + resource_path='/api/v1/tenants/{tenant}/workflows/runs/metrics', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2221,73 +2133,36 @@ def _workflow_run_get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_run_list( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, + order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2346,7 +2221,7 @@ async def workflow_run_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2366,16 +2241,17 @@ async def workflow_run_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2383,70 +2259,31 @@ async def workflow_run_list( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_list_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, + order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2505,7 +2342,7 @@ async def workflow_run_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2525,16 +2362,17 @@ async def workflow_run_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2542,70 +2380,31 @@ async def workflow_run_list_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_list_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - offset: Annotated[ - Optional[StrictInt], Field(description="The number to skip") - ] = None, - limit: Annotated[ - Optional[StrictInt], Field(description="The number to limit by") - ] = None, - event_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The event id to get runs for."), - ] = None, - workflow_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The workflow id to get runs for."), - ] = None, - parent_workflow_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent workflow run id"), - ] = None, - parent_step_run_id: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field(description="The parent step run id"), - ] = None, - statuses: Annotated[ - Optional[List[WorkflowRunStatus]], - Field(description="A list of workflow run statuses to filter by"), - ] = None, - kinds: Annotated[ - Optional[List[WorkflowKind]], - Field(description="A list of workflow kinds to filter by"), - ] = None, - additional_metadata: Annotated[ - Optional[List[StrictStr]], - Field(description="A list of metadata key value pairs to filter by"), - ] = None, - created_after: Annotated[ - Optional[datetime], - Field(description="The time after the workflow run was created"), - ] = None, - created_before: Annotated[ - Optional[datetime], - Field(description="The time before the workflow run was created"), - ] = None, - order_by_field: Annotated[ - Optional[WorkflowRunOrderByField], Field(description="The order by field") - ] = None, - order_by_direction: Annotated[ - Optional[WorkflowRunOrderByDirection], - Field(description="The order by direction"), - ] = None, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, + workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, + parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, + parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, + statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, + kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, + additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, + created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, + order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2664,7 +2463,7 @@ async def workflow_run_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2684,19 +2483,21 @@ async def workflow_run_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunList", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunList", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_list_serialize( self, tenant, @@ -2722,9 +2523,9 @@ def _workflow_run_list_serialize( _host = None _collection_formats: Dict[str, str] = { - "statuses": "multi", - "kinds": "multi", - "additionalMetadata": "multi", + 'statuses': 'multi', + 'kinds': 'multi', + 'additionalMetadata': 'multi', } _path_params: Dict[str, str] = {} @@ -2736,89 +2537,100 @@ def _workflow_run_list_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters if offset is not None: - - _query_params.append(("offset", offset)) - + + _query_params.append(('offset', offset)) + if limit is not None: - - _query_params.append(("limit", limit)) - + + _query_params.append(('limit', limit)) + if event_id is not None: - - _query_params.append(("eventId", event_id)) - + + _query_params.append(('eventId', event_id)) + if workflow_id is not None: - - _query_params.append(("workflowId", workflow_id)) - + + _query_params.append(('workflowId', workflow_id)) + if parent_workflow_run_id is not None: - - _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) - + + _query_params.append(('parentWorkflowRunId', parent_workflow_run_id)) + if parent_step_run_id is not None: - - _query_params.append(("parentStepRunId", parent_step_run_id)) - + + _query_params.append(('parentStepRunId', parent_step_run_id)) + if statuses is not None: - - _query_params.append(("statuses", statuses)) - + + _query_params.append(('statuses', statuses)) + if kinds is not None: - - _query_params.append(("kinds", kinds)) - + + _query_params.append(('kinds', kinds)) + if additional_metadata is not None: - - _query_params.append(("additionalMetadata", additional_metadata)) - + + _query_params.append(('additionalMetadata', additional_metadata)) + if created_after is not None: if isinstance(created_after, datetime): _query_params.append( ( - "createdAfter", - created_after.isoformat(), + 'createdAfter', + created_after.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("createdAfter", created_after)) - + _query_params.append(('createdAfter', created_after)) + if created_before is not None: if isinstance(created_before, datetime): _query_params.append( ( - "createdBefore", - created_before.isoformat(), + 'createdBefore', + created_before.strftime( + self.api_client.configuration.datetime_format + ) ) ) else: - _query_params.append(("createdBefore", created_before)) - + _query_params.append(('createdBefore', created_before)) + if order_by_field is not None: - - _query_params.append(("orderByField", order_by_field.value)) - + + _query_params.append(('orderByField', order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(("orderByDirection", order_by_direction.value)) - + + _query_params.append(('orderByDirection', order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/tenants/{tenant}/workflows/runs", + method='GET', + resource_path='/api/v1/tenants/{tenant}/workflows/runs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2828,30 +2640,24 @@ def _workflow_run_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_version_get( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2886,7 +2692,7 @@ async def workflow_version_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_serialize( workflow=workflow, @@ -2894,17 +2700,18 @@ async def workflow_version_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersion", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2912,27 +2719,19 @@ async def workflow_version_get( response_types_map=_response_types_map, ).data + @validate_call async def workflow_version_get_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2967,7 +2766,7 @@ async def workflow_version_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_serialize( workflow=workflow, @@ -2975,17 +2774,18 @@ async def workflow_version_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersion", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2993,27 +2793,19 @@ async def workflow_version_get_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_version_get_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3048,7 +2840,7 @@ async def workflow_version_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_serialize( workflow=workflow, @@ -3056,20 +2848,22 @@ async def workflow_version_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersion", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersion", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_version_get_serialize( self, workflow, @@ -3082,7 +2876,8 @@ def _workflow_version_get_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3093,27 +2888,34 @@ def _workflow_version_get_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters if version is not None: - - _query_params.append(("version", version)) - + + _query_params.append(('version', version)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workflows/{workflow}/versions", + method='GET', + resource_path='/api/v1/workflows/{workflow}/versions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3123,30 +2925,24 @@ def _workflow_version_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_version_get_definition( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3181,7 +2977,7 @@ async def workflow_version_get_definition( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_definition_serialize( workflow=workflow, @@ -3189,17 +2985,18 @@ async def workflow_version_get_definition( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersionDefinition", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersionDefinition", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3207,27 +3004,19 @@ async def workflow_version_get_definition( response_types_map=_response_types_map, ).data + @validate_call async def workflow_version_get_definition_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3262,7 +3051,7 @@ async def workflow_version_get_definition_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_definition_serialize( workflow=workflow, @@ -3270,17 +3059,18 @@ async def workflow_version_get_definition_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersionDefinition", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersionDefinition", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3288,27 +3078,19 @@ async def workflow_version_get_definition_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_version_get_definition_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3343,7 +3125,7 @@ async def workflow_version_get_definition_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_version_get_definition_serialize( workflow=workflow, @@ -3351,20 +3133,22 @@ async def workflow_version_get_definition_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowVersionDefinition", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "WorkflowVersionDefinition", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_version_get_definition_serialize( self, workflow, @@ -3377,7 +3161,8 @@ def _workflow_version_get_definition_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3388,27 +3173,34 @@ def _workflow_version_get_definition_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters if version is not None: - - _query_params.append(("version", version)) - + + _query_params.append(('version', version)) + # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workflows/{workflow}/versions/definition", + method='GET', + resource_path='/api/v1/workflows/{workflow}/versions/definition', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3418,5 +3210,7 @@ def _workflow_version_get_definition_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/workflow_run_api.py b/hatchet_sdk/clients/rest/api/workflow_run_api.py index c0f22759..be4f769d 100644 --- a/hatchet_sdk/clients/rest/api/workflow_run_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_run_api.py @@ -12,23 +12,20 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field +from typing import Optional from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest +from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( - TriggerWorkflowRunRequest, -) -from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( - WorkflowRunCancel200Response, -) -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( - WorkflowRunsCancelRequest, -) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -44,25 +41,19 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def workflow_run_cancel( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_runs_cancel_request: Annotated[ - WorkflowRunsCancelRequest, - Field(description="The input to cancel the workflow runs"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -97,7 +88,7 @@ async def workflow_run_cancel( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -105,16 +96,17 @@ async def workflow_run_cancel( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunCancel200Response", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunCancel200Response", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -122,25 +114,19 @@ async def workflow_run_cancel( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_cancel_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_runs_cancel_request: Annotated[ - WorkflowRunsCancelRequest, - Field(description="The input to cancel the workflow runs"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -175,7 +161,7 @@ async def workflow_run_cancel_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -183,16 +169,17 @@ async def workflow_run_cancel_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunCancel200Response", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunCancel200Response", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -200,25 +187,19 @@ async def workflow_run_cancel_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_cancel_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - workflow_runs_cancel_request: Annotated[ - WorkflowRunsCancelRequest, - Field(description="The input to cancel the workflow runs"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -253,7 +234,7 @@ async def workflow_run_cancel_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -261,19 +242,21 @@ async def workflow_run_cancel_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunCancel200Response", - "400": "APIErrors", - "403": "APIErrors", + '200': "WorkflowRunCancel200Response", + '400': "APIErrors", + '403': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_cancel_serialize( self, tenant, @@ -286,7 +269,8 @@ def _workflow_run_cancel_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -297,7 +281,7 @@ def _workflow_run_cancel_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -305,27 +289,37 @@ def _workflow_run_cancel_serialize( if workflow_runs_cancel_request is not None: _body_params = workflow_runs_cancel_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/workflows/cancel", + method='POST', + resource_path='/api/v1/tenants/{tenant}/workflows/cancel', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -335,34 +329,25 @@ def _workflow_run_cancel_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_run_create( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - trigger_workflow_run_request: Annotated[ - TriggerWorkflowRunRequest, - Field(description="The input to the workflow run"), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -399,7 +384,7 @@ async def workflow_run_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -408,18 +393,19 @@ async def workflow_run_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - "429": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -427,31 +413,20 @@ async def workflow_run_create( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_create_with_http_info( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - trigger_workflow_run_request: Annotated[ - TriggerWorkflowRunRequest, - Field(description="The input to the workflow run"), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -488,7 +463,7 @@ async def workflow_run_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -497,18 +472,19 @@ async def workflow_run_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - "429": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -516,31 +492,20 @@ async def workflow_run_create_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_create_without_preload_content( self, - workflow: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The workflow id" - ), - ], - trigger_workflow_run_request: Annotated[ - TriggerWorkflowRunRequest, - Field(description="The input to the workflow run"), - ], - version: Annotated[ - Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], - Field( - description="The workflow version. If not supplied, the latest version is fetched." - ), - ] = None, + workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], + version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -577,7 +542,7 @@ async def workflow_run_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -586,21 +551,23 @@ async def workflow_run_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRun", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", - "429": "APIErrors", + '200': "WorkflowRun", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_create_serialize( self, workflow, @@ -614,7 +581,8 @@ def _workflow_run_create_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -625,39 +593,49 @@ def _workflow_run_create_serialize( # process the path parameters if workflow is not None: - _path_params["workflow"] = workflow + _path_params['workflow'] = workflow # process the query parameters if version is not None: - - _query_params.append(("version", version)) - + + _query_params.append(('version', version)) + # process the header parameters # process the form parameters # process the body parameter if trigger_workflow_run_request is not None: _body_params = trigger_workflow_run_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workflows/{workflow}/trigger", + method='POST', + resource_path='/api/v1/workflows/{workflow}/trigger', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -667,5 +645,7 @@ def _workflow_run_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api/workflow_runs_api.py b/hatchet_sdk/clients/rest/api/workflow_runs_api.py index 0572380b..d2882acb 100644 --- a/hatchet_sdk/clients/rest/api/workflow_runs_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_runs_api.py @@ -12,19 +12,18 @@ """ # noqa: E501 import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field +from typing import Any, Dict from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( - ReplayWorkflowRunsRequest, -) -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( - ReplayWorkflowRunsResponse, -) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,24 +39,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call async def workflow_run_get_input( self, - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -90,24 +83,25 @@ async def workflow_run_get_input( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "Dict[str, object]", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -115,24 +109,18 @@ async def workflow_run_get_input( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_get_input_with_http_info( self, - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -165,24 +153,25 @@ async def workflow_run_get_input_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "Dict[str, object]", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -190,24 +179,18 @@ async def workflow_run_get_input_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_get_input_without_preload_content( self, - workflow_run: Annotated[ - str, - Field( - min_length=36, - strict=True, - max_length=36, - description="The workflow run id", - ), - ], + workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -240,27 +223,29 @@ async def workflow_run_get_input_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, object]", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + '200': "Dict[str, object]", + '400': "APIErrors", + '403': "APIErrors", + '404': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_get_input_serialize( self, workflow_run, @@ -272,7 +257,8 @@ def _workflow_run_get_input_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -283,23 +269,30 @@ def _workflow_run_get_input_serialize( # process the path parameters if workflow_run is not None: - _path_params["workflow-run"] = workflow_run + _path_params['workflow-run'] = workflow_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) + # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workflow-runs/{workflow-run}/input", + method='GET', + resource_path='/api/v1/workflow-runs/{workflow-run}/input', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -309,28 +302,24 @@ def _workflow_run_get_input_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + + @validate_call async def workflow_run_update_replay( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -365,7 +354,7 @@ async def workflow_run_update_replay( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -373,17 +362,18 @@ async def workflow_run_update_replay( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "ReplayWorkflowRunsResponse", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -391,25 +381,19 @@ async def workflow_run_update_replay( response_types_map=_response_types_map, ).data + @validate_call async def workflow_run_update_replay_with_http_info( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -444,7 +428,7 @@ async def workflow_run_update_replay_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -452,17 +436,18 @@ async def workflow_run_update_replay_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "ReplayWorkflowRunsResponse", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -470,25 +455,19 @@ async def workflow_run_update_replay_with_http_info( response_types_map=_response_types_map, ) + @validate_call async def workflow_run_update_replay_without_preload_content( self, - tenant: Annotated[ - str, - Field( - min_length=36, strict=True, max_length=36, description="The tenant id" - ), - ], - replay_workflow_runs_request: Annotated[ - ReplayWorkflowRunsRequest, - Field(description="The workflow run ids to replay"), - ], + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -523,7 +502,7 @@ async def workflow_run_update_replay_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -531,20 +510,22 @@ async def workflow_run_update_replay_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index, + _host_index=_host_index ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ReplayWorkflowRunsResponse", - "400": "APIErrors", - "403": "APIErrors", - "429": "APIErrors", + '200': "ReplayWorkflowRunsResponse", + '400': "APIErrors", + '403': "APIErrors", + '429': "APIErrors", } response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + *_param, + _request_timeout=_request_timeout ) return response_data.response + def _workflow_run_update_replay_serialize( self, tenant, @@ -557,7 +538,8 @@ def _workflow_run_update_replay_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -568,7 +550,7 @@ def _workflow_run_update_replay_serialize( # process the path parameters if tenant is not None: - _path_params["tenant"] = tenant + _path_params['tenant'] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -576,27 +558,37 @@ def _workflow_run_update_replay_serialize( if replay_workflow_runs_request is not None: _body_params = replay_workflow_runs_request + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) # set the HTTP header `Content-Type` if _content_type: - _header_params["Content-Type"] = _content_type + _header_params['Content-Type'] = _content_type else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) ) if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay", + method='POST', + resource_path='/api/v1/tenants/{tenant}/workflow-runs/replay', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -606,5 +598,7 @@ def _workflow_run_update_replay_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth, + _request_auth=_request_auth ) + + diff --git a/hatchet_sdk/clients/rest/api_client.py b/hatchet_sdk/clients/rest/api_client.py index 2980d8c1..98f7847d 100644 --- a/hatchet_sdk/clients/rest/api_client.py +++ b/hatchet_sdk/clients/rest/api_client.py @@ -13,36 +13,34 @@ import datetime +from dateutil.parser import parse +from enum import Enum import json import mimetypes import os import re import tempfile -from enum import Enum -from typing import Dict, List, Optional, Tuple, Union -from urllib.parse import quote -from dateutil.parser import parse +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union from pydantic import SecretStr +from hatchet_sdk.clients.rest.configuration import Configuration +from hatchet_sdk.clients.rest.api_response import ApiResponse, T as ApiResponseT import hatchet_sdk.clients.rest.models from hatchet_sdk.clients.rest import rest -from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.api_response import T as ApiResponseT -from hatchet_sdk.clients.rest.configuration import Configuration from hatchet_sdk.clients.rest.exceptions import ( - ApiException, ApiValueError, + ApiException, BadRequestException, + UnauthorizedException, ForbiddenException, NotFoundException, - ServiceException, - UnauthorizedException, + ServiceException ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] - class ApiClient: """Generic API client for OpenAPI client library builds. @@ -61,19 +59,23 @@ class ApiClient: PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { - "int": int, - "long": int, # TODO remove as only py3 is supported? - "float": float, - "str": str, - "bool": bool, - "date": datetime.date, - "datetime": datetime.datetime, - "object": object, + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, } _pool = None def __init__( - self, configuration=None, header_name=None, header_value=None, cookie=None + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None ) -> None: # use default configuration if none is provided if configuration is None: @@ -86,7 +88,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation async def __aenter__(self): @@ -101,15 +103,16 @@ async def close(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers["User-Agent"] + return self.default_headers['User-Agent'] @user_agent.setter def user_agent(self, value): - self.default_headers["User-Agent"] = value + self.default_headers['User-Agent'] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value + _default = None @classmethod @@ -145,12 +148,12 @@ def param_serialize( header_params=None, body=None, post_params=None, - files=None, - auth_settings=None, + files=None, auth_settings=None, collection_formats=None, _host=None, - _request_auth=None, + _request_auth=None ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. :param method: Method to call. :param resource_path: Path to method endpoint. @@ -179,28 +182,35 @@ def param_serialize( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params["Cookie"] = self.cookie + header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict( - self.parameters_to_tuples(header_params, collection_formats) + self.parameters_to_tuples(header_params,collection_formats) ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) ) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) if files: post_params.extend(self.files_parameters(files)) @@ -212,7 +222,7 @@ def param_serialize( resource_path, method, body, - request_auth=_request_auth, + request_auth=_request_auth ) # body @@ -229,11 +239,15 @@ def param_serialize( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query return method, url, header_params, body, post_params + async def call_api( self, method, @@ -241,7 +255,7 @@ async def call_api( header_params=None, body=None, post_params=None, - _request_timeout=None, + _request_timeout=None ) -> rest.RESTResponse: """Makes the HTTP request (synchronous) :param method: Method to call. @@ -258,12 +272,10 @@ async def call_api( try: # perform request and return response response_data = await self.rest_client.request( - method, - url, + method, url, headers=header_params, - body=body, - post_params=post_params, - _request_timeout=_request_timeout, + body=body, post_params=post_params, + _request_timeout=_request_timeout ) except ApiException as e: @@ -274,7 +286,7 @@ async def call_api( def response_deserialize( self, response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]] = None, + response_types_map: Optional[Dict[str, ApiResponseT]]=None ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. @@ -286,15 +298,9 @@ def response_deserialize( assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) - if ( - not response_type - and isinstance(response_data.status, int) - and 100 <= response_data.status <= 599 - ): + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get( - str(response_data.status)[0] + "XX", None - ) + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data response_text = None @@ -306,15 +312,13 @@ def response_deserialize( return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader("content-type") + content_type = response_data.getheader('content-type') if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive( - response_text, response_type - ) + return_data = self.__deserialize_primitive(response_text, response_type) else: return_data = self.deserialize(response_text, response_type) finally: @@ -326,10 +330,10 @@ def response_deserialize( ) return ApiResponse( - status_code=response_data.status, - data=return_data, - headers=response_data.getheaders(), - raw_data=response_data.data, + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data ) def sanitize_for_serialization(self, obj): @@ -356,9 +360,13 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() @@ -370,13 +378,14 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): obj_dict = obj.to_dict() else: obj_dict = obj.__dict__ return { - key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() } def deserialize(self, response_text, response_type): @@ -409,17 +418,19 @@ def __deserialize(self, data, klass): return None if isinstance(klass, str): - if klass.startswith("List["): - m = re.match(r"List\[(.*)]", klass) + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) assert m is not None, "Malformed List type definition" sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] - if klass.startswith("Dict["): - m = re.match(r"Dict\[([^,]*), (.*)]", klass) + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) assert m is not None, "Malformed Dict type definition" sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -453,18 +464,19 @@ def parameters_to_tuples(self, params, collection_formats): for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] - if collection_format == "multi": + if collection_format == 'multi': new_params.extend((k, value) for value in v) else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' else: # csv is the default - delimiter = "," - new_params.append((k, delimiter.join(str(value) for value in v))) + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -489,17 +501,17 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] - if collection_format == "multi": + if collection_format == 'multi': new_params.extend((k, str(value)) for value in v) else: - if collection_format == "ssv": - delimiter = " " - elif collection_format == "tsv": - delimiter = "\t" - elif collection_format == "pipes": - delimiter = "|" + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' else: # csv is the default - delimiter = "," + delimiter = ',' new_params.append( (k, delimiter.join(quote(str(value)) for value in v)) ) @@ -517,7 +529,7 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): params = [] for k, v in files.items(): if isinstance(v, str): - with open(v, "rb") as f: + with open(v, 'rb') as f: filename = os.path.basename(f.name) filedata = f.read() elif isinstance(v, bytes): @@ -525,8 +537,13 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): filedata = v else: raise ValueError("Unsupported file value") - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - params.append(tuple([k, tuple([filename, filedata, mimetype])])) + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -539,7 +556,7 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: return None for accept in accepts: - if re.search("json", accept, re.IGNORECASE): + if re.search('json', accept, re.IGNORECASE): return accept return accepts[0] @@ -554,7 +571,7 @@ def select_header_content_type(self, content_types): return None for content_type in content_types: - if re.search("json", content_type, re.IGNORECASE): + if re.search('json', content_type, re.IGNORECASE): return content_type return content_types[0] @@ -567,7 +584,7 @@ def update_params_for_auth( resource_path, method, body, - request_auth=None, + request_auth=None ) -> None: """Updates header and query params based on authentication setting. @@ -586,18 +603,34 @@ def update_params_for_auth( if request_auth: self._apply_auth_params( - headers, queries, resource_path, method, body, request_auth + headers, + queries, + resource_path, + method, + body, + request_auth ) else: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting + headers, + queries, + resource_path, + method, + body, + auth_setting ) def _apply_auth_params( - self, headers, queries, resource_path, method, body, auth_setting + self, + headers, + queries, + resource_path, + method, + body, + auth_setting ) -> None: """Updates the request parameters based on a single auth_setting @@ -609,15 +642,17 @@ def _apply_auth_params( The object type is the return value of sanitize_for_serialization(). :param auth_setting: auth settings for the endpoint """ - if auth_setting["in"] == "cookie": - headers["Cookie"] = auth_setting["value"] - elif auth_setting["in"] == "header": - if auth_setting["type"] != "http-signature": - headers[auth_setting["key"]] = auth_setting["value"] - elif auth_setting["in"] == "query": - queries.append((auth_setting["key"], auth_setting["value"])) + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) else: - raise ApiValueError("Authentication token must be in `query` or `header`") + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) def __deserialize_file(self, response): """Deserializes body to file @@ -637,7 +672,10 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) assert m is not None, "Unexpected 'content-disposition' header value" filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) @@ -681,7 +719,8 @@ def __deserialize_date(self, string): return string except ValueError: raise rest.ApiException( - status=0, reason="Failed to parse `{0}` as date object".format(string) + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) def __deserialize_datetime(self, string): @@ -699,7 +738,10 @@ def __deserialize_datetime(self, string): except ValueError: raise rest.ApiException( status=0, - reason=("Failed to parse `{0}` as datetime object".format(string)), + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) ) def __deserialize_enum(self, data, klass): @@ -713,7 +755,11 @@ def __deserialize_enum(self, data, klass): return klass(data) except ValueError: raise rest.ApiException( - status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) ) def __deserialize_model(self, data, klass): diff --git a/hatchet_sdk/clients/rest/api_response.py b/hatchet_sdk/clients/rest/api_response.py index ca801da0..9bc7c11f 100644 --- a/hatchet_sdk/clients/rest/api_response.py +++ b/hatchet_sdk/clients/rest/api_response.py @@ -1,14 +1,11 @@ """API response object.""" from __future__ import annotations - -from typing import Generic, Mapping, Optional, TypeVar - -from pydantic import BaseModel, Field, StrictBytes, StrictInt +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel T = TypeVar("T") - class ApiResponse(BaseModel, Generic[T]): """ API response object @@ -19,4 +16,6 @@ class ApiResponse(BaseModel, Generic[T]): data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - model_config = {"arbitrary_types_allowed": True} + model_config = { + "arbitrary_types_allowed": True + } diff --git a/hatchet_sdk/clients/rest/configuration.py b/hatchet_sdk/clients/rest/configuration.py index e33efa68..1adb506c 100644 --- a/hatchet_sdk/clients/rest/configuration.py +++ b/hatchet_sdk/clients/rest/configuration.py @@ -13,94 +13,81 @@ import copy -import http.client as httplib import logging -import sys from logging import FileHandler +import sys from typing import Optional - import urllib3 +import http.client as httplib + JSON_SCHEMA_VALIDATION_KEYWORDS = { - "multipleOf", - "maximum", - "exclusiveMaximum", - "minimum", - "exclusiveMinimum", - "maxLength", - "minLength", - "pattern", - "maxItems", - "minItems", + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' } - class Configuration: """This class contains various settings of the API client. - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - - conf = hatchet_sdk.clients.rest.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = hatchet_sdk.clients.rest.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default = None - def __init__( - self, - host=None, - api_key=None, - api_key_prefix=None, - username=None, - password=None, - access_token=None, - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: - """Constructor""" + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor + """ self._base_path = "http://localhost" if host is None else host """Default Base url """ @@ -143,7 +130,7 @@ def __init__( """ self.logger["package_logger"] = logging.getLogger("hatchet_sdk.clients.rest") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = "%(asctime)s %(levelname)s %(message)s" + self.logger_format = '%(asctime)s %(levelname)s %(message)s' """Log format """ self.logger_stream_handler = None @@ -192,7 +179,7 @@ def __init__( self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = "" + self.safe_chars_for_path_param = '' """Safe chars for path_param """ self.retries = None @@ -218,7 +205,7 @@ def __deepcopy__(self, memo): result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ("logger", "logger_file_handler"): + if k not in ('logger', 'logger_file_handler'): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -359,9 +346,7 @@ def get_api_key_with_prefix(self, identifier, alias=None): """ if self.refresh_api_key_hook is not None: self.refresh_api_key_hook(self) - key = self.api_key.get( - identifier, self.api_key.get(alias) if alias is not None else None - ) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) if key: prefix = self.api_key_prefix.get(identifier) if prefix: @@ -380,9 +365,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers(basic_auth=username + ":" + password).get( - "authorization" - ) + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') def auth_settings(self): """Gets Auth Settings dict for api client. @@ -391,19 +376,19 @@ def auth_settings(self): """ auth = {} if self.access_token is not None: - auth["bearerAuth"] = { - "type": "bearer", - "in": "header", - "key": "Authorization", - "value": "Bearer " + self.access_token, + auth['bearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token } - if "cookieAuth" in self.api_key: - auth["cookieAuth"] = { - "type": "api_key", - "in": "cookie", - "key": "hatchet", - "value": self.get_api_key_with_prefix( - "cookieAuth", + if 'cookieAuth' in self.api_key: + auth['cookieAuth'] = { + 'type': 'api_key', + 'in': 'cookie', + 'key': 'hatchet', + 'value': self.get_api_key_with_prefix( + 'cookieAuth', ), } return auth @@ -413,13 +398,12 @@ def to_debug_report(self): :return: The report for debugging. """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: 1.0.0\n" - "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) - ) + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): """Gets an array of host settings @@ -428,8 +412,8 @@ def get_host_settings(self): """ return [ { - "url": "", - "description": "No description provided", + 'url': "", + 'description': "No description provided", } ] @@ -451,22 +435,22 @@ def get_host_from_settings(self, index, variables=None, servers=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers)) - ) + "Must be less than {1}".format(index, len(servers))) - url = server["url"] + url = server['url'] # go through variables and replace placeholders - for variable_name, variable in server.get("variables", {}).items(): - used_value = variables.get(variable_name, variable["default_value"]) + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) - if "enum_values" in variable and used_value not in variable["enum_values"]: + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], variable["enum_values"] - ) - ) + variable_name, variables[variable_name], + variable['enum_values'])) url = url.replace("{" + variable_name + "}", used_value) @@ -475,9 +459,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): @property def host(self): """Return generated host.""" - return self.get_host_from_settings( - self.server_index, variables=self.server_variables - ) + return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter def host(self, value): diff --git a/hatchet_sdk/clients/rest/exceptions.py b/hatchet_sdk/clients/rest/exceptions.py index b41ac1d2..205c95b6 100644 --- a/hatchet_sdk/clients/rest/exceptions.py +++ b/hatchet_sdk/clients/rest/exceptions.py @@ -12,19 +12,16 @@ """ # noqa: E501 from typing import Any, Optional - from typing_extensions import Self - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__( - self, msg, path_to_item=None, valid_classes=None, key_type=None - ) -> None: - """Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors Args: msg (str): the exception message @@ -107,9 +104,9 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): def __init__( - self, - status=None, - reason=None, + self, + status=None, + reason=None, http_resp=None, *, body: Optional[str] = None, @@ -128,17 +125,17 @@ def __init__( self.reason = http_resp.reason if self.body is None: try: - self.body = http_resp.data.decode("utf-8") + self.body = http_resp.data.decode('utf-8') except Exception: pass self.headers = http_resp.getheaders() @classmethod def from_response( - cls, - *, - http_resp, - body: Optional[str], + cls, + *, + http_resp, + body: Optional[str], data: Optional[Any], ) -> Self: if http_resp.status == 400: @@ -159,9 +156,11 @@ def from_response( def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format(self.headers) + error_message += "HTTP response headers: {0}\n".format( + self.headers) if self.data or self.body: error_message += "HTTP response body: {0}\n".format(self.data or self.body) diff --git a/hatchet_sdk/clients/rest/models/__init__.py b/hatchet_sdk/clients/rest/models/__init__.py index 244139e6..c7f32da1 100644 --- a/hatchet_sdk/clients/rest/models/__init__.py +++ b/hatchet_sdk/clients/rest/models/__init__.py @@ -13,8 +13,6 @@ """ # noqa: E501 -from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest - # import models into model package from hatchet_sdk.clients.rest.models.api_error import APIError from hatchet_sdk.clients.rest.models.api_errors import APIErrors @@ -24,57 +22,34 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.create_api_token_request import ( - CreateAPITokenRequest, -) -from hatchet_sdk.clients.rest.models.create_api_token_response import ( - CreateAPITokenResponse, -) +from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest +from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest +from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest -from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import ( - CreatePullRequestFromStepRun, -) -from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( - CreateSNSIntegrationRequest, -) -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( - CreateTenantAlertEmailGroupRequest, -) -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( - CreateTenantInviteRequest, -) +from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import CreatePullRequestFromStepRun +from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import ( - EventOrderByDirection, -) +from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( - EventWorkflowRunSummary, -) -from hatchet_sdk.clients.rest.models.get_step_run_diff_response import ( - GetStepRunDiffResponse, -) +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary +from hatchet_sdk.clients.rest.models.get_step_run_diff_response import GetStepRunDiffResponse from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run import JobRun from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( - ListAPITokensResponse, -) -from hatchet_sdk.clients.rest.models.list_pull_requests_response import ( - ListPullRequestsResponse, -) -from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse +from hatchet_sdk.clients.rest.models.list_pull_requests_response import ListPullRequestsResponse from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( - LogLineOrderByDirection, -) +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.pull_request import PullRequest @@ -83,16 +58,12 @@ from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( - ReplayWorkflowRunsRequest, -) -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( - ReplayWorkflowRunsResponse, -) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive @@ -104,15 +75,9 @@ from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( - TenantAlertEmailGroup, -) -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( - TenantAlertEmailGroupList, -) -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( - TenantAlertingSettings, -) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_list import TenantList @@ -123,45 +88,25 @@ from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( - TriggerWorkflowRunRequest, -) -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( - UpdateTenantAlertEmailGroupRequest, -) -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( - UpdateTenantInviteRequest, -) +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import ( - UserChangePasswordRequest, -) +from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( - UserTenantMembershipsList, -) +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( - WebhookWorkerCreateRequest, -) -from hatchet_sdk.clients.rest.models.webhook_worker_create_response import ( - WebhookWorkerCreateResponse, -) +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest +from hatchet_sdk.clients.rest.models.webhook_worker_create_response import WebhookWorkerCreateResponse from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( - WebhookWorkerListResponse, -) +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( - WebhookWorkerRequestListResponse, -) -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( - WebhookWorkerRequestMethod, -) +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod from hatchet_sdk.clients.rest.models.worker import Worker from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel from hatchet_sdk.clients.rest.models.worker_list import WorkerList @@ -171,37 +116,19 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import ( - WorkflowRunCancel200Response, -) +from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( - WorkflowRunOrderByDirection, -) -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( - WorkflowRunOrderByField, -) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( - WorkflowRunTriggeredBy, -) -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( - WorkflowRunsCancelRequest, -) +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics -from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( - WorkflowRunsMetricsCounts, -) +from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import WorkflowRunsMetricsCounts from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( - WorkflowTriggerCronRef, -) -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( - WorkflowTriggerEventRef, -) +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import ( - WorkflowVersionDefinition, -) +from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta diff --git a/hatchet_sdk/clients/rest/models/accept_invite_request.py b/hatchet_sdk/clients/rest/models/accept_invite_request.py index 241bff8a..160dd123 100644 --- a/hatchet_sdk/clients/rest/models/accept_invite_request.py +++ b/hatchet_sdk/clients/rest/models/accept_invite_request.py @@ -13,21 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class AcceptInviteRequest(BaseModel): """ AcceptInviteRequest - """ # noqa: E501 - + """ # noqa: E501 invite: Annotated[str, Field(min_length=36, strict=True, max_length=36)] __properties: ClassVar[List[str]] = ["invite"] @@ -37,6 +36,7 @@ class AcceptInviteRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"invite": obj.get("invite")}) + _obj = cls.model_validate({ + "invite": obj.get("invite") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_error.py b/hatchet_sdk/clients/rest/models/api_error.py index 64edc80f..bb448b2d 100644 --- a/hatchet_sdk/clients/rest/models/api_error.py +++ b/hatchet_sdk/clients/rest/models/api_error.py @@ -13,34 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class APIError(BaseModel): """ APIError - """ # noqa: E501 - - code: Optional[StrictInt] = Field( - default=None, description="a custom Hatchet error code" - ) - var_field: Optional[StrictStr] = Field( - default=None, - description="the field that this error is associated with, if applicable", - alias="field", - ) + """ # noqa: E501 + code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") + var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") description: StrictStr = Field(description="a description for this error") - docs_link: Optional[StrictStr] = Field( - default=None, - description="a link to the documentation for this error, if it exists", - ) + docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] model_config = ConfigDict( @@ -49,6 +38,7 @@ class APIError(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,12 +82,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "code": obj.get("code"), - "field": obj.get("field"), - "description": obj.get("description"), - "docs_link": obj.get("docs_link"), - } - ) + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_errors.py b/hatchet_sdk/clients/rest/models/api_errors.py index e41cf5fc..9a8e58c2 100644 --- a/hatchet_sdk/clients/rest/models/api_errors.py +++ b/hatchet_sdk/clients/rest/models/api_errors.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.api_error import APIError - +from typing import Optional, Set +from typing_extensions import Self class APIErrors(BaseModel): """ APIErrors - """ # noqa: E501 - + """ # noqa: E501 errors: List[APIError] __properties: ClassVar[List[str]] = ["errors"] @@ -39,6 +36,7 @@ class APIErrors(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.errors: if _item: _items.append(_item.to_dict()) - _dict["errors"] = _items + _dict['errors'] = _items return _dict @classmethod @@ -88,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "errors": ( - [APIError.from_dict(_item) for _item in obj["errors"]] - if obj.get("errors") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "errors": [APIError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_meta.py b/hatchet_sdk/clients/rest/models/api_meta.py index 93c17f05..c1b2d427 100644 --- a/hatchet_sdk/clients/rest/models/api_meta.py +++ b/hatchet_sdk/clients/rest/models/api_meta.py @@ -13,60 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_meta_auth import APIMetaAuth from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog - +from typing import Optional, Set +from typing_extensions import Self class APIMeta(BaseModel): """ APIMeta - """ # noqa: E501 - + """ # noqa: E501 auth: Optional[APIMetaAuth] = None - pylon_app_id: Optional[StrictStr] = Field( - default=None, - description="the Pylon app ID for usepylon.com chat support", - alias="pylonAppId", - ) + pylon_app_id: Optional[StrictStr] = Field(default=None, description="the Pylon app ID for usepylon.com chat support", alias="pylonAppId") posthog: Optional[APIMetaPosthog] = None - allow_signup: Optional[StrictBool] = Field( - default=None, - description="whether or not users can sign up for this instance", - alias="allowSignup", - ) - allow_invites: Optional[StrictBool] = Field( - default=None, - description="whether or not users can invite other users to this instance", - alias="allowInvites", - ) - allow_create_tenant: Optional[StrictBool] = Field( - default=None, - description="whether or not users can create new tenants", - alias="allowCreateTenant", - ) - allow_change_password: Optional[StrictBool] = Field( - default=None, - description="whether or not users can change their password", - alias="allowChangePassword", - ) - __properties: ClassVar[List[str]] = [ - "auth", - "pylonAppId", - "posthog", - "allowSignup", - "allowInvites", - "allowCreateTenant", - "allowChangePassword", - ] + allow_signup: Optional[StrictBool] = Field(default=None, description="whether or not users can sign up for this instance", alias="allowSignup") + allow_invites: Optional[StrictBool] = Field(default=None, description="whether or not users can invite other users to this instance", alias="allowInvites") + allow_create_tenant: Optional[StrictBool] = Field(default=None, description="whether or not users can create new tenants", alias="allowCreateTenant") + allow_change_password: Optional[StrictBool] = Field(default=None, description="whether or not users can change their password", alias="allowChangePassword") + __properties: ClassVar[List[str]] = ["auth", "pylonAppId", "posthog", "allowSignup", "allowInvites", "allowCreateTenant", "allowChangePassword"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +43,7 @@ class APIMeta(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -98,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -107,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of auth if self.auth: - _dict["auth"] = self.auth.to_dict() + _dict['auth'] = self.auth.to_dict() # override the default output from pydantic by calling `to_dict()` of posthog if self.posthog: - _dict["posthog"] = self.posthog.to_dict() + _dict['posthog'] = self.posthog.to_dict() return _dict @classmethod @@ -122,23 +93,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "auth": ( - APIMetaAuth.from_dict(obj["auth"]) - if obj.get("auth") is not None - else None - ), - "pylonAppId": obj.get("pylonAppId"), - "posthog": ( - APIMetaPosthog.from_dict(obj["posthog"]) - if obj.get("posthog") is not None - else None - ), - "allowSignup": obj.get("allowSignup"), - "allowInvites": obj.get("allowInvites"), - "allowCreateTenant": obj.get("allowCreateTenant"), - "allowChangePassword": obj.get("allowChangePassword"), - } - ) + _obj = cls.model_validate({ + "auth": APIMetaAuth.from_dict(obj["auth"]) if obj.get("auth") is not None else None, + "pylonAppId": obj.get("pylonAppId"), + "posthog": APIMetaPosthog.from_dict(obj["posthog"]) if obj.get("posthog") is not None else None, + "allowSignup": obj.get("allowSignup"), + "allowInvites": obj.get("allowInvites"), + "allowCreateTenant": obj.get("allowCreateTenant"), + "allowChangePassword": obj.get("allowChangePassword") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_meta_auth.py b/hatchet_sdk/clients/rest/models/api_meta_auth.py index 5ca29092..b2c2d6dc 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_auth.py +++ b/hatchet_sdk/clients/rest/models/api_meta_auth.py @@ -13,24 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class APIMetaAuth(BaseModel): """ APIMetaAuth - """ # noqa: E501 - - schemes: Optional[List[StrictStr]] = Field( - default=None, description="the supported types of authentication" - ) + """ # noqa: E501 + schemes: Optional[List[StrictStr]] = Field(default=None, description="the supported types of authentication") __properties: ClassVar[List[str]] = ["schemes"] model_config = ConfigDict( @@ -39,6 +35,7 @@ class APIMetaAuth(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"schemes": obj.get("schemes")}) + _obj = cls.model_validate({ + "schemes": obj.get("schemes") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_meta_integration.py b/hatchet_sdk/clients/rest/models/api_meta_integration.py index f4f361c9..136c4dd9 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_integration.py +++ b/hatchet_sdk/clients/rest/models/api_meta_integration.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class APIMetaIntegration(BaseModel): """ APIMetaIntegration - """ # noqa: E501 - + """ # noqa: E501 name: StrictStr = Field(description="the name of the integration") - enabled: StrictBool = Field( - description="whether this integration is enabled on the instance" - ) + enabled: StrictBool = Field(description="whether this integration is enabled on the instance") __properties: ClassVar[List[str]] = ["name", "enabled"] model_config = ConfigDict( @@ -40,6 +36,7 @@ class APIMetaIntegration(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "enabled": obj.get("enabled")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "enabled": obj.get("enabled") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_meta_posthog.py b/hatchet_sdk/clients/rest/models/api_meta_posthog.py index da6052c2..2fadf327 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_posthog.py +++ b/hatchet_sdk/clients/rest/models/api_meta_posthog.py @@ -13,27 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class APIMetaPosthog(BaseModel): """ APIMetaPosthog - """ # noqa: E501 - - api_key: Optional[StrictStr] = Field( - default=None, description="the PostHog API key", alias="apiKey" - ) - api_host: Optional[StrictStr] = Field( - default=None, description="the PostHog API host", alias="apiHost" - ) + """ # noqa: E501 + api_key: Optional[StrictStr] = Field(default=None, description="the PostHog API key", alias="apiKey") + api_host: Optional[StrictStr] = Field(default=None, description="the PostHog API host", alias="apiHost") __properties: ClassVar[List[str]] = ["apiKey", "apiHost"] model_config = ConfigDict( @@ -42,6 +36,7 @@ class APIMetaPosthog(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"apiKey": obj.get("apiKey"), "apiHost": obj.get("apiHost")} - ) + _obj = cls.model_validate({ + "apiKey": obj.get("apiKey"), + "apiHost": obj.get("apiHost") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_resource_meta.py b/hatchet_sdk/clients/rest/models/api_resource_meta.py index 8c353248..28dd305a 100644 --- a/hatchet_sdk/clients/rest/models/api_resource_meta.py +++ b/hatchet_sdk/clients/rest/models/api_resource_meta.py @@ -13,31 +13,24 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class APIResourceMeta(BaseModel): """ APIResourceMeta - """ # noqa: E501 - - id: Annotated[str, Field(min_length=0, strict=True, max_length=36)] = Field( - description="the id of this resource, in UUID format" - ) - created_at: datetime = Field( - description="the time that this resource was created", alias="createdAt" - ) - updated_at: datetime = Field( - description="the time that this resource was last updated", alias="updatedAt" - ) + """ # noqa: E501 + id: Annotated[str, Field(min_length=0, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") + created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") + updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] model_config = ConfigDict( @@ -46,6 +39,7 @@ class APIResourceMeta(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -70,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,11 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "createdAt": obj.get("createdAt"), - "updatedAt": obj.get("updatedAt"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/api_token.py b/hatchet_sdk/clients/rest/models/api_token.py index e469e3af..906666f4 100644 --- a/hatchet_sdk/clients/rest/models/api_token.py +++ b/hatchet_sdk/clients/rest/models/api_token.py @@ -13,31 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class APIToken(BaseModel): """ APIToken - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - name: Annotated[str, Field(strict=True, max_length=255)] = Field( - description="The name of the API token." - ) - expires_at: datetime = Field( - description="When the API token expires.", alias="expiresAt" - ) + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The name of the API token.") + expires_at: datetime = Field(description="When the API token expires.", alias="expiresAt") __properties: ClassVar[List[str]] = ["metadata", "name", "expiresAt"] model_config = ConfigDict( @@ -46,6 +40,7 @@ class APIToken(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -70,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -91,15 +87,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "expiresAt": obj.get("expiresAt"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "expiresAt": obj.get("expiresAt") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_api_token_request.py b/hatchet_sdk/clients/rest/models/create_api_token_request.py index 5614ef0a..0abb7afa 100644 --- a/hatchet_sdk/clients/rest/models/create_api_token_request.py +++ b/hatchet_sdk/clients/rest/models/create_api_token_request.py @@ -13,29 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class CreateAPITokenRequest(BaseModel): """ CreateAPITokenRequest - """ # noqa: E501 - - name: Annotated[str, Field(strict=True, max_length=255)] = Field( - description="A name for the API token." - ) - expires_in: Optional[StrictStr] = Field( - default=None, - description="The duration for which the token is valid.", - alias="expiresIn", - ) + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="A name for the API token.") + expires_in: Optional[StrictStr] = Field(default=None, description="The duration for which the token is valid.", alias="expiresIn") __properties: ClassVar[List[str]] = ["name", "expiresIn"] model_config = ConfigDict( @@ -44,6 +37,7 @@ class CreateAPITokenRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,7 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"name": obj.get("name"), "expiresIn": obj.get("expiresIn")} - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "expiresIn": obj.get("expiresIn") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_api_token_response.py b/hatchet_sdk/clients/rest/models/create_api_token_response.py index 2fb1e62d..c854d88a 100644 --- a/hatchet_sdk/clients/rest/models/create_api_token_response.py +++ b/hatchet_sdk/clients/rest/models/create_api_token_response.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class CreateAPITokenResponse(BaseModel): """ CreateAPITokenResponse - """ # noqa: E501 - + """ # noqa: E501 token: StrictStr = Field(description="The API token.") __properties: ClassVar[List[str]] = ["token"] @@ -37,6 +35,7 @@ class CreateAPITokenResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"token": obj.get("token")}) + _obj = cls.model_validate({ + "token": obj.get("token") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_event_request.py b/hatchet_sdk/clients/rest/models/create_event_request.py index adc37ce6..48e3f5be 100644 --- a/hatchet_sdk/clients/rest/models/create_event_request.py +++ b/hatchet_sdk/clients/rest/models/create_event_request.py @@ -13,28 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class CreateEventRequest(BaseModel): """ CreateEventRequest - """ # noqa: E501 - + """ # noqa: E501 key: StrictStr = Field(description="The key for the event.") data: Dict[str, Any] = Field(description="The data for the event.") - additional_metadata: Optional[Dict[str, Any]] = Field( - default=None, - description="Additional metadata for the event.", - alias="additionalMetadata", - ) + additional_metadata: Optional[Dict[str, Any]] = Field(default=None, description="Additional metadata for the event.", alias="additionalMetadata") __properties: ClassVar[List[str]] = ["key", "data", "additionalMetadata"] model_config = ConfigDict( @@ -43,6 +37,7 @@ class CreateEventRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "key": obj.get("key"), - "data": obj.get("data"), - "additionalMetadata": obj.get("additionalMetadata"), - } - ) + _obj = cls.model_validate({ + "key": obj.get("key"), + "data": obj.get("data"), + "additionalMetadata": obj.get("additionalMetadata") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py b/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py index 0984ff06..83bdd86b 100644 --- a/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py +++ b/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class CreatePullRequestFromStepRun(BaseModel): """ CreatePullRequestFromStepRun - """ # noqa: E501 - + """ # noqa: E501 branch_name: StrictStr = Field(alias="branchName") __properties: ClassVar[List[str]] = ["branchName"] @@ -37,6 +35,7 @@ class CreatePullRequestFromStepRun(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"branchName": obj.get("branchName")}) + _obj = cls.model_validate({ + "branchName": obj.get("branchName") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_sns_integration_request.py b/hatchet_sdk/clients/rest/models/create_sns_integration_request.py index ddb76cd1..6493f16f 100644 --- a/hatchet_sdk/clients/rest/models/create_sns_integration_request.py +++ b/hatchet_sdk/clients/rest/models/create_sns_integration_request.py @@ -13,24 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class CreateSNSIntegrationRequest(BaseModel): """ CreateSNSIntegrationRequest - """ # noqa: E501 - - topic_arn: StrictStr = Field( - description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn" - ) + """ # noqa: E501 + topic_arn: StrictStr = Field(description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn") __properties: ClassVar[List[str]] = ["topicArn"] model_config = ConfigDict( @@ -39,6 +35,7 @@ class CreateSNSIntegrationRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"topicArn": obj.get("topicArn")}) + _obj = cls.model_validate({ + "topicArn": obj.get("topicArn") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py b/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py index bc3a6953..e13ac4e7 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class CreateTenantAlertEmailGroupRequest(BaseModel): """ CreateTenantAlertEmailGroupRequest - """ # noqa: E501 - + """ # noqa: E501 emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["emails"] @@ -37,6 +35,7 @@ class CreateTenantAlertEmailGroupRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"emails": obj.get("emails")}) + _obj = cls.model_validate({ + "emails": obj.get("emails") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py b/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py index 83450b48..58951fd3 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole - +from typing import Optional, Set +from typing_extensions import Self class CreateTenantInviteRequest(BaseModel): """ CreateTenantInviteRequest - """ # noqa: E501 - + """ # noqa: E501 email: StrictStr = Field(description="The email of the user to invite.") role: TenantMemberRole = Field(description="The role of the user in the tenant.") __properties: ClassVar[List[str]] = ["email", "role"] @@ -40,6 +37,7 @@ class CreateTenantInviteRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,5 +81,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"email": obj.get("email"), "role": obj.get("role")}) + _obj = cls.model_validate({ + "email": obj.get("email"), + "role": obj.get("role") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/create_tenant_request.py b/hatchet_sdk/clients/rest/models/create_tenant_request.py index 84946f57..ec15b058 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class CreateTenantRequest(BaseModel): """ CreateTenantRequest - """ # noqa: E501 - + """ # noqa: E501 name: StrictStr = Field(description="The name of the tenant.") slug: StrictStr = Field(description="The slug of the tenant.") __properties: ClassVar[List[str]] = ["name", "slug"] @@ -38,6 +36,7 @@ class CreateTenantRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name"), "slug": obj.get("slug")}) + _obj = cls.model_validate({ + "name": obj.get("name"), + "slug": obj.get("slug") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/event.py b/hatchet_sdk/clients/rest/models/event.py index 4838a3ec..60887c34 100644 --- a/hatchet_sdk/clients/rest/models/event.py +++ b/hatchet_sdk/clients/rest/models/event.py @@ -13,53 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( - EventWorkflowRunSummary, -) +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary from hatchet_sdk.clients.rest.models.tenant import Tenant - +from typing import Optional, Set +from typing_extensions import Self class Event(BaseModel): """ Event - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta key: StrictStr = Field(description="The key for the event.") - tenant: Optional[Tenant] = Field( - default=None, description="The tenant associated with this event." - ) - tenant_id: StrictStr = Field( - description="The ID of the tenant associated with this event.", alias="tenantId" - ) - workflow_run_summary: Optional[EventWorkflowRunSummary] = Field( - default=None, - description="The workflow run summary for this event.", - alias="workflowRunSummary", - ) - additional_metadata: Optional[Dict[str, Any]] = Field( - default=None, - description="Additional metadata for the event.", - alias="additionalMetadata", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "key", - "tenant", - "tenantId", - "workflowRunSummary", - "additionalMetadata", - ] + tenant: Optional[Tenant] = Field(default=None, description="The tenant associated with this event.") + tenant_id: StrictStr = Field(description="The ID of the tenant associated with this event.", alias="tenantId") + workflow_run_summary: Optional[EventWorkflowRunSummary] = Field(default=None, description="The workflow run summary for this event.", alias="workflowRunSummary") + additional_metadata: Optional[Dict[str, Any]] = Field(default=None, description="Additional metadata for the event.", alias="additionalMetadata") + __properties: ClassVar[List[str]] = ["metadata", "key", "tenant", "tenantId", "workflowRunSummary", "additionalMetadata"] model_config = ConfigDict( populate_by_name=True, @@ -67,6 +43,7 @@ class Event(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -91,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -100,13 +78,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of tenant if self.tenant: - _dict["tenant"] = self.tenant.to_dict() + _dict['tenant'] = self.tenant.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_run_summary if self.workflow_run_summary: - _dict["workflowRunSummary"] = self.workflow_run_summary.to_dict() + _dict['workflowRunSummary'] = self.workflow_run_summary.to_dict() return _dict @classmethod @@ -118,26 +96,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "key": obj.get("key"), - "tenant": ( - Tenant.from_dict(obj["tenant"]) - if obj.get("tenant") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "workflowRunSummary": ( - EventWorkflowRunSummary.from_dict(obj["workflowRunSummary"]) - if obj.get("workflowRunSummary") is not None - else None - ), - "additionalMetadata": obj.get("additionalMetadata"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "key": obj.get("key"), + "tenant": Tenant.from_dict(obj["tenant"]) if obj.get("tenant") is not None else None, + "tenantId": obj.get("tenantId"), + "workflowRunSummary": EventWorkflowRunSummary.from_dict(obj["workflowRunSummary"]) if obj.get("workflowRunSummary") is not None else None, + "additionalMetadata": obj.get("additionalMetadata") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/event_data.py b/hatchet_sdk/clients/rest/models/event_data.py index eb0d6128..46b47c1e 100644 --- a/hatchet_sdk/clients/rest/models/event_data.py +++ b/hatchet_sdk/clients/rest/models/event_data.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class EventData(BaseModel): """ EventData - """ # noqa: E501 - + """ # noqa: E501 data: StrictStr = Field(description="The data for the event (JSON bytes).") __properties: ClassVar[List[str]] = ["data"] @@ -37,6 +35,7 @@ class EventData(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"data": obj.get("data")}) + _obj = cls.model_validate({ + "data": obj.get("data") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/event_key_list.py b/hatchet_sdk/clients/rest/models/event_key_list.py index c56595ae..f51733d9 100644 --- a/hatchet_sdk/clients/rest/models/event_key_list.py +++ b/hatchet_sdk/clients/rest/models/event_key_list.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse - +from typing import Optional, Set +from typing_extensions import Self class EventKeyList(BaseModel): """ EventKeyList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -40,6 +37,7 @@ class EventKeyList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod @@ -85,14 +84,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": obj.get("rows"), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": obj.get("rows") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/event_list.py b/hatchet_sdk/clients/rest/models/event_list.py index e12aa656..6855428c 100644 --- a/hatchet_sdk/clients/rest/models/event_list.py +++ b/hatchet_sdk/clients/rest/models/event_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse - +from typing import Optional, Set +from typing_extensions import Self class EventList(BaseModel): """ EventList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[Event]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class EventList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [Event.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [Event.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/event_order_by_direction.py b/hatchet_sdk/clients/rest/models/event_order_by_direction.py index 24255e0d..6af67b0f 100644 --- a/hatchet_sdk/clients/rest/models/event_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/event_order_by_direction.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,10 +26,12 @@ class EventOrderByDirection(str, Enum): """ allowed enum values """ - ASC = "asc" - DESC = "desc" + ASC = 'asc' + DESC = 'desc' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of EventOrderByDirection from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/event_order_by_field.py b/hatchet_sdk/clients/rest/models/event_order_by_field.py index da2193c3..a053f559 100644 --- a/hatchet_sdk/clients/rest/models/event_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/event_order_by_field.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,9 +26,11 @@ class EventOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = "createdAt" + CREATEDAT = 'createdAt' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of EventOrderByField from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py b/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py index 83fb38d7..1b9aaeee 100644 --- a/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py +++ b/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py @@ -13,43 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class EventWorkflowRunSummary(BaseModel): """ EventWorkflowRunSummary - """ # noqa: E501 - - pending: Optional[StrictInt] = Field( - default=None, description="The number of pending runs." - ) - running: Optional[StrictInt] = Field( - default=None, description="The number of running runs." - ) - queued: Optional[StrictInt] = Field( - default=None, description="The number of queued runs." - ) - succeeded: Optional[StrictInt] = Field( - default=None, description="The number of succeeded runs." - ) - failed: Optional[StrictInt] = Field( - default=None, description="The number of failed runs." - ) - __properties: ClassVar[List[str]] = [ - "pending", - "running", - "queued", - "succeeded", - "failed", - ] + """ # noqa: E501 + pending: Optional[StrictInt] = Field(default=None, description="The number of pending runs.") + running: Optional[StrictInt] = Field(default=None, description="The number of running runs.") + queued: Optional[StrictInt] = Field(default=None, description="The number of queued runs.") + succeeded: Optional[StrictInt] = Field(default=None, description="The number of succeeded runs.") + failed: Optional[StrictInt] = Field(default=None, description="The number of failed runs.") + __properties: ClassVar[List[str]] = ["pending", "running", "queued", "succeeded", "failed"] model_config = ConfigDict( populate_by_name=True, @@ -57,6 +39,7 @@ class EventWorkflowRunSummary(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -81,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -99,13 +83,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pending": obj.get("pending"), - "running": obj.get("running"), - "queued": obj.get("queued"), - "succeeded": obj.get("succeeded"), - "failed": obj.get("failed"), - } - ) + _obj = cls.model_validate({ + "pending": obj.get("pending"), + "running": obj.get("running"), + "queued": obj.get("queued"), + "succeeded": obj.get("succeeded"), + "failed": obj.get("failed") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py index c01018b6..70666204 100644 --- a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +++ b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.step_run_diff import StepRunDiff - +from typing import Optional, Set +from typing_extensions import Self class GetStepRunDiffResponse(BaseModel): """ GetStepRunDiffResponse - """ # noqa: E501 - + """ # noqa: E501 diffs: List[StepRunDiff] __properties: ClassVar[List[str]] = ["diffs"] @@ -39,6 +36,7 @@ class GetStepRunDiffResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.diffs: if _item: _items.append(_item.to_dict()) - _dict["diffs"] = _items + _dict['diffs'] = _items return _dict @classmethod @@ -88,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "diffs": ( - [StepRunDiff.from_dict(_item) for _item in obj["diffs"]] - if obj.get("diffs") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "diffs": [StepRunDiff.from_dict(_item) for _item in obj["diffs"]] if obj.get("diffs") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/job.py b/hatchet_sdk/clients/rest/models/job.py index aceaf6f4..94f897ad 100644 --- a/hatchet_sdk/clients/rest/models/job.py +++ b/hatchet_sdk/clients/rest/models/job.py @@ -13,44 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step import Step - +from typing import Optional, Set +from typing_extensions import Self class Job(BaseModel): """ Job - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") version_id: StrictStr = Field(alias="versionId") name: StrictStr - description: Optional[StrictStr] = Field( - default=None, description="The description of the job." - ) + description: Optional[StrictStr] = Field(default=None, description="The description of the job.") steps: List[Step] - timeout: Optional[StrictStr] = Field( - default=None, description="The timeout of the job." - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "versionId", - "name", - "description", - "steps", - "timeout", - ] + timeout: Optional[StrictStr] = Field(default=None, description="The timeout of the job.") + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "versionId", "name", "description", "steps", "timeout"] model_config = ConfigDict( populate_by_name=True, @@ -58,6 +43,7 @@ class Job(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -82,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,14 +78,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict["steps"] = _items + _dict['steps'] = _items return _dict @classmethod @@ -110,23 +97,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "versionId": obj.get("versionId"), - "name": obj.get("name"), - "description": obj.get("description"), - "steps": ( - [Step.from_dict(_item) for _item in obj["steps"]] - if obj.get("steps") is not None - else None - ), - "timeout": obj.get("timeout"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "versionId": obj.get("versionId"), + "name": obj.get("name"), + "description": obj.get("description"), + "steps": [Step.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, + "timeout": obj.get("timeout") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/job_run.py b/hatchet_sdk/clients/rest/models/job_run.py index a9b0da3b..a3afd3b0 100644 --- a/hatchet_sdk/clients/rest/models/job_run.py +++ b/hatchet_sdk/clients/rest/models/job_run.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus - +from typing import Optional, Set +from typing_extensions import Self class JobRun(BaseModel): """ JobRun - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") workflow_run_id: StrictStr = Field(alias="workflowRunId") @@ -49,24 +46,7 @@ class JobRun(BaseModel): cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "workflowRunId", - "workflowRun", - "jobId", - "job", - "tickerId", - "stepRuns", - "status", - "result", - "startedAt", - "finishedAt", - "timeoutAt", - "cancelledAt", - "cancelledReason", - "cancelledError", - ] + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "workflowRunId", "workflowRun", "jobId", "job", "tickerId", "stepRuns", "status", "result", "startedAt", "finishedAt", "timeoutAt", "cancelledAt", "cancelledReason", "cancelledError"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +54,7 @@ class JobRun(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -98,7 +79,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -107,20 +89,20 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_run if self.workflow_run: - _dict["workflowRun"] = self.workflow_run.to_dict() + _dict['workflowRun'] = self.workflow_run.to_dict() # override the default output from pydantic by calling `to_dict()` of job if self.job: - _dict["job"] = self.job.to_dict() + _dict['job'] = self.job.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in step_runs (list) _items = [] if self.step_runs: for _item in self.step_runs: if _item: _items.append(_item.to_dict()) - _dict["stepRuns"] = _items + _dict['stepRuns'] = _items return _dict @classmethod @@ -132,45 +114,28 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "workflowRunId": obj.get("workflowRunId"), - "workflowRun": ( - WorkflowRun.from_dict(obj["workflowRun"]) - if obj.get("workflowRun") is not None - else None - ), - "jobId": obj.get("jobId"), - "job": ( - Job.from_dict(obj["job"]) if obj.get("job") is not None else None - ), - "tickerId": obj.get("tickerId"), - "stepRuns": ( - [StepRun.from_dict(_item) for _item in obj["stepRuns"]] - if obj.get("stepRuns") is not None - else None - ), - "status": obj.get("status"), - "result": obj.get("result"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "timeoutAt": obj.get("timeoutAt"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "workflowRunId": obj.get("workflowRunId"), + "workflowRun": WorkflowRun.from_dict(obj["workflowRun"]) if obj.get("workflowRun") is not None else None, + "jobId": obj.get("jobId"), + "job": Job.from_dict(obj["job"]) if obj.get("job") is not None else None, + "tickerId": obj.get("tickerId"), + "stepRuns": [StepRun.from_dict(_item) for _item in obj["stepRuns"]] if obj.get("stepRuns") is not None else None, + "status": obj.get("status"), + "result": obj.get("result"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "timeoutAt": obj.get("timeoutAt"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError") + }) return _obj - from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun - # TODO: Rewrite to not use raise_errors JobRun.model_rebuild(raise_errors=False) + diff --git a/hatchet_sdk/clients/rest/models/job_run_status.py b/hatchet_sdk/clients/rest/models/job_run_status.py index 3952edf0..4036f345 100644 --- a/hatchet_sdk/clients/rest/models/job_run_status.py +++ b/hatchet_sdk/clients/rest/models/job_run_status.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,13 +26,15 @@ class JobRunStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - RUNNING = "RUNNING" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" + PENDING = 'PENDING' + RUNNING = 'RUNNING' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' + CANCELLED = 'CANCELLED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of JobRunStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py index df9b60ac..fe7cbc5c 100644 --- a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py +++ b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_token import APIToken from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse - +from typing import Optional, Set +from typing_extensions import Self class ListAPITokensResponse(BaseModel): """ ListAPITokensResponse - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[APIToken]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class ListAPITokensResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [APIToken.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [APIToken.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py index 6cfd61bb..cf7188e0 100644 --- a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py +++ b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.pull_request import PullRequest - +from typing import Optional, Set +from typing_extensions import Self class ListPullRequestsResponse(BaseModel): """ ListPullRequestsResponse - """ # noqa: E501 - + """ # noqa: E501 pull_requests: List[PullRequest] = Field(alias="pullRequests") __properties: ClassVar[List[str]] = ["pullRequests"] @@ -39,6 +36,7 @@ class ListPullRequestsResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.pull_requests: if _item: _items.append(_item.to_dict()) - _dict["pullRequests"] = _items + _dict['pullRequests'] = _items return _dict @classmethod @@ -88,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pullRequests": ( - [PullRequest.from_dict(_item) for _item in obj["pullRequests"]] - if obj.get("pullRequests") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "pullRequests": [PullRequest.from_dict(_item) for _item in obj["pullRequests"]] if obj.get("pullRequests") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py index 647bc276..3c448183 100644 --- a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py +++ b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook - +from typing import Optional, Set +from typing_extensions import Self class ListSlackWebhooks(BaseModel): """ ListSlackWebhooks - """ # noqa: E501 - + """ # noqa: E501 pagination: PaginationResponse rows: List[SlackWebhook] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class ListSlackWebhooks(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [SlackWebhook.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [SlackWebhook.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/list_sns_integrations.py b/hatchet_sdk/clients/rest/models/list_sns_integrations.py index ecf67484..28602f47 100644 --- a/hatchet_sdk/clients/rest/models/list_sns_integrations.py +++ b/hatchet_sdk/clients/rest/models/list_sns_integrations.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration - +from typing import Optional, Set +from typing_extensions import Self class ListSNSIntegrations(BaseModel): """ ListSNSIntegrations - """ # noqa: E501 - + """ # noqa: E501 pagination: PaginationResponse rows: List[SNSIntegration] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class ListSNSIntegrations(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [SNSIntegration.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [SNSIntegration.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/log_line.py b/hatchet_sdk/clients/rest/models/log_line.py index ee4299cf..21c8b4be 100644 --- a/hatchet_sdk/clients/rest/models/log_line.py +++ b/hatchet_sdk/clients/rest/models/log_line.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class LogLine(BaseModel): """ LogLine - """ # noqa: E501 - - created_at: datetime = Field( - description="The creation date of the log line.", alias="createdAt" - ) + """ # noqa: E501 + created_at: datetime = Field(description="The creation date of the log line.", alias="createdAt") message: StrictStr = Field(description="The log message.") metadata: Dict[str, Any] = Field(description="The log metadata.") __properties: ClassVar[List[str]] = ["createdAt", "message", "metadata"] @@ -42,6 +38,7 @@ class LogLine(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "createdAt": obj.get("createdAt"), - "message": obj.get("message"), - "metadata": obj.get("metadata"), - } - ) + _obj = cls.model_validate({ + "createdAt": obj.get("createdAt"), + "message": obj.get("message"), + "metadata": obj.get("metadata") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/log_line_level.py b/hatchet_sdk/clients/rest/models/log_line_level.py index 63fbec41..daba89ed 100644 --- a/hatchet_sdk/clients/rest/models/log_line_level.py +++ b/hatchet_sdk/clients/rest/models/log_line_level.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,12 +26,14 @@ class LogLineLevel(str, Enum): """ allowed enum values """ - DEBUG = "DEBUG" - INFO = "INFO" - WARN = "WARN" - ERROR = "ERROR" + DEBUG = 'DEBUG' + INFO = 'INFO' + WARN = 'WARN' + ERROR = 'ERROR' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineLevel from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/log_line_list.py b/hatchet_sdk/clients/rest/models/log_line_list.py index 306ee2c7..2d93d5a9 100644 --- a/hatchet_sdk/clients/rest/models/log_line_list.py +++ b/hatchet_sdk/clients/rest/models/log_line_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse - +from typing import Optional, Set +from typing_extensions import Self class LogLineList(BaseModel): """ LogLineList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[LogLine]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class LogLineList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [LogLine.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [LogLine.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py b/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py index 5f66f59b..6c25dae7 100644 --- a/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,10 +26,12 @@ class LogLineOrderByDirection(str, Enum): """ allowed enum values """ - ASC = "asc" - DESC = "desc" + ASC = 'asc' + DESC = 'desc' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineOrderByDirection from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/log_line_order_by_field.py b/hatchet_sdk/clients/rest/models/log_line_order_by_field.py index 93b92526..f0cb01d3 100644 --- a/hatchet_sdk/clients/rest/models/log_line_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/log_line_order_by_field.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,9 +26,11 @@ class LogLineOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = "createdAt" + CREATEDAT = 'createdAt' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineOrderByField from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/pagination_response.py b/hatchet_sdk/clients/rest/models/pagination_response.py index 2994dee9..8d1ebd1e 100644 --- a/hatchet_sdk/clients/rest/models/pagination_response.py +++ b/hatchet_sdk/clients/rest/models/pagination_response.py @@ -13,28 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class PaginationResponse(BaseModel): """ PaginationResponse - """ # noqa: E501 - - current_page: Optional[StrictInt] = Field( - default=None, description="the current page" - ) + """ # noqa: E501 + current_page: Optional[StrictInt] = Field(default=None, description="the current page") next_page: Optional[StrictInt] = Field(default=None, description="the next page") - num_pages: Optional[StrictInt] = Field( - default=None, description="the total number of pages for listing" - ) + num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] model_config = ConfigDict( @@ -43,6 +37,7 @@ class PaginationResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "current_page": obj.get("current_page"), - "next_page": obj.get("next_page"), - "num_pages": obj.get("num_pages"), - } - ) + _obj = cls.model_validate({ + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/pull_request.py b/hatchet_sdk/clients/rest/models/pull_request.py index c1462591..a9c91220 100644 --- a/hatchet_sdk/clients/rest/models/pull_request.py +++ b/hatchet_sdk/clients/rest/models/pull_request.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState - +from typing import Optional, Set +from typing_extensions import Self class PullRequest(BaseModel): """ PullRequest - """ # noqa: E501 - + """ # noqa: E501 repository_owner: StrictStr = Field(alias="repositoryOwner") repository_name: StrictStr = Field(alias="repositoryName") pull_request_id: StrictInt = Field(alias="pullRequestID") @@ -38,16 +35,7 @@ class PullRequest(BaseModel): pull_request_head_branch: StrictStr = Field(alias="pullRequestHeadBranch") pull_request_base_branch: StrictStr = Field(alias="pullRequestBaseBranch") pull_request_state: PullRequestState = Field(alias="pullRequestState") - __properties: ClassVar[List[str]] = [ - "repositoryOwner", - "repositoryName", - "pullRequestID", - "pullRequestTitle", - "pullRequestNumber", - "pullRequestHeadBranch", - "pullRequestBaseBranch", - "pullRequestState", - ] + __properties: ClassVar[List[str]] = ["repositoryOwner", "repositoryName", "pullRequestID", "pullRequestTitle", "pullRequestNumber", "pullRequestHeadBranch", "pullRequestBaseBranch", "pullRequestState"] model_config = ConfigDict( populate_by_name=True, @@ -55,6 +43,7 @@ class PullRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -79,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -97,16 +87,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "repositoryOwner": obj.get("repositoryOwner"), - "repositoryName": obj.get("repositoryName"), - "pullRequestID": obj.get("pullRequestID"), - "pullRequestTitle": obj.get("pullRequestTitle"), - "pullRequestNumber": obj.get("pullRequestNumber"), - "pullRequestHeadBranch": obj.get("pullRequestHeadBranch"), - "pullRequestBaseBranch": obj.get("pullRequestBaseBranch"), - "pullRequestState": obj.get("pullRequestState"), - } - ) + _obj = cls.model_validate({ + "repositoryOwner": obj.get("repositoryOwner"), + "repositoryName": obj.get("repositoryName"), + "pullRequestID": obj.get("pullRequestID"), + "pullRequestTitle": obj.get("pullRequestTitle"), + "pullRequestNumber": obj.get("pullRequestNumber"), + "pullRequestHeadBranch": obj.get("pullRequestHeadBranch"), + "pullRequestBaseBranch": obj.get("pullRequestBaseBranch"), + "pullRequestState": obj.get("pullRequestState") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/pull_request_state.py b/hatchet_sdk/clients/rest/models/pull_request_state.py index a44d06cc..9cd42f0c 100644 --- a/hatchet_sdk/clients/rest/models/pull_request_state.py +++ b/hatchet_sdk/clients/rest/models/pull_request_state.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,10 +26,12 @@ class PullRequestState(str, Enum): """ allowed enum values """ - OPEN = "open" - CLOSED = "closed" + OPEN = 'open' + CLOSED = 'closed' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of PullRequestState from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/queue_metrics.py b/hatchet_sdk/clients/rest/models/queue_metrics.py index d19066dd..fe45d680 100644 --- a/hatchet_sdk/clients/rest/models/queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/queue_metrics.py @@ -13,30 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class QueueMetrics(BaseModel): """ QueueMetrics - """ # noqa: E501 - - num_queued: StrictInt = Field( - description="The number of items in the queue.", alias="numQueued" - ) - num_running: StrictInt = Field( - description="The number of items running.", alias="numRunning" - ) - num_pending: StrictInt = Field( - description="The number of items pending.", alias="numPending" - ) + """ # noqa: E501 + num_queued: StrictInt = Field(description="The number of items in the queue.", alias="numQueued") + num_running: StrictInt = Field(description="The number of items running.", alias="numRunning") + num_pending: StrictInt = Field(description="The number of items pending.", alias="numPending") __properties: ClassVar[List[str]] = ["numQueued", "numRunning", "numPending"] model_config = ConfigDict( @@ -45,6 +37,7 @@ class QueueMetrics(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "numQueued": obj.get("numQueued"), - "numRunning": obj.get("numRunning"), - "numPending": obj.get("numPending"), - } - ) + _obj = cls.model_validate({ + "numQueued": obj.get("numQueued"), + "numRunning": obj.get("numRunning"), + "numPending": obj.get("numPending") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/recent_step_runs.py b/hatchet_sdk/clients/rest/models/recent_step_runs.py index 9b8a8249..c9354e92 100644 --- a/hatchet_sdk/clients/rest/models/recent_step_runs.py +++ b/hatchet_sdk/clients/rest/models/recent_step_runs.py @@ -13,25 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus - +from typing import Optional, Set +from typing_extensions import Self class RecentStepRuns(BaseModel): """ RecentStepRuns - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta action_id: StrictStr = Field(description="The action id.", alias="actionId") status: StepRunStatus @@ -39,15 +36,7 @@ class RecentStepRuns(BaseModel): finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") workflow_run_id: StrictStr = Field(alias="workflowRunId") - __properties: ClassVar[List[str]] = [ - "metadata", - "actionId", - "status", - "startedAt", - "finishedAt", - "cancelledAt", - "workflowRunId", - ] + __properties: ClassVar[List[str]] = ["metadata", "actionId", "status", "startedAt", "finishedAt", "cancelledAt", "workflowRunId"] model_config = ConfigDict( populate_by_name=True, @@ -55,6 +44,7 @@ class RecentStepRuns(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -79,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -100,19 +91,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "actionId": obj.get("actionId"), - "status": obj.get("status"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "cancelledAt": obj.get("cancelledAt"), - "workflowRunId": obj.get("workflowRunId"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "actionId": obj.get("actionId"), + "status": obj.get("status"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "cancelledAt": obj.get("cancelledAt"), + "workflowRunId": obj.get("workflowRunId") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/reject_invite_request.py b/hatchet_sdk/clients/rest/models/reject_invite_request.py index 13399345..e863e602 100644 --- a/hatchet_sdk/clients/rest/models/reject_invite_request.py +++ b/hatchet_sdk/clients/rest/models/reject_invite_request.py @@ -13,21 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class RejectInviteRequest(BaseModel): """ RejectInviteRequest - """ # noqa: E501 - + """ # noqa: E501 invite: Annotated[str, Field(min_length=36, strict=True, max_length=36)] __properties: ClassVar[List[str]] = ["invite"] @@ -37,6 +36,7 @@ class RejectInviteRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"invite": obj.get("invite")}) + _obj = cls.model_validate({ + "invite": obj.get("invite") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/replay_event_request.py b/hatchet_sdk/clients/rest/models/replay_event_request.py index 0a5ef723..9f91abf8 100644 --- a/hatchet_sdk/clients/rest/models/replay_event_request.py +++ b/hatchet_sdk/clients/rest/models/replay_event_request.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ReplayEventRequest(BaseModel): """ ReplayEventRequest - """ # noqa: E501 - - event_ids: List[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field(alias="eventIds") + """ # noqa: E501 + event_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="eventIds") __properties: ClassVar[List[str]] = ["eventIds"] model_config = ConfigDict( @@ -39,6 +36,7 @@ class ReplayEventRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"eventIds": obj.get("eventIds")}) + _obj = cls.model_validate({ + "eventIds": obj.get("eventIds") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py b/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py index de5b2797..f30b784c 100644 --- a/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py +++ b/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ReplayWorkflowRunsRequest(BaseModel): """ ReplayWorkflowRunsRequest - """ # noqa: E501 - - workflow_run_ids: List[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field(alias="workflowRunIds") + """ # noqa: E501 + workflow_run_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -39,6 +36,7 @@ class ReplayWorkflowRunsRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) + _obj = cls.model_validate({ + "workflowRunIds": obj.get("workflowRunIds") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py index 6f0f780f..1b84adcc 100644 --- a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +++ b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun - +from typing import Optional, Set +from typing_extensions import Self class ReplayWorkflowRunsResponse(BaseModel): """ ReplayWorkflowRunsResponse - """ # noqa: E501 - + """ # noqa: E501 workflow_runs: List[WorkflowRun] = Field(alias="workflowRuns") __properties: ClassVar[List[str]] = ["workflowRuns"] @@ -39,6 +36,7 @@ class ReplayWorkflowRunsResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.workflow_runs: if _item: _items.append(_item.to_dict()) - _dict["workflowRuns"] = _items + _dict['workflowRuns'] = _items return _dict @classmethod @@ -88,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "workflowRuns": ( - [WorkflowRun.from_dict(_item) for _item in obj["workflowRuns"]] - if obj.get("workflowRuns") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "workflowRuns": [WorkflowRun.from_dict(_item) for _item in obj["workflowRuns"]] if obj.get("workflowRuns") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/rerun_step_run_request.py b/hatchet_sdk/clients/rest/models/rerun_step_run_request.py index f8b28066..2dab0f68 100644 --- a/hatchet_sdk/clients/rest/models/rerun_step_run_request.py +++ b/hatchet_sdk/clients/rest/models/rerun_step_run_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class RerunStepRunRequest(BaseModel): """ RerunStepRunRequest - """ # noqa: E501 - + """ # noqa: E501 input: Dict[str, Any] __properties: ClassVar[List[str]] = ["input"] @@ -37,6 +35,7 @@ class RerunStepRunRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"input": obj.get("input")}) + _obj = cls.model_validate({ + "input": obj.get("input") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/semaphore_slots.py b/hatchet_sdk/clients/rest/models/semaphore_slots.py index 1ca45f37..65ea8e7f 100644 --- a/hatchet_sdk/clients/rest/models/semaphore_slots.py +++ b/hatchet_sdk/clients/rest/models/semaphore_slots.py @@ -13,50 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus - +from typing import Optional, Set +from typing_extensions import Self class SemaphoreSlots(BaseModel): """ SemaphoreSlots - """ # noqa: E501 - + """ # noqa: E501 slot: StrictStr = Field(description="The slot name.") - step_run_id: Optional[StrictStr] = Field( - default=None, description="The step run id.", alias="stepRunId" - ) - action_id: Optional[StrictStr] = Field( - default=None, description="The action id.", alias="actionId" - ) - started_at: Optional[datetime] = Field( - default=None, description="The time this slot was started.", alias="startedAt" - ) - timeout_at: Optional[datetime] = Field( - default=None, description="The time this slot will timeout.", alias="timeoutAt" - ) - workflow_run_id: Optional[StrictStr] = Field( - default=None, description="The workflow run id.", alias="workflowRunId" - ) + step_run_id: Optional[StrictStr] = Field(default=None, description="The step run id.", alias="stepRunId") + action_id: Optional[StrictStr] = Field(default=None, description="The action id.", alias="actionId") + started_at: Optional[datetime] = Field(default=None, description="The time this slot was started.", alias="startedAt") + timeout_at: Optional[datetime] = Field(default=None, description="The time this slot will timeout.", alias="timeoutAt") + workflow_run_id: Optional[StrictStr] = Field(default=None, description="The workflow run id.", alias="workflowRunId") status: Optional[StepRunStatus] = None - __properties: ClassVar[List[str]] = [ - "slot", - "stepRunId", - "actionId", - "startedAt", - "timeoutAt", - "workflowRunId", - "status", - ] + __properties: ClassVar[List[str]] = ["slot", "stepRunId", "actionId", "startedAt", "timeoutAt", "workflowRunId", "status"] model_config = ConfigDict( populate_by_name=True, @@ -64,6 +43,7 @@ class SemaphoreSlots(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -88,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -106,15 +87,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "slot": obj.get("slot"), - "stepRunId": obj.get("stepRunId"), - "actionId": obj.get("actionId"), - "startedAt": obj.get("startedAt"), - "timeoutAt": obj.get("timeoutAt"), - "workflowRunId": obj.get("workflowRunId"), - "status": obj.get("status"), - } - ) + _obj = cls.model_validate({ + "slot": obj.get("slot"), + "stepRunId": obj.get("stepRunId"), + "actionId": obj.get("actionId"), + "startedAt": obj.get("startedAt"), + "timeoutAt": obj.get("timeoutAt"), + "workflowRunId": obj.get("workflowRunId"), + "status": obj.get("status") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/slack_webhook.py b/hatchet_sdk/clients/rest/models/slack_webhook.py index 6cc3f4c8..a793410a 100644 --- a/hatchet_sdk/clients/rest/models/slack_webhook.py +++ b/hatchet_sdk/clients/rest/models/slack_webhook.py @@ -13,51 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class SlackWebhook(BaseModel): """ SlackWebhook - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - tenant_id: StrictStr = Field( - description="The unique identifier for the tenant that the SNS integration belongs to.", - alias="tenantId", - ) - team_name: StrictStr = Field( - description="The team name associated with this slack webhook.", - alias="teamName", - ) - team_id: StrictStr = Field( - description="The team id associated with this slack webhook.", alias="teamId" - ) - channel_name: StrictStr = Field( - description="The channel name associated with this slack webhook.", - alias="channelName", - ) - channel_id: StrictStr = Field( - description="The channel id associated with this slack webhook.", - alias="channelId", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "teamName", - "teamId", - "channelName", - "channelId", - ] + tenant_id: StrictStr = Field(description="The unique identifier for the tenant that the SNS integration belongs to.", alias="tenantId") + team_name: StrictStr = Field(description="The team name associated with this slack webhook.", alias="teamName") + team_id: StrictStr = Field(description="The team id associated with this slack webhook.", alias="teamId") + channel_name: StrictStr = Field(description="The channel name associated with this slack webhook.", alias="channelName") + channel_id: StrictStr = Field(description="The channel id associated with this slack webhook.", alias="channelId") + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "teamName", "teamId", "channelName", "channelId"] model_config = ConfigDict( populate_by_name=True, @@ -65,6 +41,7 @@ class SlackWebhook(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -89,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -98,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -110,18 +88,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "teamName": obj.get("teamName"), - "teamId": obj.get("teamId"), - "channelName": obj.get("channelName"), - "channelId": obj.get("channelId"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "teamName": obj.get("teamName"), + "teamId": obj.get("teamId"), + "channelName": obj.get("channelName"), + "channelId": obj.get("channelId") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/sns_integration.py b/hatchet_sdk/clients/rest/models/sns_integration.py index 7fcda4aa..e6f53045 100644 --- a/hatchet_sdk/clients/rest/models/sns_integration.py +++ b/hatchet_sdk/clients/rest/models/sns_integration.py @@ -13,40 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class SNSIntegration(BaseModel): """ SNSIntegration - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - tenant_id: StrictStr = Field( - description="The unique identifier for the tenant that the SNS integration belongs to.", - alias="tenantId", - ) - topic_arn: StrictStr = Field( - description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn" - ) - ingest_url: Optional[StrictStr] = Field( - default=None, description="The URL to send SNS messages to.", alias="ingestUrl" - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "topicArn", - "ingestUrl", - ] + tenant_id: StrictStr = Field(description="The unique identifier for the tenant that the SNS integration belongs to.", alias="tenantId") + topic_arn: StrictStr = Field(description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn") + ingest_url: Optional[StrictStr] = Field(default=None, description="The URL to send SNS messages to.", alias="ingestUrl") + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "topicArn", "ingestUrl"] model_config = ConfigDict( populate_by_name=True, @@ -54,6 +39,7 @@ class SNSIntegration(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -78,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -99,16 +86,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "topicArn": obj.get("topicArn"), - "ingestUrl": obj.get("ingestUrl"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "topicArn": obj.get("topicArn"), + "ingestUrl": obj.get("ingestUrl") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step.py b/hatchet_sdk/clients/rest/models/step.py index 2014b7e9..ca22dee0 100644 --- a/hatchet_sdk/clients/rest/models/step.py +++ b/hatchet_sdk/clients/rest/models/step.py @@ -13,45 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class Step(BaseModel): """ Step - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - readable_id: StrictStr = Field( - description="The readable id of the step.", alias="readableId" - ) + readable_id: StrictStr = Field(description="The readable id of the step.", alias="readableId") tenant_id: StrictStr = Field(alias="tenantId") job_id: StrictStr = Field(alias="jobId") action: StrictStr - timeout: Optional[StrictStr] = Field( - default=None, description="The timeout of the step." - ) + timeout: Optional[StrictStr] = Field(default=None, description="The timeout of the step.") children: Optional[List[StrictStr]] = None parents: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "metadata", - "readableId", - "tenantId", - "jobId", - "action", - "timeout", - "children", - "parents", - ] + __properties: ClassVar[List[str]] = ["metadata", "readableId", "tenantId", "jobId", "action", "timeout", "children", "parents"] model_config = ConfigDict( populate_by_name=True, @@ -59,6 +43,7 @@ class Step(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -83,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -92,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -104,20 +90,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "readableId": obj.get("readableId"), - "tenantId": obj.get("tenantId"), - "jobId": obj.get("jobId"), - "action": obj.get("action"), - "timeout": obj.get("timeout"), - "children": obj.get("children"), - "parents": obj.get("parents"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "readableId": obj.get("readableId"), + "tenantId": obj.get("tenantId"), + "jobId": obj.get("jobId"), + "action": obj.get("action"), + "timeout": obj.get("timeout"), + "children": obj.get("children"), + "parents": obj.get("parents") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run.py b/hatchet_sdk/clients/rest/models/step_run.py index 7fa8d91a..5de2a87d 100644 --- a/hatchet_sdk/clients/rest/models/step_run.py +++ b/hatchet_sdk/clients/rest/models/step_run.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus - +from typing import Optional, Set +from typing_extensions import Self class StepRun(BaseModel): """ StepRun - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") job_run_id: StrictStr = Field(alias="jobRunId") @@ -41,9 +38,7 @@ class StepRun(BaseModel): step: Optional[Step] = None children: Optional[List[StrictStr]] = None parents: Optional[List[StrictStr]] = None - child_workflow_runs: Optional[List[StrictStr]] = Field( - default=None, alias="childWorkflowRuns" - ) + child_workflow_runs: Optional[List[StrictStr]] = Field(default=None, alias="childWorkflowRuns") worker_id: Optional[StrictStr] = Field(default=None, alias="workerId") input: Optional[StrictStr] = None output: Optional[StrictStr] = None @@ -54,45 +49,14 @@ class StepRun(BaseModel): started_at: Optional[datetime] = Field(default=None, alias="startedAt") started_at_epoch: Optional[StrictInt] = Field(default=None, alias="startedAtEpoch") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") - finished_at_epoch: Optional[StrictInt] = Field( - default=None, alias="finishedAtEpoch" - ) + finished_at_epoch: Optional[StrictInt] = Field(default=None, alias="finishedAtEpoch") timeout_at: Optional[datetime] = Field(default=None, alias="timeoutAt") timeout_at_epoch: Optional[StrictInt] = Field(default=None, alias="timeoutAtEpoch") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") - cancelled_at_epoch: Optional[StrictInt] = Field( - default=None, alias="cancelledAtEpoch" - ) + cancelled_at_epoch: Optional[StrictInt] = Field(default=None, alias="cancelledAtEpoch") cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "jobRunId", - "jobRun", - "stepId", - "step", - "children", - "parents", - "childWorkflowRuns", - "workerId", - "input", - "output", - "status", - "requeueAfter", - "result", - "error", - "startedAt", - "startedAtEpoch", - "finishedAt", - "finishedAtEpoch", - "timeoutAt", - "timeoutAtEpoch", - "cancelledAt", - "cancelledAtEpoch", - "cancelledReason", - "cancelledError", - ] + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "jobRunId", "jobRun", "stepId", "step", "children", "parents", "childWorkflowRuns", "workerId", "input", "output", "status", "requeueAfter", "result", "error", "startedAt", "startedAtEpoch", "finishedAt", "finishedAtEpoch", "timeoutAt", "timeoutAtEpoch", "cancelledAt", "cancelledAtEpoch", "cancelledReason", "cancelledError"] model_config = ConfigDict( populate_by_name=True, @@ -100,6 +64,7 @@ class StepRun(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -124,7 +89,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -133,13 +99,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of job_run if self.job_run: - _dict["jobRun"] = self.job_run.to_dict() + _dict['jobRun'] = self.job_run.to_dict() # override the default output from pydantic by calling `to_dict()` of step if self.step: - _dict["step"] = self.step.to_dict() + _dict['step'] = self.step.to_dict() return _dict @classmethod @@ -151,50 +117,37 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "jobRunId": obj.get("jobRunId"), - "jobRun": ( - JobRun.from_dict(obj["jobRun"]) - if obj.get("jobRun") is not None - else None - ), - "stepId": obj.get("stepId"), - "step": ( - Step.from_dict(obj["step"]) if obj.get("step") is not None else None - ), - "children": obj.get("children"), - "parents": obj.get("parents"), - "childWorkflowRuns": obj.get("childWorkflowRuns"), - "workerId": obj.get("workerId"), - "input": obj.get("input"), - "output": obj.get("output"), - "status": obj.get("status"), - "requeueAfter": obj.get("requeueAfter"), - "result": obj.get("result"), - "error": obj.get("error"), - "startedAt": obj.get("startedAt"), - "startedAtEpoch": obj.get("startedAtEpoch"), - "finishedAt": obj.get("finishedAt"), - "finishedAtEpoch": obj.get("finishedAtEpoch"), - "timeoutAt": obj.get("timeoutAt"), - "timeoutAtEpoch": obj.get("timeoutAtEpoch"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledAtEpoch": obj.get("cancelledAtEpoch"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "jobRunId": obj.get("jobRunId"), + "jobRun": JobRun.from_dict(obj["jobRun"]) if obj.get("jobRun") is not None else None, + "stepId": obj.get("stepId"), + "step": Step.from_dict(obj["step"]) if obj.get("step") is not None else None, + "children": obj.get("children"), + "parents": obj.get("parents"), + "childWorkflowRuns": obj.get("childWorkflowRuns"), + "workerId": obj.get("workerId"), + "input": obj.get("input"), + "output": obj.get("output"), + "status": obj.get("status"), + "requeueAfter": obj.get("requeueAfter"), + "result": obj.get("result"), + "error": obj.get("error"), + "startedAt": obj.get("startedAt"), + "startedAtEpoch": obj.get("startedAtEpoch"), + "finishedAt": obj.get("finishedAt"), + "finishedAtEpoch": obj.get("finishedAtEpoch"), + "timeoutAt": obj.get("timeoutAt"), + "timeoutAtEpoch": obj.get("timeoutAtEpoch"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledAtEpoch": obj.get("cancelledAtEpoch"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError") + }) return _obj - from hatchet_sdk.clients.rest.models.job_run import JobRun - # TODO: Rewrite to not use raise_errors StepRun.model_rebuild(raise_errors=False) + diff --git a/hatchet_sdk/clients/rest/models/step_run_archive.py b/hatchet_sdk/clients/rest/models/step_run_archive.py index ccae3d28..8797734d 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive.py @@ -13,22 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class StepRunArchive(BaseModel): """ StepRunArchive - """ # noqa: E501 - + """ # noqa: E501 step_run_id: StrictStr = Field(alias="stepRunId") order: StrictInt input: Optional[StrictStr] = None @@ -38,35 +36,14 @@ class StepRunArchive(BaseModel): created_at: datetime = Field(alias="createdAt") started_at_epoch: Optional[StrictInt] = Field(default=None, alias="startedAtEpoch") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") - finished_at_epoch: Optional[StrictInt] = Field( - default=None, alias="finishedAtEpoch" - ) + finished_at_epoch: Optional[StrictInt] = Field(default=None, alias="finishedAtEpoch") timeout_at: Optional[datetime] = Field(default=None, alias="timeoutAt") timeout_at_epoch: Optional[StrictInt] = Field(default=None, alias="timeoutAtEpoch") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") - cancelled_at_epoch: Optional[StrictInt] = Field( - default=None, alias="cancelledAtEpoch" - ) + cancelled_at_epoch: Optional[StrictInt] = Field(default=None, alias="cancelledAtEpoch") cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = [ - "stepRunId", - "order", - "input", - "output", - "startedAt", - "error", - "createdAt", - "startedAtEpoch", - "finishedAt", - "finishedAtEpoch", - "timeoutAt", - "timeoutAtEpoch", - "cancelledAt", - "cancelledAtEpoch", - "cancelledReason", - "cancelledError", - ] + __properties: ClassVar[List[str]] = ["stepRunId", "order", "input", "output", "startedAt", "error", "createdAt", "startedAtEpoch", "finishedAt", "finishedAtEpoch", "timeoutAt", "timeoutAtEpoch", "cancelledAt", "cancelledAtEpoch", "cancelledReason", "cancelledError"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +51,7 @@ class StepRunArchive(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -98,7 +76,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -116,24 +95,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "stepRunId": obj.get("stepRunId"), - "order": obj.get("order"), - "input": obj.get("input"), - "output": obj.get("output"), - "startedAt": obj.get("startedAt"), - "error": obj.get("error"), - "createdAt": obj.get("createdAt"), - "startedAtEpoch": obj.get("startedAtEpoch"), - "finishedAt": obj.get("finishedAt"), - "finishedAtEpoch": obj.get("finishedAtEpoch"), - "timeoutAt": obj.get("timeoutAt"), - "timeoutAtEpoch": obj.get("timeoutAtEpoch"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledAtEpoch": obj.get("cancelledAtEpoch"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError"), - } - ) + _obj = cls.model_validate({ + "stepRunId": obj.get("stepRunId"), + "order": obj.get("order"), + "input": obj.get("input"), + "output": obj.get("output"), + "startedAt": obj.get("startedAt"), + "error": obj.get("error"), + "createdAt": obj.get("createdAt"), + "startedAtEpoch": obj.get("startedAtEpoch"), + "finishedAt": obj.get("finishedAt"), + "finishedAtEpoch": obj.get("finishedAtEpoch"), + "timeoutAt": obj.get("timeoutAt"), + "timeoutAtEpoch": obj.get("timeoutAtEpoch"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledAtEpoch": obj.get("cancelledAtEpoch"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run_archive_list.py b/hatchet_sdk/clients/rest/models/step_run_archive_list.py index fcc1419c..ada96e17 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive - +from typing import Optional, Set +from typing_extensions import Self class StepRunArchiveList(BaseModel): """ StepRunArchiveList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[StepRunArchive]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class StepRunArchiveList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [StepRunArchive.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [StepRunArchive.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run_diff.py b/hatchet_sdk/clients/rest/models/step_run_diff.py index 78848dd7..ada29156 100644 --- a/hatchet_sdk/clients/rest/models/step_run_diff.py +++ b/hatchet_sdk/clients/rest/models/step_run_diff.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class StepRunDiff(BaseModel): """ StepRunDiff - """ # noqa: E501 - + """ # noqa: E501 key: StrictStr original: StrictStr modified: StrictStr @@ -39,6 +37,7 @@ class StepRunDiff(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "key": obj.get("key"), - "original": obj.get("original"), - "modified": obj.get("modified"), - } - ) + _obj = cls.model_validate({ + "key": obj.get("key"), + "original": obj.get("original"), + "modified": obj.get("modified") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run_event.py b/hatchet_sdk/clients/rest/models/step_run_event.py index 841ba053..52004558 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event.py +++ b/hatchet_sdk/clients/rest/models/step_run_event.py @@ -13,25 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.step_run_event_reason import StepRunEventReason from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity - +from typing import Optional, Set +from typing_extensions import Self class StepRunEvent(BaseModel): """ StepRunEvent - """ # noqa: E501 - + """ # noqa: E501 id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") @@ -41,17 +38,7 @@ class StepRunEvent(BaseModel): message: StrictStr count: StrictInt data: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = [ - "id", - "timeFirstSeen", - "timeLastSeen", - "stepRunId", - "reason", - "severity", - "message", - "count", - "data", - ] + __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "stepRunId", "reason", "severity", "message", "count", "data"] model_config = ConfigDict( populate_by_name=True, @@ -59,6 +46,7 @@ class StepRunEvent(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -83,7 +71,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -101,17 +90,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "timeFirstSeen": obj.get("timeFirstSeen"), - "timeLastSeen": obj.get("timeLastSeen"), - "stepRunId": obj.get("stepRunId"), - "reason": obj.get("reason"), - "severity": obj.get("severity"), - "message": obj.get("message"), - "count": obj.get("count"), - "data": obj.get("data"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "stepRunId": obj.get("stepRunId"), + "reason": obj.get("reason"), + "severity": obj.get("severity"), + "message": obj.get("message"), + "count": obj.get("count"), + "data": obj.get("data") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run_event_list.py b/hatchet_sdk/clients/rest/models/step_run_event_list.py index a46f2089..ba23c5ad 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.step_run_event import StepRunEvent - +from typing import Optional, Set +from typing_extensions import Self class StepRunEventList(BaseModel): """ StepRunEventList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[StepRunEvent]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class StepRunEventList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [StepRunEvent.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [StepRunEvent.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/step_run_event_reason.py b/hatchet_sdk/clients/rest/models/step_run_event_reason.py index 617006cd..0c9f545e 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_reason.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_reason.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,22 +26,24 @@ class StepRunEventReason(str, Enum): """ allowed enum values """ - REQUEUED_NO_WORKER = "REQUEUED_NO_WORKER" - REQUEUED_RATE_LIMIT = "REQUEUED_RATE_LIMIT" - SCHEDULING_TIMED_OUT = "SCHEDULING_TIMED_OUT" - ASSIGNED = "ASSIGNED" - STARTED = "STARTED" - FINISHED = "FINISHED" - FAILED = "FAILED" - RETRYING = "RETRYING" - CANCELLED = "CANCELLED" - TIMEOUT_REFRESHED = "TIMEOUT_REFRESHED" - REASSIGNED = "REASSIGNED" - TIMED_OUT = "TIMED_OUT" - SLOT_RELEASED = "SLOT_RELEASED" - RETRIED_BY_USER = "RETRIED_BY_USER" + REQUEUED_NO_WORKER = 'REQUEUED_NO_WORKER' + REQUEUED_RATE_LIMIT = 'REQUEUED_RATE_LIMIT' + SCHEDULING_TIMED_OUT = 'SCHEDULING_TIMED_OUT' + ASSIGNED = 'ASSIGNED' + STARTED = 'STARTED' + FINISHED = 'FINISHED' + FAILED = 'FAILED' + RETRYING = 'RETRYING' + CANCELLED = 'CANCELLED' + TIMEOUT_REFRESHED = 'TIMEOUT_REFRESHED' + REASSIGNED = 'REASSIGNED' + TIMED_OUT = 'TIMED_OUT' + SLOT_RELEASED = 'SLOT_RELEASED' + RETRIED_BY_USER = 'RETRIED_BY_USER' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunEventReason from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/step_run_event_severity.py b/hatchet_sdk/clients/rest/models/step_run_event_severity.py index a8a39912..47e44d96 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_severity.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_severity.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,11 +26,13 @@ class StepRunEventSeverity(str, Enum): """ allowed enum values """ - INFO = "INFO" - WARNING = "WARNING" - CRITICAL = "CRITICAL" + INFO = 'INFO' + WARNING = 'WARNING' + CRITICAL = 'CRITICAL' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunEventSeverity from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/step_run_status.py b/hatchet_sdk/clients/rest/models/step_run_status.py index 8380b1b9..fbfe1dc0 100644 --- a/hatchet_sdk/clients/rest/models/step_run_status.py +++ b/hatchet_sdk/clients/rest/models/step_run_status.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,16 +26,18 @@ class StepRunStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - PENDING_ASSIGNMENT = "PENDING_ASSIGNMENT" - ASSIGNED = "ASSIGNED" - RUNNING = "RUNNING" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - CANCELLING = "CANCELLING" + PENDING = 'PENDING' + PENDING_ASSIGNMENT = 'PENDING_ASSIGNMENT' + ASSIGNED = 'ASSIGNED' + RUNNING = 'RUNNING' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' + CANCELLED = 'CANCELLED' + CANCELLING = 'CANCELLING' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/tenant.py b/hatchet_sdk/clients/rest/models/tenant.py index 97a5863e..bdd79161 100644 --- a/hatchet_sdk/clients/rest/models/tenant.py +++ b/hatchet_sdk/clients/rest/models/tenant.py @@ -13,43 +13,26 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class Tenant(BaseModel): """ Tenant - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta name: StrictStr = Field(description="The name of the tenant.") slug: StrictStr = Field(description="The slug of the tenant.") - analytics_opt_out: Optional[StrictBool] = Field( - default=None, - description="Whether the tenant has opted out of analytics.", - alias="analyticsOptOut", - ) - alert_member_emails: Optional[StrictBool] = Field( - default=None, - description="Whether to alert tenant members.", - alias="alertMemberEmails", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "name", - "slug", - "analyticsOptOut", - "alertMemberEmails", - ] + analytics_opt_out: Optional[StrictBool] = Field(default=None, description="Whether the tenant has opted out of analytics.", alias="analyticsOptOut") + alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") + __properties: ClassVar[List[str]] = ["metadata", "name", "slug", "analyticsOptOut", "alertMemberEmails"] model_config = ConfigDict( populate_by_name=True, @@ -57,6 +40,7 @@ class Tenant(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -81,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -90,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -102,17 +87,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "slug": obj.get("slug"), - "analyticsOptOut": obj.get("analyticsOptOut"), - "alertMemberEmails": obj.get("alertMemberEmails"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "slug": obj.get("slug"), + "analyticsOptOut": obj.get("analyticsOptOut"), + "alertMemberEmails": obj.get("alertMemberEmails") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py b/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py index 2b0586ed..30df003f 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py +++ b/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class TenantAlertEmailGroup(BaseModel): """ TenantAlertEmailGroup - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["metadata", "emails"] @@ -40,6 +37,7 @@ class TenantAlertEmailGroup(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -85,14 +84,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "emails": obj.get("emails"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "emails": obj.get("emails") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py index 9e1a4fc1..aeeac36e 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py @@ -13,26 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( - TenantAlertEmailGroup, -) - +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup +from typing import Optional, Set +from typing_extensions import Self class TenantAlertEmailGroupList(BaseModel): """ TenantAlertEmailGroupList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantAlertEmailGroup]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -43,6 +38,7 @@ class TenantAlertEmailGroupList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -95,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [TenantAlertEmailGroup.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [TenantAlertEmailGroup.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py b/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py index e2502486..5c79ef24 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py +++ b/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py @@ -13,62 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class TenantAlertingSettings(BaseModel): """ TenantAlertingSettings - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - alert_member_emails: Optional[StrictBool] = Field( - default=None, - description="Whether to alert tenant members.", - alias="alertMemberEmails", - ) - enable_workflow_run_failure_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to send alerts when workflow runs fail.", - alias="enableWorkflowRunFailureAlerts", - ) - enable_expiring_token_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to enable alerts when tokens are approaching expiration.", - alias="enableExpiringTokenAlerts", - ) - enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to enable alerts when tenant resources are approaching limits.", - alias="enableTenantResourceLimitAlerts", - ) - max_alerting_frequency: StrictStr = Field( - description="The max frequency at which to alert.", alias="maxAlertingFrequency" - ) - last_alerted_at: Optional[datetime] = Field( - default=None, - description="The last time an alert was sent.", - alias="lastAlertedAt", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "alertMemberEmails", - "enableWorkflowRunFailureAlerts", - "enableExpiringTokenAlerts", - "enableTenantResourceLimitAlerts", - "maxAlertingFrequency", - "lastAlertedAt", - ] + alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") + enable_workflow_run_failure_alerts: Optional[StrictBool] = Field(default=None, description="Whether to send alerts when workflow runs fail.", alias="enableWorkflowRunFailureAlerts") + enable_expiring_token_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tokens are approaching expiration.", alias="enableExpiringTokenAlerts") + enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tenant resources are approaching limits.", alias="enableTenantResourceLimitAlerts") + max_alerting_frequency: StrictStr = Field(description="The max frequency at which to alert.", alias="maxAlertingFrequency") + last_alerted_at: Optional[datetime] = Field(default=None, description="The last time an alert was sent.", alias="lastAlertedAt") + __properties: ClassVar[List[str]] = ["metadata", "alertMemberEmails", "enableWorkflowRunFailureAlerts", "enableExpiringTokenAlerts", "enableTenantResourceLimitAlerts", "maxAlertingFrequency", "lastAlertedAt"] model_config = ConfigDict( populate_by_name=True, @@ -76,6 +43,7 @@ class TenantAlertingSettings(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -100,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -109,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -121,23 +90,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "alertMemberEmails": obj.get("alertMemberEmails"), - "enableWorkflowRunFailureAlerts": obj.get( - "enableWorkflowRunFailureAlerts" - ), - "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), - "enableTenantResourceLimitAlerts": obj.get( - "enableTenantResourceLimitAlerts" - ), - "maxAlertingFrequency": obj.get("maxAlertingFrequency"), - "lastAlertedAt": obj.get("lastAlertedAt"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "alertMemberEmails": obj.get("alertMemberEmails"), + "enableWorkflowRunFailureAlerts": obj.get("enableWorkflowRunFailureAlerts"), + "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), + "enableTenantResourceLimitAlerts": obj.get("enableTenantResourceLimitAlerts"), + "maxAlertingFrequency": obj.get("maxAlertingFrequency"), + "lastAlertedAt": obj.get("lastAlertedAt") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_invite.py b/hatchet_sdk/clients/rest/models/tenant_invite.py index 168bfa3c..2e1f9722 100644 --- a/hatchet_sdk/clients/rest/models/tenant_invite.py +++ b/hatchet_sdk/clients/rest/models/tenant_invite.py @@ -13,44 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole - +from typing import Optional, Set +from typing_extensions import Self class TenantInvite(BaseModel): """ TenantInvite - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta email: StrictStr = Field(description="The email of the user to invite.") role: TenantMemberRole = Field(description="The role of the user in the tenant.") - tenant_id: StrictStr = Field( - description="The tenant id associated with this tenant invite.", - alias="tenantId", - ) - tenant_name: Optional[StrictStr] = Field( - default=None, description="The tenant name for the tenant.", alias="tenantName" - ) + tenant_id: StrictStr = Field(description="The tenant id associated with this tenant invite.", alias="tenantId") + tenant_name: Optional[StrictStr] = Field(default=None, description="The tenant name for the tenant.", alias="tenantName") expires: datetime = Field(description="The time that this invite expires.") - __properties: ClassVar[List[str]] = [ - "metadata", - "email", - "role", - "tenantId", - "tenantName", - "expires", - ] + __properties: ClassVar[List[str]] = ["metadata", "email", "role", "tenantId", "tenantName", "expires"] model_config = ConfigDict( populate_by_name=True, @@ -58,6 +43,7 @@ class TenantInvite(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -82,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -103,18 +90,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "email": obj.get("email"), - "role": obj.get("role"), - "tenantId": obj.get("tenantId"), - "tenantName": obj.get("tenantName"), - "expires": obj.get("expires"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "email": obj.get("email"), + "role": obj.get("role"), + "tenantId": obj.get("tenantId"), + "tenantName": obj.get("tenantName"), + "expires": obj.get("expires") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_invite_list.py b/hatchet_sdk/clients/rest/models/tenant_invite_list.py index 95e4ba4d..f098a073 100644 --- a/hatchet_sdk/clients/rest/models/tenant_invite_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_invite_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite - +from typing import Optional, Set +from typing_extensions import Self class TenantInviteList(BaseModel): """ TenantInviteList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantInvite]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class TenantInviteList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [TenantInvite.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [TenantInvite.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_list.py b/hatchet_sdk/clients/rest/models/tenant_list.py index 623d6206..9399154d 100644 --- a/hatchet_sdk/clients/rest/models/tenant_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant import Tenant - +from typing import Optional, Set +from typing_extensions import Self class TenantList(BaseModel): """ TenantList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[Tenant]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class TenantList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [Tenant.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [Tenant.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_member.py b/hatchet_sdk/clients/rest/models/tenant_member.py index 540230c0..98460fed 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member.py +++ b/hatchet_sdk/clients/rest/models/tenant_member.py @@ -13,34 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant import Tenant from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic - +from typing import Optional, Set +from typing_extensions import Self class TenantMember(BaseModel): """ TenantMember - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - user: UserTenantPublic = Field( - description="The user associated with this tenant member." - ) + user: UserTenantPublic = Field(description="The user associated with this tenant member.") role: TenantMemberRole = Field(description="The role of the user in the tenant.") - tenant: Optional[Tenant] = Field( - default=None, description="The tenant associated with this tenant member." - ) + tenant: Optional[Tenant] = Field(default=None, description="The tenant associated with this tenant member.") __properties: ClassVar[List[str]] = ["metadata", "user", "role", "tenant"] model_config = ConfigDict( @@ -49,6 +42,7 @@ class TenantMember(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,13 +77,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of user if self.user: - _dict["user"] = self.user.to_dict() + _dict['user'] = self.user.to_dict() # override the default output from pydantic by calling `to_dict()` of tenant if self.tenant: - _dict["tenant"] = self.tenant.to_dict() + _dict['tenant'] = self.tenant.to_dict() return _dict @classmethod @@ -100,24 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "user": ( - UserTenantPublic.from_dict(obj["user"]) - if obj.get("user") is not None - else None - ), - "role": obj.get("role"), - "tenant": ( - Tenant.from_dict(obj["tenant"]) - if obj.get("tenant") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "user": UserTenantPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, + "role": obj.get("role"), + "tenant": Tenant.from_dict(obj["tenant"]) if obj.get("tenant") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_member_list.py b/hatchet_sdk/clients/rest/models/tenant_member_list.py index 6627c281..f2506a9b 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_member_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_member import TenantMember - +from typing import Optional, Set +from typing_extensions import Self class TenantMemberList(BaseModel): """ TenantMemberList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantMember]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class TenantMemberList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [TenantMember.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [TenantMember.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_member_role.py b/hatchet_sdk/clients/rest/models/tenant_member_role.py index 446c7044..fd89bb33 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member_role.py +++ b/hatchet_sdk/clients/rest/models/tenant_member_role.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,11 +26,13 @@ class TenantMemberRole(str, Enum): """ allowed enum values """ - OWNER = "OWNER" - ADMIN = "ADMIN" - MEMBER = "MEMBER" + OWNER = 'OWNER' + ADMIN = 'ADMIN' + MEMBER = 'MEMBER' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TenantMemberRole from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py index fc348a5e..e29f8f3f 100644 --- a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py @@ -13,26 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics - +from typing import Optional, Set +from typing_extensions import Self class TenantQueueMetrics(BaseModel): """ TenantQueueMetrics - """ # noqa: E501 - - total: Optional[QueueMetrics] = Field( - default=None, description="The total queue metrics." - ) + """ # noqa: E501 + total: Optional[QueueMetrics] = Field(default=None, description="The total queue metrics.") workflow: Optional[Dict[str, QueueMetrics]] = None __properties: ClassVar[List[str]] = ["total", "workflow"] @@ -42,6 +37,7 @@ class TenantQueueMetrics(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of total if self.total: - _dict["total"] = self.total.to_dict() + _dict['total'] = self.total.to_dict() return _dict @classmethod @@ -87,13 +84,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "total": ( - QueueMetrics.from_dict(obj["total"]) - if obj.get("total") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "total": QueueMetrics.from_dict(obj["total"]) if obj.get("total") is not None else None, + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_resource.py b/hatchet_sdk/clients/rest/models/tenant_resource.py index 0dbdbf60..c66e4997 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,13 +26,15 @@ class TenantResource(str, Enum): """ allowed enum values """ - WORKER = "WORKER" - EVENT = "EVENT" - WORKFLOW_RUN = "WORKFLOW_RUN" - CRON = "CRON" - SCHEDULE = "SCHEDULE" + WORKER = 'WORKER' + EVENT = 'EVENT' + WORKFLOW_RUN = 'WORKFLOW_RUN' + CRON = 'CRON' + SCHEDULE = 'SCHEDULE' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TenantResource from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/tenant_resource_limit.py b/hatchet_sdk/clients/rest/models/tenant_resource_limit.py index 722b7854..572fa8c5 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource_limit.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource_limit.py @@ -13,58 +13,30 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource - +from typing import Optional, Set +from typing_extensions import Self class TenantResourceLimit(BaseModel): """ TenantResourceLimit - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - resource: TenantResource = Field( - description="The resource associated with this limit." - ) - limit_value: StrictInt = Field( - description="The limit associated with this limit.", alias="limitValue" - ) - alarm_value: Optional[StrictInt] = Field( - default=None, - description="The alarm value associated with this limit to warn of approaching limit value.", - alias="alarmValue", - ) - value: StrictInt = Field( - description="The current value associated with this limit." - ) - window: Optional[StrictStr] = Field( - default=None, - description="The meter window for the limit. (i.e. 1 day, 1 week, 1 month)", - ) - last_refill: Optional[datetime] = Field( - default=None, - description="The last time the limit was refilled.", - alias="lastRefill", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "resource", - "limitValue", - "alarmValue", - "value", - "window", - "lastRefill", - ] + resource: TenantResource = Field(description="The resource associated with this limit.") + limit_value: StrictInt = Field(description="The limit associated with this limit.", alias="limitValue") + alarm_value: Optional[StrictInt] = Field(default=None, description="The alarm value associated with this limit to warn of approaching limit value.", alias="alarmValue") + value: StrictInt = Field(description="The current value associated with this limit.") + window: Optional[StrictStr] = Field(default=None, description="The meter window for the limit. (i.e. 1 day, 1 week, 1 month)") + last_refill: Optional[datetime] = Field(default=None, description="The last time the limit was refilled.", alias="lastRefill") + __properties: ClassVar[List[str]] = ["metadata", "resource", "limitValue", "alarmValue", "value", "window", "lastRefill"] model_config = ConfigDict( populate_by_name=True, @@ -72,6 +44,7 @@ class TenantResourceLimit(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -96,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -105,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -117,19 +91,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "resource": obj.get("resource"), - "limitValue": obj.get("limitValue"), - "alarmValue": obj.get("alarmValue"), - "value": obj.get("value"), - "window": obj.get("window"), - "lastRefill": obj.get("lastRefill"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "resource": obj.get("resource"), + "limitValue": obj.get("limitValue"), + "alarmValue": obj.get("alarmValue"), + "value": obj.get("value"), + "window": obj.get("window"), + "lastRefill": obj.get("lastRefill") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py index c8f10af0..c2975264 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py @@ -13,26 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit - +from typing import Optional, Set +from typing_extensions import Self class TenantResourcePolicy(BaseModel): """ TenantResourcePolicy - """ # noqa: E501 - - limits: List[TenantResourceLimit] = Field( - description="A list of resource limits for the tenant." - ) + """ # noqa: E501 + limits: List[TenantResourceLimit] = Field(description="A list of resource limits for the tenant.") __properties: ClassVar[List[str]] = ["limits"] model_config = ConfigDict( @@ -41,6 +36,7 @@ class TenantResourcePolicy(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.limits: if _item: _items.append(_item.to_dict()) - _dict["limits"] = _items + _dict['limits'] = _items return _dict @classmethod @@ -90,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "limits": ( - [TenantResourceLimit.from_dict(_item) for _item in obj["limits"]] - if obj.get("limits") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "limits": [TenantResourceLimit.from_dict(_item) for _item in obj["limits"]] if obj.get("limits") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py b/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py index 5600c6a0..1502f08d 100644 --- a/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py +++ b/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class TriggerWorkflowRunRequest(BaseModel): """ TriggerWorkflowRunRequest - """ # noqa: E501 - + """ # noqa: E501 input: Dict[str, Any] - additional_metadata: Optional[Dict[str, Any]] = Field( - default=None, alias="additionalMetadata" - ) + additional_metadata: Optional[Dict[str, Any]] = Field(default=None, alias="additionalMetadata") __properties: ClassVar[List[str]] = ["input", "additionalMetadata"] model_config = ConfigDict( @@ -40,6 +36,7 @@ class TriggerWorkflowRunRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,10 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "input": obj.get("input"), - "additionalMetadata": obj.get("additionalMetadata"), - } - ) + _obj = cls.model_validate({ + "input": obj.get("input"), + "additionalMetadata": obj.get("additionalMetadata") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py b/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py index d4dec094..02d048be 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class UpdateTenantAlertEmailGroupRequest(BaseModel): """ UpdateTenantAlertEmailGroupRequest - """ # noqa: E501 - + """ # noqa: E501 emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["emails"] @@ -37,6 +35,7 @@ class UpdateTenantAlertEmailGroupRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"emails": obj.get("emails")}) + _obj = cls.model_validate({ + "emails": obj.get("emails") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py b/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py index 86c36a9b..36fedeab 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole - +from typing import Optional, Set +from typing_extensions import Self class UpdateTenantInviteRequest(BaseModel): """ UpdateTenantInviteRequest - """ # noqa: E501 - + """ # noqa: E501 role: TenantMemberRole = Field(description="The role of the user in the tenant.") __properties: ClassVar[List[str]] = ["role"] @@ -39,6 +36,7 @@ class UpdateTenantInviteRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"role": obj.get("role")}) + _obj = cls.model_validate({ + "role": obj.get("role") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/update_tenant_request.py b/hatchet_sdk/clients/rest/models/update_tenant_request.py index 431efe00..2a7cb417 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_request.py @@ -13,63 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class UpdateTenantRequest(BaseModel): """ UpdateTenantRequest - """ # noqa: E501 - - name: Optional[StrictStr] = Field( - default=None, description="The name of the tenant." - ) - analytics_opt_out: Optional[StrictBool] = Field( - default=None, - description="Whether the tenant has opted out of analytics.", - alias="analyticsOptOut", - ) - alert_member_emails: Optional[StrictBool] = Field( - default=None, - description="Whether to alert tenant members.", - alias="alertMemberEmails", - ) - enable_workflow_run_failure_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to send alerts when workflow runs fail.", - alias="enableWorkflowRunFailureAlerts", - ) - enable_expiring_token_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to enable alerts when tokens are approaching expiration.", - alias="enableExpiringTokenAlerts", - ) - enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field( - default=None, - description="Whether to enable alerts when tenant resources are approaching limits.", - alias="enableTenantResourceLimitAlerts", - ) - max_alerting_frequency: Optional[StrictStr] = Field( - default=None, - description="The max frequency at which to alert.", - alias="maxAlertingFrequency", - ) - __properties: ClassVar[List[str]] = [ - "name", - "analyticsOptOut", - "alertMemberEmails", - "enableWorkflowRunFailureAlerts", - "enableExpiringTokenAlerts", - "enableTenantResourceLimitAlerts", - "maxAlertingFrequency", - ] + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the tenant.") + analytics_opt_out: Optional[StrictBool] = Field(default=None, description="Whether the tenant has opted out of analytics.", alias="analyticsOptOut") + alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") + enable_workflow_run_failure_alerts: Optional[StrictBool] = Field(default=None, description="Whether to send alerts when workflow runs fail.", alias="enableWorkflowRunFailureAlerts") + enable_expiring_token_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tokens are approaching expiration.", alias="enableExpiringTokenAlerts") + enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tenant resources are approaching limits.", alias="enableTenantResourceLimitAlerts") + max_alerting_frequency: Optional[StrictStr] = Field(default=None, description="The max frequency at which to alert.", alias="maxAlertingFrequency") + __properties: ClassVar[List[str]] = ["name", "analyticsOptOut", "alertMemberEmails", "enableWorkflowRunFailureAlerts", "enableExpiringTokenAlerts", "enableTenantResourceLimitAlerts", "maxAlertingFrequency"] model_config = ConfigDict( populate_by_name=True, @@ -77,6 +41,7 @@ class UpdateTenantRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -101,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -119,19 +85,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "analyticsOptOut": obj.get("analyticsOptOut"), - "alertMemberEmails": obj.get("alertMemberEmails"), - "enableWorkflowRunFailureAlerts": obj.get( - "enableWorkflowRunFailureAlerts" - ), - "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), - "enableTenantResourceLimitAlerts": obj.get( - "enableTenantResourceLimitAlerts" - ), - "maxAlertingFrequency": obj.get("maxAlertingFrequency"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "analyticsOptOut": obj.get("analyticsOptOut"), + "alertMemberEmails": obj.get("alertMemberEmails"), + "enableWorkflowRunFailureAlerts": obj.get("enableWorkflowRunFailureAlerts"), + "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), + "enableTenantResourceLimitAlerts": obj.get("enableTenantResourceLimitAlerts"), + "maxAlertingFrequency": obj.get("maxAlertingFrequency") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/update_worker_request.py b/hatchet_sdk/clients/rest/models/update_worker_request.py index 73904979..ca5a0c33 100644 --- a/hatchet_sdk/clients/rest/models/update_worker_request.py +++ b/hatchet_sdk/clients/rest/models/update_worker_request.py @@ -13,26 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class UpdateWorkerRequest(BaseModel): """ UpdateWorkerRequest - """ # noqa: E501 - - is_paused: Optional[StrictBool] = Field( - default=None, - description="Whether the worker is paused and cannot accept new runs.", - alias="isPaused", - ) + """ # noqa: E501 + is_paused: Optional[StrictBool] = Field(default=None, description="Whether the worker is paused and cannot accept new runs.", alias="isPaused") __properties: ClassVar[List[str]] = ["isPaused"] model_config = ConfigDict( @@ -41,6 +35,7 @@ class UpdateWorkerRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -83,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"isPaused": obj.get("isPaused")}) + _obj = cls.model_validate({ + "isPaused": obj.get("isPaused") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user.py b/hatchet_sdk/clients/rest/models/user.py index a806062a..fa2162b2 100644 --- a/hatchet_sdk/clients/rest/models/user.py +++ b/hatchet_sdk/clients/rest/models/user.py @@ -13,50 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class User(BaseModel): """ User - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta - name: Optional[StrictStr] = Field( - default=None, description="The display name of the user." - ) + name: Optional[StrictStr] = Field(default=None, description="The display name of the user.") email: StrictStr = Field(description="The email address of the user.") - email_verified: StrictBool = Field( - description="Whether the user has verified their email address.", - alias="emailVerified", - ) - has_password: Optional[StrictBool] = Field( - default=None, - description="Whether the user has a password set.", - alias="hasPassword", - ) - email_hash: Optional[StrictStr] = Field( - default=None, - description="A hash of the user's email address for use with Pylon Support Chat", - alias="emailHash", - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "name", - "email", - "emailVerified", - "hasPassword", - "emailHash", - ] + email_verified: StrictBool = Field(description="Whether the user has verified their email address.", alias="emailVerified") + has_password: Optional[StrictBool] = Field(default=None, description="Whether the user has a password set.", alias="hasPassword") + email_hash: Optional[StrictStr] = Field(default=None, description="A hash of the user's email address for use with Pylon Support Chat", alias="emailHash") + __properties: ClassVar[List[str]] = ["metadata", "name", "email", "emailVerified", "hasPassword", "emailHash"] model_config = ConfigDict( populate_by_name=True, @@ -64,6 +41,7 @@ class User(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -88,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -97,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -109,18 +88,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "email": obj.get("email"), - "emailVerified": obj.get("emailVerified"), - "hasPassword": obj.get("hasPassword"), - "emailHash": obj.get("emailHash"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "email": obj.get("email"), + "emailVerified": obj.get("emailVerified"), + "hasPassword": obj.get("hasPassword"), + "emailHash": obj.get("emailHash") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user_change_password_request.py b/hatchet_sdk/clients/rest/models/user_change_password_request.py index b0b87ac4..d31a8429 100644 --- a/hatchet_sdk/clients/rest/models/user_change_password_request.py +++ b/hatchet_sdk/clients/rest/models/user_change_password_request.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class UserChangePasswordRequest(BaseModel): """ UserChangePasswordRequest - """ # noqa: E501 - + """ # noqa: E501 password: StrictStr = Field(description="The password of the user.") - new_password: StrictStr = Field( - description="The new password for the user.", alias="newPassword" - ) + new_password: StrictStr = Field(description="The new password for the user.", alias="newPassword") __properties: ClassVar[List[str]] = ["password", "newPassword"] model_config = ConfigDict( @@ -40,6 +36,7 @@ class UserChangePasswordRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"password": obj.get("password"), "newPassword": obj.get("newPassword")} - ) + _obj = cls.model_validate({ + "password": obj.get("password"), + "newPassword": obj.get("newPassword") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user_login_request.py b/hatchet_sdk/clients/rest/models/user_login_request.py index a9ab5a8d..c35aad8c 100644 --- a/hatchet_sdk/clients/rest/models/user_login_request.py +++ b/hatchet_sdk/clients/rest/models/user_login_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class UserLoginRequest(BaseModel): """ UserLoginRequest - """ # noqa: E501 - + """ # noqa: E501 email: StrictStr = Field(description="The email address of the user.") password: StrictStr = Field(description="The password of the user.") __properties: ClassVar[List[str]] = ["email", "password"] @@ -38,6 +36,7 @@ class UserLoginRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"email": obj.get("email"), "password": obj.get("password")} - ) + _obj = cls.model_validate({ + "email": obj.get("email"), + "password": obj.get("password") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user_register_request.py b/hatchet_sdk/clients/rest/models/user_register_request.py index bf0c1dfa..d2abd574 100644 --- a/hatchet_sdk/clients/rest/models/user_register_request.py +++ b/hatchet_sdk/clients/rest/models/user_register_request.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class UserRegisterRequest(BaseModel): """ UserRegisterRequest - """ # noqa: E501 - + """ # noqa: E501 name: StrictStr = Field(description="The name of the user.") email: StrictStr = Field(description="The email address of the user.") password: StrictStr = Field(description="The password of the user.") @@ -39,6 +37,7 @@ class UserRegisterRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "email": obj.get("email"), - "password": obj.get("password"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "email": obj.get("email"), + "password": obj.get("password") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py index 1f45b260..49546a0b 100644 --- a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +++ b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_member import TenantMember - +from typing import Optional, Set +from typing_extensions import Self class UserTenantMembershipsList(BaseModel): """ UserTenantMembershipsList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantMember]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class UserTenantMembershipsList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [TenantMember.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [TenantMember.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/user_tenant_public.py b/hatchet_sdk/clients/rest/models/user_tenant_public.py index 42e4fe0c..b597ea29 100644 --- a/hatchet_sdk/clients/rest/models/user_tenant_public.py +++ b/hatchet_sdk/clients/rest/models/user_tenant_public.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class UserTenantPublic(BaseModel): """ UserTenantPublic - """ # noqa: E501 - + """ # noqa: E501 email: StrictStr = Field(description="The email address of the user.") - name: Optional[StrictStr] = Field( - default=None, description="The display name of the user." - ) + name: Optional[StrictStr] = Field(default=None, description="The display name of the user.") __properties: ClassVar[List[str]] = ["email", "name"] model_config = ConfigDict( @@ -40,6 +36,7 @@ class UserTenantPublic(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,5 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"email": obj.get("email"), "name": obj.get("name")}) + _obj = cls.model_validate({ + "email": obj.get("email"), + "name": obj.get("name") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker.py b/hatchet_sdk/clients/rest/models/webhook_worker.py index 28b5731d..1a4eb985 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class WebhookWorker(BaseModel): """ WebhookWorker - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") @@ -41,6 +38,7 @@ class WebhookWorker(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -86,15 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "url": obj.get("url"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "url": obj.get("url") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py b/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py index 616277e1..f7b6a32f 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py @@ -13,27 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class WebhookWorkerCreateRequest(BaseModel): """ WebhookWorkerCreateRequest - """ # noqa: E501 - + """ # noqa: E501 name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") - secret: Optional[Annotated[str, Field(min_length=32, strict=True)]] = Field( - default=None, - description="The secret key for validation. If not provided, a random secret will be generated.", - ) + secret: Optional[Annotated[str, Field(min_length=32, strict=True)]] = Field(default=None, description="The secret key for validation. If not provided, a random secret will be generated.") __properties: ClassVar[List[str]] = ["name", "url", "secret"] model_config = ConfigDict( @@ -42,6 +38,7 @@ class WebhookWorkerCreateRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "url": obj.get("url"), - "secret": obj.get("secret"), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "url": obj.get("url"), + "secret": obj.get("secret") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py index 819edec0..435c04e8 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated - +from typing import Optional, Set +from typing_extensions import Self class WebhookWorkerCreateResponse(BaseModel): """ WebhookWorkerCreateResponse - """ # noqa: E501 - + """ # noqa: E501 worker: Optional[WebhookWorkerCreated] = None __properties: ClassVar[List[str]] = ["worker"] @@ -39,6 +36,7 @@ class WebhookWorkerCreateResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,7 +71,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of worker if self.worker: - _dict["worker"] = self.worker.to_dict() + _dict['worker'] = self.worker.to_dict() return _dict @classmethod @@ -84,13 +83,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "worker": ( - WebhookWorkerCreated.from_dict(obj["worker"]) - if obj.get("worker") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "worker": WebhookWorkerCreated.from_dict(obj["worker"]) if obj.get("worker") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_created.py b/hatchet_sdk/clients/rest/models/webhook_worker_created.py index 26a409ee..4167ba79 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_created.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_created.py @@ -13,23 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class WebhookWorkerCreated(BaseModel): """ WebhookWorkerCreated - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") @@ -42,6 +39,7 @@ class WebhookWorkerCreated(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -87,16 +86,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "url": obj.get("url"), - "secret": obj.get("secret"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "url": obj.get("url"), + "secret": obj.get("secret") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py index 2d9e08c7..06bc8deb 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker - +from typing import Optional, Set +from typing_extensions import Self class WebhookWorkerListResponse(BaseModel): """ WebhookWorkerListResponse - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[WebhookWorker]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class WebhookWorkerListResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [WebhookWorker.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [WebhookWorker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request.py b/hatchet_sdk/clients/rest/models/webhook_worker_request.py index 07adaa3d..e7779a36 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request.py @@ -13,35 +13,24 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( - WebhookWorkerRequestMethod, -) - - class WebhookWorkerRequest(BaseModel): """ WebhookWorkerRequest - """ # noqa: E501 - - created_at: datetime = Field( - description="The date and time the request was created." - ) - method: WebhookWorkerRequestMethod = Field( - description="The HTTP method used for the request." - ) - status_code: StrictInt = Field( - description="The HTTP status code of the response.", alias="statusCode" - ) + """ # noqa: E501 + created_at: datetime = Field(description="The date and time the request was created.") + method: WebhookWorkerRequestMethod = Field(description="The HTTP method used for the request.") + status_code: StrictInt = Field(description="The HTTP status code of the response.", alias="statusCode") __properties: ClassVar[List[str]] = ["created_at", "method", "statusCode"] model_config = ConfigDict( @@ -50,6 +39,7 @@ class WebhookWorkerRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -74,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -92,11 +83,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "created_at": obj.get("created_at"), - "method": obj.get("method"), - "statusCode": obj.get("statusCode"), - } - ) + _obj = cls.model_validate({ + "created_at": obj.get("created_at"), + "method": obj.get("method"), + "statusCode": obj.get("statusCode") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py index 30915cd0..40dc6a89 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py @@ -13,26 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest - +from typing import Optional, Set +from typing_extensions import Self class WebhookWorkerRequestListResponse(BaseModel): """ WebhookWorkerRequestListResponse - """ # noqa: E501 - - requests: Optional[List[WebhookWorkerRequest]] = Field( - default=None, description="The list of webhook requests." - ) + """ # noqa: E501 + requests: Optional[List[WebhookWorkerRequest]] = Field(default=None, description="The list of webhook requests.") __properties: ClassVar[List[str]] = ["requests"] model_config = ConfigDict( @@ -41,6 +36,7 @@ class WebhookWorkerRequestListResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.requests: if _item: _items.append(_item.to_dict()) - _dict["requests"] = _items + _dict['requests'] = _items return _dict @classmethod @@ -90,13 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "requests": ( - [WebhookWorkerRequest.from_dict(_item) for _item in obj["requests"]] - if obj.get("requests") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "requests": [WebhookWorkerRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py b/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py index 14cb059f..d2963be8 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,11 +26,13 @@ class WebhookWorkerRequestMethod(str, Enum): """ allowed enum values """ - GET = "GET" - POST = "POST" - PUT = "PUT" + GET = 'GET' + POST = 'POST' + PUT = 'PUT' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WebhookWorkerRequestMethod from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/worker.py b/hatchet_sdk/clients/rest/models/worker.py index 48e6eda8..a09af9c3 100644 --- a/hatchet_sdk/clients/rest/models/worker.py +++ b/hatchet_sdk/clients/rest/models/worker.py @@ -13,117 +13,57 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel - +from typing import Optional, Set +from typing_extensions import Self class Worker(BaseModel): """ Worker - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta name: StrictStr = Field(description="The name of the worker.") type: StrictStr - last_heartbeat_at: Optional[datetime] = Field( - default=None, - description="The time this worker last sent a heartbeat.", - alias="lastHeartbeatAt", - ) - last_listener_established: Optional[datetime] = Field( - default=None, - description="The time this worker last sent a heartbeat.", - alias="lastListenerEstablished", - ) - actions: Optional[List[StrictStr]] = Field( - default=None, description="The actions this worker can perform." - ) - slots: Optional[List[SemaphoreSlots]] = Field( - default=None, description="The semaphore slot state for the worker." - ) - recent_step_runs: Optional[List[RecentStepRuns]] = Field( - default=None, - description="The recent step runs for the worker.", - alias="recentStepRuns", - ) - status: Optional[StrictStr] = Field( - default=None, description="The status of the worker." - ) - max_runs: Optional[StrictInt] = Field( - default=None, - description="The maximum number of runs this worker can execute concurrently.", - alias="maxRuns", - ) - available_runs: Optional[StrictInt] = Field( - default=None, - description="The number of runs this worker can execute concurrently.", - alias="availableRuns", - ) - dispatcher_id: Optional[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field( - default=None, - description="the id of the assigned dispatcher, in UUID format", - alias="dispatcherId", - ) - labels: Optional[List[WorkerLabel]] = Field( - default=None, description="The current label state of the worker." - ) - webhook_url: Optional[StrictStr] = Field( - default=None, description="The webhook URL for the worker.", alias="webhookUrl" - ) - webhook_id: Optional[StrictStr] = Field( - default=None, description="The webhook ID for the worker.", alias="webhookId" - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "name", - "type", - "lastHeartbeatAt", - "lastListenerEstablished", - "actions", - "slots", - "recentStepRuns", - "status", - "maxRuns", - "availableRuns", - "dispatcherId", - "labels", - "webhookUrl", - "webhookId", - ] - - @field_validator("type") + last_heartbeat_at: Optional[datetime] = Field(default=None, description="The time this worker last sent a heartbeat.", alias="lastHeartbeatAt") + last_listener_established: Optional[datetime] = Field(default=None, description="The time this worker last sent a heartbeat.", alias="lastListenerEstablished") + actions: Optional[List[StrictStr]] = Field(default=None, description="The actions this worker can perform.") + slots: Optional[List[SemaphoreSlots]] = Field(default=None, description="The semaphore slot state for the worker.") + recent_step_runs: Optional[List[RecentStepRuns]] = Field(default=None, description="The recent step runs for the worker.", alias="recentStepRuns") + status: Optional[StrictStr] = Field(default=None, description="The status of the worker.") + max_runs: Optional[StrictInt] = Field(default=None, description="The maximum number of runs this worker can execute concurrently.", alias="maxRuns") + available_runs: Optional[StrictInt] = Field(default=None, description="The number of runs this worker can execute concurrently.", alias="availableRuns") + dispatcher_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, description="the id of the assigned dispatcher, in UUID format", alias="dispatcherId") + labels: Optional[List[WorkerLabel]] = Field(default=None, description="The current label state of the worker.") + webhook_url: Optional[StrictStr] = Field(default=None, description="The webhook URL for the worker.", alias="webhookUrl") + webhook_id: Optional[StrictStr] = Field(default=None, description="The webhook ID for the worker.", alias="webhookId") + __properties: ClassVar[List[str]] = ["metadata", "name", "type", "lastHeartbeatAt", "lastListenerEstablished", "actions", "slots", "recentStepRuns", "status", "maxRuns", "availableRuns", "dispatcherId", "labels", "webhookUrl", "webhookId"] + + @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["SELFHOSTED", "MANAGED", "WEBHOOK"]): - raise ValueError( - "must be one of enum values ('SELFHOSTED', 'MANAGED', 'WEBHOOK')" - ) + if value not in set(['SELFHOSTED', 'MANAGED', 'WEBHOOK']): + raise ValueError("must be one of enum values ('SELFHOSTED', 'MANAGED', 'WEBHOOK')") return value - @field_validator("status") + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["ACTIVE", "INACTIVE", "PAUSED"]): - raise ValueError( - "must be one of enum values ('ACTIVE', 'INACTIVE', 'PAUSED')" - ) + if value not in set(['ACTIVE', 'INACTIVE', 'PAUSED']): + raise ValueError("must be one of enum values ('ACTIVE', 'INACTIVE', 'PAUSED')") return value model_config = ConfigDict( @@ -132,6 +72,7 @@ def status_validate_enum(cls, value): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -156,7 +97,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -165,28 +107,28 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in slots (list) _items = [] if self.slots: for _item in self.slots: if _item: _items.append(_item.to_dict()) - _dict["slots"] = _items + _dict['slots'] = _items # override the default output from pydantic by calling `to_dict()` of each item in recent_step_runs (list) _items = [] if self.recent_step_runs: for _item in self.recent_step_runs: if _item: _items.append(_item.to_dict()) - _dict["recentStepRuns"] = _items + _dict['recentStepRuns'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: for _item in self.labels: if _item: _items.append(_item.to_dict()) - _dict["labels"] = _items + _dict['labels'] = _items return _dict @classmethod @@ -198,39 +140,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "type": obj.get("type"), - "lastHeartbeatAt": obj.get("lastHeartbeatAt"), - "lastListenerEstablished": obj.get("lastListenerEstablished"), - "actions": obj.get("actions"), - "slots": ( - [SemaphoreSlots.from_dict(_item) for _item in obj["slots"]] - if obj.get("slots") is not None - else None - ), - "recentStepRuns": ( - [RecentStepRuns.from_dict(_item) for _item in obj["recentStepRuns"]] - if obj.get("recentStepRuns") is not None - else None - ), - "status": obj.get("status"), - "maxRuns": obj.get("maxRuns"), - "availableRuns": obj.get("availableRuns"), - "dispatcherId": obj.get("dispatcherId"), - "labels": ( - [WorkerLabel.from_dict(_item) for _item in obj["labels"]] - if obj.get("labels") is not None - else None - ), - "webhookUrl": obj.get("webhookUrl"), - "webhookId": obj.get("webhookId"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "type": obj.get("type"), + "lastHeartbeatAt": obj.get("lastHeartbeatAt"), + "lastListenerEstablished": obj.get("lastListenerEstablished"), + "actions": obj.get("actions"), + "slots": [SemaphoreSlots.from_dict(_item) for _item in obj["slots"]] if obj.get("slots") is not None else None, + "recentStepRuns": [RecentStepRuns.from_dict(_item) for _item in obj["recentStepRuns"]] if obj.get("recentStepRuns") is not None else None, + "status": obj.get("status"), + "maxRuns": obj.get("maxRuns"), + "availableRuns": obj.get("availableRuns"), + "dispatcherId": obj.get("dispatcherId"), + "labels": [WorkerLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, + "webhookUrl": obj.get("webhookUrl"), + "webhookId": obj.get("webhookId") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/worker_label.py b/hatchet_sdk/clients/rest/models/worker_label.py index 151febce..75f6b49b 100644 --- a/hatchet_sdk/clients/rest/models/worker_label.py +++ b/hatchet_sdk/clients/rest/models/worker_label.py @@ -13,28 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class WorkerLabel(BaseModel): """ WorkerLabel - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta key: StrictStr = Field(description="The key of the label.") - value: Optional[StrictStr] = Field( - default=None, description="The value of the label." - ) + value: Optional[StrictStr] = Field(default=None, description="The value of the label.") __properties: ClassVar[List[str]] = ["metadata", "key", "value"] model_config = ConfigDict( @@ -43,6 +38,7 @@ class WorkerLabel(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod @@ -88,15 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "key": obj.get("key"), - "value": obj.get("value"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "key": obj.get("key"), + "value": obj.get("value") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/worker_list.py b/hatchet_sdk/clients/rest/models/worker_list.py index 3ffa4349..99c46339 100644 --- a/hatchet_sdk/clients/rest/models/worker_list.py +++ b/hatchet_sdk/clients/rest/models/worker_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.worker import Worker - +from typing import Optional, Set +from typing_extensions import Self class WorkerList(BaseModel): """ WorkerList - """ # noqa: E501 - + """ # noqa: E501 pagination: Optional[PaginationResponse] = None rows: Optional[List[Worker]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -41,6 +38,7 @@ class WorkerList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,14 +73,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [Worker.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [Worker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow.py b/hatchet_sdk/clients/rest/models/workflow.py index 1d772ff0..b547619a 100644 --- a/hatchet_sdk/clients/rest/models/workflow.py +++ b/hatchet_sdk/clients/rest/models/workflow.py @@ -13,45 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag - +from typing import Optional, Set +from typing_extensions import Self class Workflow(BaseModel): """ Workflow - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta name: StrictStr = Field(description="The name of the workflow.") - description: Optional[StrictStr] = Field( - default=None, description="The description of the workflow." - ) + description: Optional[StrictStr] = Field(default=None, description="The description of the workflow.") versions: Optional[List[WorkflowVersionMeta]] = None - tags: Optional[List[WorkflowTag]] = Field( - default=None, description="The tags of the workflow." - ) - jobs: Optional[List[Job]] = Field( - default=None, description="The jobs of the workflow." - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "name", - "description", - "versions", - "tags", - "jobs", - ] + tags: Optional[List[WorkflowTag]] = Field(default=None, description="The tags of the workflow.") + jobs: Optional[List[Job]] = Field(default=None, description="The jobs of the workflow.") + __properties: ClassVar[List[str]] = ["metadata", "name", "description", "versions", "tags", "jobs"] model_config = ConfigDict( populate_by_name=True, @@ -59,6 +43,7 @@ class Workflow(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -83,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -92,28 +78,28 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in versions (list) _items = [] if self.versions: for _item in self.versions: if _item: _items.append(_item.to_dict()) - _dict["versions"] = _items + _dict['versions'] = _items # override the default output from pydantic by calling `to_dict()` of each item in tags (list) _items = [] if self.tags: for _item in self.tags: if _item: _items.append(_item.to_dict()) - _dict["tags"] = _items + _dict['tags'] = _items # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: for _item in self.jobs: if _item: _items.append(_item.to_dict()) - _dict["jobs"] = _items + _dict['jobs'] = _items return _dict @classmethod @@ -125,36 +111,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "description": obj.get("description"), - "versions": ( - [WorkflowVersionMeta.from_dict(_item) for _item in obj["versions"]] - if obj.get("versions") is not None - else None - ), - "tags": ( - [WorkflowTag.from_dict(_item) for _item in obj["tags"]] - if obj.get("tags") is not None - else None - ), - "jobs": ( - [Job.from_dict(_item) for _item in obj["jobs"]] - if obj.get("jobs") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "description": obj.get("description"), + "versions": [WorkflowVersionMeta.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None, + "tags": [WorkflowTag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, + "jobs": [Job.from_dict(_item) for _item in obj["jobs"]] if obj.get("jobs") is not None else None + }) return _obj - from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta - # TODO: Rewrite to not use raise_errors Workflow.model_rebuild(raise_errors=False) + diff --git a/hatchet_sdk/clients/rest/models/workflow_concurrency.py b/hatchet_sdk/clients/rest/models/workflow_concurrency.py index db3bf854..44a8340c 100644 --- a/hatchet_sdk/clients/rest/models/workflow_concurrency.py +++ b/hatchet_sdk/clients/rest/models/workflow_concurrency.py @@ -13,47 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class WorkflowConcurrency(BaseModel): """ WorkflowConcurrency - """ # noqa: E501 - - max_runs: StrictInt = Field( - description="The maximum number of concurrent workflow runs.", alias="maxRuns" - ) - limit_strategy: StrictStr = Field( - description="The strategy to use when the concurrency limit is reached.", - alias="limitStrategy", - ) - get_concurrency_group: StrictStr = Field( - description="An action which gets the concurrency group for the WorkflowRun.", - alias="getConcurrencyGroup", - ) - __properties: ClassVar[List[str]] = [ - "maxRuns", - "limitStrategy", - "getConcurrencyGroup", - ] + """ # noqa: E501 + max_runs: StrictInt = Field(description="The maximum number of concurrent workflow runs.", alias="maxRuns") + limit_strategy: StrictStr = Field(description="The strategy to use when the concurrency limit is reached.", alias="limitStrategy") + get_concurrency_group: StrictStr = Field(description="An action which gets the concurrency group for the WorkflowRun.", alias="getConcurrencyGroup") + __properties: ClassVar[List[str]] = ["maxRuns", "limitStrategy", "getConcurrencyGroup"] - @field_validator("limit_strategy") + @field_validator('limit_strategy') def limit_strategy_validate_enum(cls, value): """Validates the enum""" - if value not in set( - ["CANCEL_IN_PROGRESS", "DROP_NEWEST", "QUEUE_NEWEST", "GROUP_ROUND_ROBIN"] - ): - raise ValueError( - "must be one of enum values ('CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN')" - ) + if value not in set(['CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN']): + raise ValueError("must be one of enum values ('CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN')") return value model_config = ConfigDict( @@ -62,6 +44,7 @@ def limit_strategy_validate_enum(cls, value): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -86,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -104,11 +88,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "maxRuns": obj.get("maxRuns"), - "limitStrategy": obj.get("limitStrategy"), - "getConcurrencyGroup": obj.get("getConcurrencyGroup"), - } - ) + _obj = cls.model_validate({ + "maxRuns": obj.get("maxRuns"), + "limitStrategy": obj.get("limitStrategy"), + "getConcurrencyGroup": obj.get("getConcurrencyGroup") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_kind.py b/hatchet_sdk/clients/rest/models/workflow_kind.py index e258a048..d91ef68a 100644 --- a/hatchet_sdk/clients/rest/models/workflow_kind.py +++ b/hatchet_sdk/clients/rest/models/workflow_kind.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,11 +26,13 @@ class WorkflowKind(str, Enum): """ allowed enum values """ - FUNCTION = "FUNCTION" - DURABLE = "DURABLE" - DAG = "DAG" + FUNCTION = 'FUNCTION' + DURABLE = 'DURABLE' + DAG = 'DAG' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowKind from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/workflow_list.py b/hatchet_sdk/clients/rest/models/workflow_list.py index 72f9fb90..3f6ba942 100644 --- a/hatchet_sdk/clients/rest/models/workflow_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_list.py @@ -13,25 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.workflow import Workflow - +from typing import Optional, Set +from typing_extensions import Self class WorkflowList(BaseModel): """ WorkflowList - """ # noqa: E501 - + """ # noqa: E501 metadata: Optional[APIResourceMeta] = None rows: Optional[List[Workflow]] = None pagination: Optional[PaginationResponse] = None @@ -43,6 +40,7 @@ class WorkflowList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,17 +75,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod @@ -98,23 +97,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "rows": ( - [Workflow.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "rows": [Workflow.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_metrics.py b/hatchet_sdk/clients/rest/models/workflow_metrics.py index 8158e732..5b0dccc8 100644 --- a/hatchet_sdk/clients/rest/models/workflow_metrics.py +++ b/hatchet_sdk/clients/rest/models/workflow_metrics.py @@ -13,31 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class WorkflowMetrics(BaseModel): """ WorkflowMetrics - """ # noqa: E501 - - group_key_runs_count: Optional[StrictInt] = Field( - default=None, - description="The number of runs for a specific group key (passed via filter)", - alias="groupKeyRunsCount", - ) - group_key_count: Optional[StrictInt] = Field( - default=None, - description="The total number of concurrency group keys.", - alias="groupKeyCount", - ) + """ # noqa: E501 + group_key_runs_count: Optional[StrictInt] = Field(default=None, description="The number of runs for a specific group key (passed via filter)", alias="groupKeyRunsCount") + group_key_count: Optional[StrictInt] = Field(default=None, description="The total number of concurrency group keys.", alias="groupKeyCount") __properties: ClassVar[List[str]] = ["groupKeyRunsCount", "groupKeyCount"] model_config = ConfigDict( @@ -46,6 +36,7 @@ class WorkflowMetrics(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -70,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,10 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "groupKeyRunsCount": obj.get("groupKeyRunsCount"), - "groupKeyCount": obj.get("groupKeyCount"), - } - ) + _obj = cls.model_validate({ + "groupKeyRunsCount": obj.get("groupKeyRunsCount"), + "groupKeyCount": obj.get("groupKeyCount") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run.py b/hatchet_sdk/clients/rest/models/workflow_run.py index 3362b830..cffcdf30 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run.py +++ b/hatchet_sdk/clients/rest/models/workflow_run.py @@ -13,35 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( - WorkflowRunTriggeredBy, -) +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion - +from typing import Optional, Set +from typing_extensions import Self class WorkflowRun(BaseModel): """ WorkflowRun - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") workflow_version_id: StrictStr = Field(alias="workflowVersionId") - workflow_version: Optional[WorkflowVersion] = Field( - default=None, alias="workflowVersion" - ) + workflow_version: Optional[WorkflowVersion] = Field(default=None, alias="workflowVersion") status: WorkflowRunStatus display_name: Optional[StrictStr] = Field(default=None, alias="displayName") job_runs: Optional[List[JobRun]] = Field(default=None, alias="jobRuns") @@ -51,33 +45,10 @@ class WorkflowRun(BaseModel): started_at: Optional[datetime] = Field(default=None, alias="startedAt") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") duration: Optional[StrictInt] = None - parent_id: Optional[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field(default=None, alias="parentId") - parent_step_run_id: Optional[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field(default=None, alias="parentStepRunId") - additional_metadata: Optional[Dict[str, Any]] = Field( - default=None, alias="additionalMetadata" - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "tenantId", - "workflowVersionId", - "workflowVersion", - "status", - "displayName", - "jobRuns", - "triggeredBy", - "input", - "error", - "startedAt", - "finishedAt", - "duration", - "parentId", - "parentStepRunId", - "additionalMetadata", - ] + parent_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, alias="parentId") + parent_step_run_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, alias="parentStepRunId") + additional_metadata: Optional[Dict[str, Any]] = Field(default=None, alias="additionalMetadata") + __properties: ClassVar[List[str]] = ["metadata", "tenantId", "workflowVersionId", "workflowVersion", "status", "displayName", "jobRuns", "triggeredBy", "input", "error", "startedAt", "finishedAt", "duration", "parentId", "parentStepRunId", "additionalMetadata"] model_config = ConfigDict( populate_by_name=True, @@ -85,6 +56,7 @@ class WorkflowRun(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -109,7 +81,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -118,20 +91,20 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_version if self.workflow_version: - _dict["workflowVersion"] = self.workflow_version.to_dict() + _dict['workflowVersion'] = self.workflow_version.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in job_runs (list) _items = [] if self.job_runs: for _item in self.job_runs: if _item: _items.append(_item.to_dict()) - _dict["jobRuns"] = _items + _dict['jobRuns'] = _items # override the default output from pydantic by calling `to_dict()` of triggered_by if self.triggered_by: - _dict["triggeredBy"] = self.triggered_by.to_dict() + _dict['triggeredBy'] = self.triggered_by.to_dict() return _dict @classmethod @@ -143,46 +116,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "tenantId": obj.get("tenantId"), - "workflowVersionId": obj.get("workflowVersionId"), - "workflowVersion": ( - WorkflowVersion.from_dict(obj["workflowVersion"]) - if obj.get("workflowVersion") is not None - else None - ), - "status": obj.get("status"), - "displayName": obj.get("displayName"), - "jobRuns": ( - [JobRun.from_dict(_item) for _item in obj["jobRuns"]] - if obj.get("jobRuns") is not None - else None - ), - "triggeredBy": ( - WorkflowRunTriggeredBy.from_dict(obj["triggeredBy"]) - if obj.get("triggeredBy") is not None - else None - ), - "input": obj.get("input"), - "error": obj.get("error"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "duration": obj.get("duration"), - "parentId": obj.get("parentId"), - "parentStepRunId": obj.get("parentStepRunId"), - "additionalMetadata": obj.get("additionalMetadata"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "tenantId": obj.get("tenantId"), + "workflowVersionId": obj.get("workflowVersionId"), + "workflowVersion": WorkflowVersion.from_dict(obj["workflowVersion"]) if obj.get("workflowVersion") is not None else None, + "status": obj.get("status"), + "displayName": obj.get("displayName"), + "jobRuns": [JobRun.from_dict(_item) for _item in obj["jobRuns"]] if obj.get("jobRuns") is not None else None, + "triggeredBy": WorkflowRunTriggeredBy.from_dict(obj["triggeredBy"]) if obj.get("triggeredBy") is not None else None, + "input": obj.get("input"), + "error": obj.get("error"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "duration": obj.get("duration"), + "parentId": obj.get("parentId"), + "parentStepRunId": obj.get("parentStepRunId"), + "additionalMetadata": obj.get("additionalMetadata") + }) return _obj - from hatchet_sdk.clients.rest.models.job_run import JobRun - # TODO: Rewrite to not use raise_errors WorkflowRun.model_rebuild(raise_errors=False) + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py b/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py index fbf545be..6e82154b 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class WorkflowRunCancel200Response(BaseModel): """ WorkflowRunCancel200Response - """ # noqa: E501 - - workflow_run_ids: Optional[ - List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] - ] = Field(default=None, alias="workflowRunIds") + """ # noqa: E501 + workflow_run_ids: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field(default=None, alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -39,6 +36,7 @@ class WorkflowRunCancel200Response(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) + _obj = cls.model_validate({ + "workflowRunIds": obj.get("workflowRunIds") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_list.py b/hatchet_sdk/clients/rest/models/workflow_run_list.py index e57a14f4..36b3b9f5 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_list.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun - +from typing import Optional, Set +from typing_extensions import Self class WorkflowRunList(BaseModel): """ WorkflowRunList - """ # noqa: E501 - + """ # noqa: E501 rows: Optional[List[WorkflowRun]] = None pagination: Optional[PaginationResponse] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -41,6 +38,7 @@ class WorkflowRunList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,10 +77,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod @@ -93,18 +92,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "rows": ( - [WorkflowRun.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "rows": [WorkflowRun.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py b/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py index 4b499699..4bc03671 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,10 +26,12 @@ class WorkflowRunOrderByDirection(str, Enum): """ allowed enum values """ - ASC = "ASC" - DESC = "DESC" + ASC = 'ASC' + DESC = 'DESC' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunOrderByDirection from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py b/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py index bad42454..3d47ecc8 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,12 +26,14 @@ class WorkflowRunOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = "createdAt" - STARTEDAT = "startedAt" - FINISHEDAT = "finishedAt" - DURATION = "duration" + CREATEDAT = 'createdAt' + STARTEDAT = 'startedAt' + FINISHEDAT = 'finishedAt' + DURATION = 'duration' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunOrderByField from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_status.py b/hatchet_sdk/clients/rest/models/workflow_run_status.py index a7931216..68fb4154 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_status.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_status.py @@ -13,10 +13,8 @@ from __future__ import annotations - import json from enum import Enum - from typing_extensions import Self @@ -28,14 +26,16 @@ class WorkflowRunStatus(str, Enum): """ allowed enum values """ - PENDING = "PENDING" - RUNNING = "RUNNING" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - QUEUED = "QUEUED" + PENDING = 'PENDING' + RUNNING = 'RUNNING' + SUCCEEDED = 'SUCCEEDED' + FAILED = 'FAILED' + CANCELLED = 'CANCELLED' + QUEUED = 'QUEUED' @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunStatus from a JSON string""" return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py index a69fc9de..07dbebcd 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py @@ -13,38 +13,28 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.event import Event - +from typing import Optional, Set +from typing_extensions import Self class WorkflowRunTriggeredBy(BaseModel): """ WorkflowRunTriggeredBy - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta parent_id: StrictStr = Field(alias="parentId") event_id: Optional[StrictStr] = Field(default=None, alias="eventId") event: Optional[Event] = None cron_parent_id: Optional[StrictStr] = Field(default=None, alias="cronParentId") cron_schedule: Optional[StrictStr] = Field(default=None, alias="cronSchedule") - __properties: ClassVar[List[str]] = [ - "metadata", - "parentId", - "eventId", - "event", - "cronParentId", - "cronSchedule", - ] + __properties: ClassVar[List[str]] = ["metadata", "parentId", "eventId", "event", "cronParentId", "cronSchedule"] model_config = ConfigDict( populate_by_name=True, @@ -52,6 +42,7 @@ class WorkflowRunTriggeredBy(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -76,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,10 +77,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of event if self.event: - _dict["event"] = self.event.to_dict() + _dict['event'] = self.event.to_dict() return _dict @classmethod @@ -100,22 +92,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "parentId": obj.get("parentId"), - "eventId": obj.get("eventId"), - "event": ( - Event.from_dict(obj["event"]) - if obj.get("event") is not None - else None - ), - "cronParentId": obj.get("cronParentId"), - "cronSchedule": obj.get("cronSchedule"), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "parentId": obj.get("parentId"), + "eventId": obj.get("eventId"), + "event": Event.from_dict(obj["event"]) if obj.get("event") is not None else None, + "cronParentId": obj.get("cronParentId"), + "cronSchedule": obj.get("cronSchedule") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py b/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py index d5557cda..d545a282 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class WorkflowRunsCancelRequest(BaseModel): """ WorkflowRunsCancelRequest - """ # noqa: E501 - - workflow_run_ids: List[ - Annotated[str, Field(min_length=36, strict=True, max_length=36)] - ] = Field(alias="workflowRunIds") + """ # noqa: E501 + workflow_run_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -39,6 +36,7 @@ class WorkflowRunsCancelRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +80,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) + _obj = cls.model_validate({ + "workflowRunIds": obj.get("workflowRunIds") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py index 5f70c441..ad171718 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py @@ -13,26 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( - WorkflowRunsMetricsCounts, -) - - class WorkflowRunsMetrics(BaseModel): """ WorkflowRunsMetrics - """ # noqa: E501 - - counts: Optional[WorkflowRunsMetricsCounts] = None + """ # noqa: E501 + counts: Optional[Dict[str, Any]] = None __properties: ClassVar[List[str]] = ["counts"] model_config = ConfigDict( @@ -41,6 +35,7 @@ class WorkflowRunsMetrics(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,7 +70,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of counts if self.counts: - _dict["counts"] = self.counts.to_dict() + _dict['counts'] = self.counts.to_dict() return _dict @classmethod @@ -86,13 +82,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "counts": ( - WorkflowRunsMetricsCounts.from_dict(obj["counts"]) - if obj.get("counts") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "counts": WorkflowRunsMetricsCounts.from_dict(obj["counts"]) if obj.get("counts") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py b/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py index c80b0997..3695d60e 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py @@ -13,33 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class WorkflowRunsMetricsCounts(BaseModel): """ WorkflowRunsMetricsCounts - """ # noqa: E501 - + """ # noqa: E501 pending: Optional[StrictInt] = Field(default=None, alias="PENDING") running: Optional[StrictInt] = Field(default=None, alias="RUNNING") succeeded: Optional[StrictInt] = Field(default=None, alias="SUCCEEDED") failed: Optional[StrictInt] = Field(default=None, alias="FAILED") queued: Optional[StrictInt] = Field(default=None, alias="QUEUED") - __properties: ClassVar[List[str]] = [ - "PENDING", - "RUNNING", - "SUCCEEDED", - "FAILED", - "QUEUED", - ] + __properties: ClassVar[List[str]] = ["PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] model_config = ConfigDict( populate_by_name=True, @@ -47,6 +39,7 @@ class WorkflowRunsMetricsCounts(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -71,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -89,13 +83,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "PENDING": obj.get("PENDING"), - "RUNNING": obj.get("RUNNING"), - "SUCCEEDED": obj.get("SUCCEEDED"), - "FAILED": obj.get("FAILED"), - "QUEUED": obj.get("QUEUED"), - } - ) + _obj = cls.model_validate({ + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_tag.py b/hatchet_sdk/clients/rest/models/workflow_tag.py index fcd3423a..28a68afc 100644 --- a/hatchet_sdk/clients/rest/models/workflow_tag.py +++ b/hatchet_sdk/clients/rest/models/workflow_tag.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class WorkflowTag(BaseModel): """ WorkflowTag - """ # noqa: E501 - + """ # noqa: E501 name: StrictStr = Field(description="The name of the workflow.") color: StrictStr = Field(description="The description of the workflow.") __properties: ClassVar[List[str]] = ["name", "color"] @@ -38,6 +36,7 @@ class WorkflowTag(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,5 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"name": obj.get("name"), "color": obj.get("color")}) + _obj = cls.model_validate({ + "name": obj.get("name"), + "color": obj.get("color") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py b/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py index 1750e659..550e9609 100644 --- a/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py +++ b/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class WorkflowTriggerCronRef(BaseModel): """ WorkflowTriggerCronRef - """ # noqa: E501 - + """ # noqa: E501 parent_id: Optional[StrictStr] = None cron: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["parent_id", "cron"] @@ -38,6 +36,7 @@ class WorkflowTriggerCronRef(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"parent_id": obj.get("parent_id"), "cron": obj.get("cron")} - ) + _obj = cls.model_validate({ + "parent_id": obj.get("parent_id"), + "cron": obj.get("cron") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py b/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py index cfabbe02..d2b7db76 100644 --- a/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py +++ b/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - class WorkflowTriggerEventRef(BaseModel): """ WorkflowTriggerEventRef - """ # noqa: E501 - + """ # noqa: E501 parent_id: Optional[StrictStr] = None event_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["parent_id", "event_key"] @@ -38,6 +36,7 @@ class WorkflowTriggerEventRef(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,7 +80,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"parent_id": obj.get("parent_id"), "event_key": obj.get("event_key")} - ) + _obj = cls.model_validate({ + "parent_id": obj.get("parent_id"), + "event_key": obj.get("event_key") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_triggers.py b/hatchet_sdk/clients/rest/models/workflow_triggers.py index d3fff3f1..77a69376 100644 --- a/hatchet_sdk/clients/rest/models/workflow_triggers.py +++ b/hatchet_sdk/clients/rest/models/workflow_triggers.py @@ -13,41 +13,28 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( - WorkflowTriggerCronRef, -) -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( - WorkflowTriggerEventRef, -) - +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef +from typing import Optional, Set +from typing_extensions import Self class WorkflowTriggers(BaseModel): """ WorkflowTriggers - """ # noqa: E501 - + """ # noqa: E501 metadata: Optional[APIResourceMeta] = None workflow_version_id: Optional[StrictStr] = None tenant_id: Optional[StrictStr] = None events: Optional[List[WorkflowTriggerEventRef]] = None crons: Optional[List[WorkflowTriggerCronRef]] = None - __properties: ClassVar[List[str]] = [ - "metadata", - "workflow_version_id", - "tenant_id", - "events", - "crons", - ] + __properties: ClassVar[List[str]] = ["metadata", "workflow_version_id", "tenant_id", "events", "crons"] model_config = ConfigDict( populate_by_name=True, @@ -55,6 +42,7 @@ class WorkflowTriggers(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -79,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,21 +77,21 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: for _item in self.events: if _item: _items.append(_item.to_dict()) - _dict["events"] = _items + _dict['events'] = _items # override the default output from pydantic by calling `to_dict()` of each item in crons (list) _items = [] if self.crons: for _item in self.crons: if _item: _items.append(_item.to_dict()) - _dict["crons"] = _items + _dict['crons'] = _items return _dict @classmethod @@ -114,28 +103,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "workflow_version_id": obj.get("workflow_version_id"), - "tenant_id": obj.get("tenant_id"), - "events": ( - [ - WorkflowTriggerEventRef.from_dict(_item) - for _item in obj["events"] - ] - if obj.get("events") is not None - else None - ), - "crons": ( - [WorkflowTriggerCronRef.from_dict(_item) for _item in obj["crons"]] - if obj.get("crons") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "workflow_version_id": obj.get("workflow_version_id"), + "tenant_id": obj.get("tenant_id"), + "events": [WorkflowTriggerEventRef.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "crons": [WorkflowTriggerCronRef.from_dict(_item) for _item in obj["crons"]] if obj.get("crons") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_version.py b/hatchet_sdk/clients/rest/models/workflow_version.py index 67c85009..9da07553 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version.py +++ b/hatchet_sdk/clients/rest/models/workflow_version.py @@ -13,27 +13,24 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.workflow import Workflow from hatchet_sdk.clients.rest.models.workflow_concurrency import WorkflowConcurrency from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers - +from typing import Optional, Set +from typing_extensions import Self class WorkflowVersion(BaseModel): """ WorkflowVersion - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta version: StrictStr = Field(description="The version of the workflow.") order: StrictInt @@ -43,17 +40,7 @@ class WorkflowVersion(BaseModel): triggers: Optional[WorkflowTriggers] = None schedule_timeout: Optional[StrictStr] = Field(default=None, alias="scheduleTimeout") jobs: Optional[List[Job]] = None - __properties: ClassVar[List[str]] = [ - "metadata", - "version", - "order", - "workflowId", - "workflow", - "concurrency", - "triggers", - "scheduleTimeout", - "jobs", - ] + __properties: ClassVar[List[str]] = ["metadata", "version", "order", "workflowId", "workflow", "concurrency", "triggers", "scheduleTimeout", "jobs"] model_config = ConfigDict( populate_by_name=True, @@ -61,6 +48,7 @@ class WorkflowVersion(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -85,7 +73,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -94,23 +83,23 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow if self.workflow: - _dict["workflow"] = self.workflow.to_dict() + _dict['workflow'] = self.workflow.to_dict() # override the default output from pydantic by calling `to_dict()` of concurrency if self.concurrency: - _dict["concurrency"] = self.concurrency.to_dict() + _dict['concurrency'] = self.concurrency.to_dict() # override the default output from pydantic by calling `to_dict()` of triggers if self.triggers: - _dict["triggers"] = self.triggers.to_dict() + _dict['triggers'] = self.triggers.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: for _item in self.jobs: if _item: _items.append(_item.to_dict()) - _dict["jobs"] = _items + _dict['jobs'] = _items return _dict @classmethod @@ -122,37 +111,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "version": obj.get("version"), - "order": obj.get("order"), - "workflowId": obj.get("workflowId"), - "workflow": ( - Workflow.from_dict(obj["workflow"]) - if obj.get("workflow") is not None - else None - ), - "concurrency": ( - WorkflowConcurrency.from_dict(obj["concurrency"]) - if obj.get("concurrency") is not None - else None - ), - "triggers": ( - WorkflowTriggers.from_dict(obj["triggers"]) - if obj.get("triggers") is not None - else None - ), - "scheduleTimeout": obj.get("scheduleTimeout"), - "jobs": ( - [Job.from_dict(_item) for _item in obj["jobs"]] - if obj.get("jobs") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "version": obj.get("version"), + "order": obj.get("order"), + "workflowId": obj.get("workflowId"), + "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None, + "concurrency": WorkflowConcurrency.from_dict(obj["concurrency"]) if obj.get("concurrency") is not None else None, + "triggers": WorkflowTriggers.from_dict(obj["triggers"]) if obj.get("triggers") is not None else None, + "scheduleTimeout": obj.get("scheduleTimeout"), + "jobs": [Job.from_dict(_item) for _item in obj["jobs"]] if obj.get("jobs") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_version_definition.py b/hatchet_sdk/clients/rest/models/workflow_version_definition.py index 3f44c23a..dd0f9847 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version_definition.py +++ b/hatchet_sdk/clients/rest/models/workflow_version_definition.py @@ -13,24 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - class WorkflowVersionDefinition(BaseModel): """ WorkflowVersionDefinition - """ # noqa: E501 - - raw_definition: StrictStr = Field( - description="The raw YAML definition of the workflow.", alias="rawDefinition" - ) + """ # noqa: E501 + raw_definition: StrictStr = Field(description="The raw YAML definition of the workflow.", alias="rawDefinition") __properties: ClassVar[List[str]] = ["rawDefinition"] model_config = ConfigDict( @@ -39,6 +35,7 @@ class WorkflowVersionDefinition(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,5 +79,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"rawDefinition": obj.get("rawDefinition")}) + _obj = cls.model_validate({ + "rawDefinition": obj.get("rawDefinition") + }) return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_version_meta.py b/hatchet_sdk/clients/rest/models/workflow_version_meta.py index be2c5672..92bc0d16 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version_meta.py +++ b/hatchet_sdk/clients/rest/models/workflow_version_meta.py @@ -13,35 +13,26 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - +from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta - +from typing import Optional, Set +from typing_extensions import Self class WorkflowVersionMeta(BaseModel): """ WorkflowVersionMeta - """ # noqa: E501 - + """ # noqa: E501 metadata: APIResourceMeta version: StrictStr = Field(description="The version of the workflow.") order: StrictInt workflow_id: StrictStr = Field(alias="workflowId") workflow: Optional[Workflow] = None - __properties: ClassVar[List[str]] = [ - "metadata", - "version", - "order", - "workflowId", - "workflow", - ] + __properties: ClassVar[List[str]] = ["metadata", "version", "order", "workflowId", "workflow"] model_config = ConfigDict( populate_by_name=True, @@ -49,6 +40,7 @@ class WorkflowVersionMeta(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,7 +65,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -82,10 +75,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow if self.workflow: - _dict["workflow"] = self.workflow.to_dict() + _dict['workflow'] = self.workflow.to_dict() return _dict @classmethod @@ -97,27 +90,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "version": obj.get("version"), - "order": obj.get("order"), - "workflowId": obj.get("workflowId"), - "workflow": ( - Workflow.from_dict(obj["workflow"]) - if obj.get("workflow") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "version": obj.get("version"), + "order": obj.get("order"), + "workflowId": obj.get("workflowId"), + "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None + }) return _obj - from hatchet_sdk.clients.rest.models.workflow import Workflow - # TODO: Rewrite to not use raise_errors WorkflowVersionMeta.model_rebuild(raise_errors=False) + diff --git a/hatchet_sdk/clients/rest/rest.py b/hatchet_sdk/clients/rest/rest.py index 67566fa1..fb4880ec 100644 --- a/hatchet_sdk/clients/rest/rest.py +++ b/hatchet_sdk/clients/rest/rest.py @@ -25,8 +25,7 @@ RESTResponseType = aiohttp.ClientResponse -ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"}) - +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) class RESTResponse(io.IOBase): @@ -57,7 +56,9 @@ def __init__(self, configuration) -> None: # maxsize is number of requests to host that are allowed in parallel maxsize = configuration.connection_pool_maxsize - ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -67,13 +68,19 @@ def __init__(self, configuration) -> None: ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE - connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context) + connector = aiohttp.TCPConnector( + limit=maxsize, + ssl=ssl_context + ) self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers # https pool manager - self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) + self.pool_manager = aiohttp.ClientSession( + connector=connector, + trust_env=True + ) retries = configuration.retries self.retry_client: Optional[aiohttp_retry.RetryClient] @@ -81,8 +88,11 @@ def __init__(self, configuration) -> None: self.retry_client = aiohttp_retry.RetryClient( client_session=self.pool_manager, retry_options=aiohttp_retry.ExponentialRetry( - attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 - ), + attempts=retries, + factor=0.0, + start_timeout=0.0, + max_timeout=120.0 + ) ) else: self.retry_client = None @@ -99,7 +109,7 @@ async def request( headers=None, body=None, post_params=None, - _request_timeout=None, + _request_timeout=None ): """Execute request @@ -116,7 +126,15 @@ async def request( (connection, read) timeouts. """ method = method.upper() - assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -128,10 +146,15 @@ async def request( # url already contains the URL query string timeout = _request_timeout or 5 * 60 - if "Content-Type" not in headers: - headers["Content-Type"] = "application/json" + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' - args = {"method": method, "url": url, "timeout": timeout, "headers": headers} + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } if self.proxy: args["proxy"] = self.proxy @@ -139,22 +162,27 @@ async def request( args["proxy_headers"] = self.proxy_headers # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - if re.search("json", headers["Content-Type"], re.IGNORECASE): + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers["Content-Type"] == "application/x-www-form-urlencoded": + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': args["data"] = aiohttp.FormData(post_params) - elif headers["Content-Type"] == "multipart/form-data": + elif headers['Content-Type'] == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by aiohttp - del headers["Content-Type"] + del headers['Content-Type'] data = aiohttp.FormData() for param in post_params: k, v = param if isinstance(v, tuple) and len(v) == 3: - data.add_field(k, value=v[1], filename=v[0], content_type=v[2]) + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) else: data.add_field(k, v) args["data"] = data @@ -180,3 +208,8 @@ async def request( r = await pool_manager.request(**args) return RESTResponse(r) + + + + + From 3bee8a909d9f796585c064eafee0ed1144efbb74 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Fri, 25 Oct 2024 13:42:21 -0400 Subject: [PATCH 06/33] chore gen --- hatchet_sdk/clients/cloud_rest/__init__.py | 108 +- .../clients/cloud_rest/api/__init__.py | 1 - .../clients/cloud_rest/api/billing_api.py | 316 +- .../clients/cloud_rest/api/build_api.py | 111 +- .../cloud_rest/api/feature_flags_api.py | 110 +- .../clients/cloud_rest/api/github_api.py | 537 ++-- hatchet_sdk/clients/cloud_rest/api/log_api.py | 431 +-- .../cloud_rest/api/managed_worker_api.py | 1090 +++---- .../clients/cloud_rest/api/metadata_api.py | 80 +- .../clients/cloud_rest/api/metrics_api.py | 483 +-- .../clients/cloud_rest/api/tenant_api.py | 119 +- .../clients/cloud_rest/api/user_api.py | 132 +- .../clients/cloud_rest/api/workflow_api.py | 162 +- hatchet_sdk/clients/cloud_rest/api_client.py | 254 +- .../clients/cloud_rest/api_response.py | 11 +- .../clients/cloud_rest/configuration.py | 216 +- hatchet_sdk/clients/cloud_rest/exceptions.py | 31 +- .../clients/cloud_rest/models/__init__.py | 92 +- .../cloud_rest/models/api_cloud_metadata.py | 44 +- .../clients/cloud_rest/models/api_error.py | 45 +- .../clients/cloud_rest/models/api_errors.py | 33 +- .../cloud_rest/models/api_resource_meta.py | 45 +- .../billing_portal_link_get200_response.py | 24 +- .../clients/cloud_rest/models/build.py | 57 +- .../clients/cloud_rest/models/build_step.py | 46 +- .../clients/cloud_rest/models/coupon.py | 76 +- .../cloud_rest/models/coupon_frequency.py | 8 +- .../models/create_build_step_request.py | 35 +- ...ate_managed_worker_build_config_request.py | 58 +- .../models/create_managed_worker_request.py | 70 +- ...e_managed_worker_runtime_config_request.py | 71 +- .../clients/cloud_rest/models/event_object.py | 66 +- .../cloud_rest/models/event_object_event.py | 20 +- .../cloud_rest/models/event_object_fly.py | 35 +- .../cloud_rest/models/event_object_fly_app.py | 23 +- .../cloud_rest/models/event_object_log.py | 20 +- .../models/github_app_installation.py | 46 +- .../cloud_rest/models/github_branch.py | 23 +- .../clients/cloud_rest/models/github_repo.py | 23 +- .../cloud_rest/models/histogram_bucket.py | 30 +- .../models/infra_as_code_request.py | 42 +- .../clients/cloud_rest/models/instance.py | 52 +- .../cloud_rest/models/instance_list.py | 41 +- .../list_github_app_installations_response.py | 45 +- .../clients/cloud_rest/models/log_line.py | 30 +- .../cloud_rest/models/log_line_list.py | 41 +- .../cloud_rest/models/managed_worker.py | 82 +- .../models/managed_worker_build_config.py | 66 +- .../cloud_rest/models/managed_worker_event.py | 53 +- .../models/managed_worker_event_list.py | 45 +- .../models/managed_worker_event_status.py | 12 +- .../cloud_rest/models/managed_worker_list.py | 41 +- .../models/managed_worker_region.py | 70 +- .../models/managed_worker_runtime_config.py | 75 +- .../cloud_rest/models/pagination_response.py | 36 +- .../models/runtime_config_actions_response.py | 20 +- .../cloud_rest/models/sample_histogram.py | 37 +- .../models/sample_histogram_pair.py | 35 +- .../cloud_rest/models/sample_stream.py | 40 +- .../cloud_rest/models/subscription_plan.py | 44 +- .../cloud_rest/models/tenant_billing_state.py | 87 +- .../models/tenant_payment_method.py | 42 +- .../cloud_rest/models/tenant_subscription.py | 52 +- .../models/tenant_subscription_status.py | 12 +- .../models/update_managed_worker_request.py | 75 +- .../models/update_tenant_subscription.py | 27 +- .../models/workflow_run_events_metric.py | 45 +- .../workflow_run_events_metrics_counts.py | 38 +- hatchet_sdk/clients/cloud_rest/rest.py | 69 +- hatchet_sdk/clients/rest/__init__.py | 195 +- hatchet_sdk/clients/rest/api/__init__.py | 7 +- hatchet_sdk/clients/rest/api/api_token_api.py | 343 +-- hatchet_sdk/clients/rest/api/default_api.py | 765 ++--- hatchet_sdk/clients/rest/api/event_api.py | 1973 ++++++++---- hatchet_sdk/clients/rest/api/github_api.py | 136 +- .../clients/rest/api/healthcheck_api.py | 142 +- hatchet_sdk/clients/rest/api/log_api.py | 230 +- hatchet_sdk/clients/rest/api/metadata_api.py | 233 +- .../clients/rest/api/rate_limits_api.py | 391 +++ hatchet_sdk/clients/rest/api/slack_api.py | 237 +- hatchet_sdk/clients/rest/api/sns_api.py | 366 ++- hatchet_sdk/clients/rest/api/step_run_api.py | 1173 ++++--- hatchet_sdk/clients/rest/api/tenant_api.py | 1976 ++++++------ hatchet_sdk/clients/rest/api/user_api.py | 969 +++--- hatchet_sdk/clients/rest/api/worker_api.py | 366 +-- hatchet_sdk/clients/rest/api/workflow_api.py | 2722 +++++++++++------ .../clients/rest/api/workflow_run_api.py | 925 +++++- .../clients/rest/api/workflow_runs_api.py | 270 +- hatchet_sdk/clients/rest/api_client.py | 254 +- hatchet_sdk/clients/rest/api_response.py | 11 +- hatchet_sdk/clients/rest/configuration.py | 212 +- hatchet_sdk/clients/rest/exceptions.py | 31 +- hatchet_sdk/clients/rest/models/__init__.py | 174 +- .../rest/models/accept_invite_request.py | 23 +- hatchet_sdk/clients/rest/models/api_error.py | 45 +- hatchet_sdk/clients/rest/models/api_errors.py | 33 +- hatchet_sdk/clients/rest/models/api_meta.py | 91 +- .../clients/rest/models/api_meta_auth.py | 24 +- .../rest/models/api_meta_integration.py | 27 +- .../clients/rest/models/api_meta_posthog.py | 31 +- .../clients/rest/models/api_resource_meta.py | 45 +- hatchet_sdk/clients/rest/models/api_token.py | 48 +- .../rest/models/bulk_create_event_request.py | 6 +- .../rest/models/bulk_create_event_response.py | 18 +- .../rest/models/create_api_token_request.py | 36 +- .../rest/models/create_api_token_response.py | 20 +- .../rest/models/create_event_request.py | 34 +- .../create_pull_request_from_step_run.py | 20 +- .../models/create_sns_integration_request.py | 24 +- ...create_tenant_alert_email_group_request.py | 20 +- .../models/create_tenant_invite_request.py | 24 +- .../rest/models/create_tenant_request.py | 21 +- hatchet_sdk/clients/rest/models/event.py | 88 +- hatchet_sdk/clients/rest/models/event_data.py | 20 +- .../clients/rest/models/event_key_list.py | 35 +- hatchet_sdk/clients/rest/models/event_list.py | 41 +- .../rest/models/event_order_by_direction.py | 8 +- .../rest/models/event_order_by_field.py | 6 +- .../rest/models/event_workflow_run_summary.py | 60 +- .../rest/models/get_step_run_diff_response.py | 33 +- hatchet_sdk/clients/rest/models/job.py | 69 +- hatchet_sdk/clients/rest/models/job_run.py | 101 +- .../clients/rest/models/job_run_status.py | 14 +- .../rest/models/list_api_tokens_response.py | 41 +- .../models/list_pull_requests_response.py | 33 +- .../rest/models/list_slack_webhooks.py | 41 +- .../rest/models/list_sns_integrations.py | 41 +- hatchet_sdk/clients/rest/models/log_line.py | 34 +- .../clients/rest/models/log_line_level.py | 12 +- .../clients/rest/models/log_line_list.py | 41 +- .../models/log_line_order_by_direction.py | 8 +- .../rest/models/log_line_order_by_field.py | 6 +- .../rest/models/pagination_response.py | 36 +- .../clients/rest/models/pull_request.py | 52 +- .../clients/rest/models/pull_request_state.py | 8 +- .../clients/rest/models/queue_metrics.py | 40 +- hatchet_sdk/clients/rest/models/rate_limit.py | 98 + .../clients/rest/models/rate_limit_list.py | 101 + .../models/rate_limit_order_by_direction.py | 37 + .../rest/models/rate_limit_order_by_field.py | 38 + .../clients/rest/models/recent_step_runs.py | 57 +- .../rest/models/reject_invite_request.py | 23 +- .../rest/models/replay_event_request.py | 27 +- .../models/replay_workflow_runs_request.py | 27 +- .../models/replay_workflow_runs_response.py | 33 +- .../rest/models/rerun_step_run_request.py | 20 +- .../clients/rest/models/semaphore_slots.py | 68 +- .../clients/rest/models/slack_webhook.py | 76 +- .../clients/rest/models/sns_integration.py | 59 +- hatchet_sdk/clients/rest/models/step.py | 66 +- hatchet_sdk/clients/rest/models/step_run.py | 141 +- .../clients/rest/models/step_run_archive.py | 86 +- .../rest/models/step_run_archive_list.py | 41 +- .../clients/rest/models/step_run_diff.py | 28 +- .../clients/rest/models/step_run_event.py | 62 +- .../rest/models/step_run_event_list.py | 41 +- .../rest/models/step_run_event_reason.py | 35 +- .../rest/models/step_run_event_severity.py | 10 +- .../clients/rest/models/step_run_status.py | 20 +- hatchet_sdk/clients/rest/models/tenant.py | 61 +- .../rest/models/tenant_alert_email_group.py | 35 +- .../models/tenant_alert_email_group_list.py | 45 +- .../rest/models/tenant_alerting_settings.py | 95 +- .../clients/rest/models/tenant_invite.py | 63 +- .../clients/rest/models/tenant_invite_list.py | 41 +- .../clients/rest/models/tenant_list.py | 41 +- .../clients/rest/models/tenant_member.py | 59 +- .../clients/rest/models/tenant_member_list.py | 41 +- .../clients/rest/models/tenant_member_role.py | 10 +- .../rest/models/tenant_queue_metrics.py | 42 +- .../clients/rest/models/tenant_resource.py | 14 +- .../rest/models/tenant_resource_limit.py | 86 +- .../rest/models/tenant_resource_policy.py | 37 +- .../models/tenant_step_run_queue_metrics.py | 86 + .../models/trigger_workflow_run_request.py | 30 +- ...update_tenant_alert_email_group_request.py | 20 +- .../models/update_tenant_invite_request.py | 23 +- .../rest/models/update_tenant_request.py | 90 +- .../rest/models/update_worker_request.py | 26 +- hatchet_sdk/clients/rest/models/user.py | 73 +- .../models/user_change_password_request.py | 27 +- .../clients/rest/models/user_login_request.py | 23 +- .../rest/models/user_register_request.py | 28 +- .../models/user_tenant_memberships_list.py | 41 +- .../clients/rest/models/user_tenant_public.py | 25 +- .../clients/rest/models/webhook_worker.py | 37 +- .../models/webhook_worker_create_request.py | 36 +- .../models/webhook_worker_create_response.py | 33 +- .../rest/models/webhook_worker_created.py | 39 +- .../models/webhook_worker_list_response.py | 41 +- .../rest/models/webhook_worker_request.py | 47 +- .../webhook_worker_request_list_response.py | 37 +- .../models/webhook_worker_request_method.py | 10 +- hatchet_sdk/clients/rest/models/worker.py | 180 +- .../clients/rest/models/worker_label.py | 41 +- .../clients/rest/models/worker_list.py | 41 +- hatchet_sdk/clients/rest/models/workflow.py | 90 +- .../rest/models/workflow_concurrency.py | 58 +- .../clients/rest/models/workflow_kind.py | 10 +- .../clients/rest/models/workflow_list.py | 49 +- .../clients/rest/models/workflow_metrics.py | 38 +- .../clients/rest/models/workflow_run.py | 124 +- .../models/workflow_run_cancel200_response.py | 27 +- .../clients/rest/models/workflow_run_list.py | 41 +- .../models/workflow_run_order_by_direction.py | 8 +- .../models/workflow_run_order_by_field.py | 12 +- .../clients/rest/models/workflow_run_shape.py | 6 +- .../rest/models/workflow_run_status.py | 16 +- .../rest/models/workflow_run_triggered_by.py | 59 +- .../models/workflow_runs_cancel_request.py | 27 +- .../rest/models/workflow_runs_metrics.py | 36 +- .../models/workflow_runs_metrics_counts.py | 40 +- .../clients/rest/models/workflow_tag.py | 21 +- .../rest/models/workflow_trigger_cron_ref.py | 23 +- .../rest/models/workflow_trigger_event_ref.py | 23 +- .../clients/rest/models/workflow_triggers.py | 72 +- .../rest/models/workflow_update_request.py | 87 + .../clients/rest/models/workflow_version.py | 97 +- .../models/workflow_version_definition.py | 24 +- .../rest/models/workflow_version_meta.py | 56 +- hatchet_sdk/clients/rest/rest.py | 69 +- hatchet_sdk/clients/rest_client.py | 8 +- hatchet_sdk/contracts/dispatcher_pb2.py | 20 +- hatchet_sdk/contracts/dispatcher_pb2.pyi | 2 + hatchet_sdk/contracts/events_pb2.py | 34 +- hatchet_sdk/contracts/events_pb2.pyi | 15 +- hatchet_sdk/contracts/events_pb2_grpc.py | 33 + hatchet_sdk/contracts/workflows_pb2.py | 90 +- hatchet_sdk/contracts/workflows_pb2.pyi | 30 +- hatchet_sdk/contracts/workflows_pb2_grpc.py | 33 + hatchet_sdk/worker/worker.py | 42 +- 231 files changed, 15812 insertions(+), 10601 deletions(-) create mode 100644 hatchet_sdk/clients/rest/api/rate_limits_api.py create mode 100644 hatchet_sdk/clients/rest/models/rate_limit.py create mode 100644 hatchet_sdk/clients/rest/models/rate_limit_list.py create mode 100644 hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py create mode 100644 hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py create mode 100644 hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py create mode 100644 hatchet_sdk/clients/rest/models/workflow_update_request.py diff --git a/hatchet_sdk/clients/cloud_rest/__init__.py b/hatchet_sdk/clients/cloud_rest/__init__.py index c2dd8931..cdfd048a 100644 --- a/hatchet_sdk/clients/cloud_rest/__init__.py +++ b/hatchet_sdk/clients/cloud_rest/__init__.py @@ -28,66 +28,114 @@ from hatchet_sdk.clients.cloud_rest.api.tenant_api import TenantApi from hatchet_sdk.clients.cloud_rest.api.user_api import UserApi from hatchet_sdk.clients.cloud_rest.api.workflow_api import WorkflowApi +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient # import ApiClient from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.api_client import ApiClient from hatchet_sdk.clients.cloud_rest.configuration import Configuration -from hatchet_sdk.clients.cloud_rest.exceptions import OpenApiException -from hatchet_sdk.clients.cloud_rest.exceptions import ApiTypeError -from hatchet_sdk.clients.cloud_rest.exceptions import ApiValueError -from hatchet_sdk.clients.cloud_rest.exceptions import ApiKeyError -from hatchet_sdk.clients.cloud_rest.exceptions import ApiAttributeError -from hatchet_sdk.clients.cloud_rest.exceptions import ApiException +from hatchet_sdk.clients.cloud_rest.exceptions import ( + ApiAttributeError, + ApiException, + ApiKeyError, + ApiTypeError, + ApiValueError, + OpenApiException, +) # import models into sdk package from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata from hatchet_sdk.clients.cloud_rest.models.api_error import APIError from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( + BillingPortalLinkGet200Response, +) from hatchet_sdk.clients.cloud_rest.models.build import Build from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( + CreateBuildStepRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( + CreateManagedWorkerBuildConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( + CreateManagedWorkerRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( + GithubAppInstallation, +) from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( + InfraAsCodeRequest, +) from hatchet_sdk.clients.cloud_rest.models.instance import Instance from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( + ListGithubAppInstallationsResponse, +) from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( + ManagedWorkerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( + ManagedWorkerEvent, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( + ManagedWorkerEventList, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( + ManagedWorkerEventStatus, +) from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( + ManagedWorkerRuntimeConfig, +) from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( + RuntimeConfigActionsResponse, +) from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( + SampleHistogramPair, +) from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( + TenantBillingState, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( + TenantPaymentMethod, +) from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( + TenantSubscriptionStatus, +) +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( + UpdateManagedWorkerRequest, +) +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( + UpdateTenantSubscription, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( + WorkflowRunEventsMetric, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( + WorkflowRunEventsMetricsCounts, +) diff --git a/hatchet_sdk/clients/cloud_rest/api/__init__.py b/hatchet_sdk/clients/cloud_rest/api/__init__.py index 5e487f82..eaab484b 100644 --- a/hatchet_sdk/clients/cloud_rest/api/__init__.py +++ b/hatchet_sdk/clients/cloud_rest/api/__init__.py @@ -12,4 +12,3 @@ from hatchet_sdk.clients.cloud_rest.api.tenant_api import TenantApi from hatchet_sdk.clients.cloud_rest.api.user_api import UserApi from hatchet_sdk.clients.cloud_rest.api.workflow_api import WorkflowApi - diff --git a/hatchet_sdk/clients/cloud_rest/api/billing_api.py b/hatchet_sdk/clients/cloud_rest/api/billing_api.py index 9e91eba4..f952a69a 100644 --- a/hatchet_sdk/clients/cloud_rest/api/billing_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/billing_api.py @@ -12,19 +12,20 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( + BillingPortalLinkGet200Response, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( + UpdateTenantSubscription, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -40,18 +41,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def billing_portal_link_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -84,24 +88,23 @@ async def billing_portal_link_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._billing_portal_link_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BillingPortalLinkGet200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "BillingPortalLinkGet200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -109,18 +112,21 @@ async def billing_portal_link_get( response_types_map=_response_types_map, ).data - @validate_call async def billing_portal_link_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -153,24 +159,23 @@ async def billing_portal_link_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._billing_portal_link_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BillingPortalLinkGet200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "BillingPortalLinkGet200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -178,18 +183,21 @@ async def billing_portal_link_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def billing_portal_link_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -222,28 +230,26 @@ async def billing_portal_link_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._billing_portal_link_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "BillingPortalLinkGet200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "BillingPortalLinkGet200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _billing_portal_link_get_serialize( self, tenant, @@ -255,8 +261,7 @@ def _billing_portal_link_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -267,30 +272,23 @@ def _billing_portal_link_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/billing/tenants/{tenant}/billing-portal-link', + method="GET", + resource_path="/api/v1/billing/tenants/{tenant}/billing-portal-link", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -300,12 +298,9 @@ def _billing_portal_link_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def lago_message_create( self, @@ -313,9 +308,8 @@ async def lago_message_create( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -346,23 +340,22 @@ async def lago_message_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._lago_message_create_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -370,7 +363,6 @@ async def lago_message_create( response_types_map=_response_types_map, ).data - @validate_call async def lago_message_create_with_http_info( self, @@ -378,9 +370,8 @@ async def lago_message_create_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -411,23 +402,22 @@ async def lago_message_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._lago_message_create_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -435,7 +425,6 @@ async def lago_message_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def lago_message_create_without_preload_content( self, @@ -443,9 +432,8 @@ async def lago_message_create_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -476,27 +464,25 @@ async def lago_message_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._lago_message_create_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _lago_message_create_serialize( self, _request_auth, @@ -507,8 +493,7 @@ def _lago_message_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -523,22 +508,17 @@ def _lago_message_create_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/billing/lago/webhook', + method="POST", + resource_path="/api/v1/billing/lago/webhook", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -548,24 +528,25 @@ def _lago_message_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def subscription_upsert( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], update_tenant_subscription: Optional[UpdateTenantSubscription] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -600,7 +581,7 @@ async def subscription_upsert( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._subscription_upsert_serialize( tenant=tenant, @@ -608,17 +589,16 @@ async def subscription_upsert( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantSubscription", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantSubscription", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -626,19 +606,22 @@ async def subscription_upsert( response_types_map=_response_types_map, ).data - @validate_call async def subscription_upsert_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], update_tenant_subscription: Optional[UpdateTenantSubscription] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -673,7 +656,7 @@ async def subscription_upsert_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._subscription_upsert_serialize( tenant=tenant, @@ -681,17 +664,16 @@ async def subscription_upsert_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantSubscription", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantSubscription", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -699,19 +681,22 @@ async def subscription_upsert_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def subscription_upsert_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], update_tenant_subscription: Optional[UpdateTenantSubscription] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -746,7 +731,7 @@ async def subscription_upsert_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._subscription_upsert_serialize( tenant=tenant, @@ -754,21 +739,19 @@ async def subscription_upsert_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantSubscription", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantSubscription", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _subscription_upsert_serialize( self, tenant, @@ -781,8 +764,7 @@ def _subscription_upsert_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -793,7 +775,7 @@ def _subscription_upsert_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -801,37 +783,27 @@ def _subscription_upsert_serialize( if update_tenant_subscription is not None: _body_params = update_tenant_subscription - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/billing/tenants/{tenant}/subscription', + method="PATCH", + resource_path="/api/v1/billing/tenants/{tenant}/subscription", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -841,7 +813,5 @@ def _subscription_upsert_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/build_api.py b/hatchet_sdk/clients/cloud_rest/api/build_api.py index 5408cebe..f2618ac5 100644 --- a/hatchet_sdk/clients/cloud_rest/api/build_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/build_api.py @@ -12,16 +12,14 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.build import Build from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.build import Build from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -37,18 +35,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def build_get( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,24 +82,23 @@ async def build_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_get_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Build", - '400': "APIErrors", - '403': "APIErrors", + "200": "Build", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -106,18 +106,21 @@ async def build_get( response_types_map=_response_types_map, ).data - @validate_call async def build_get_with_http_info( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -150,24 +153,23 @@ async def build_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_get_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Build", - '400': "APIErrors", - '403': "APIErrors", + "200": "Build", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -175,18 +177,21 @@ async def build_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def build_get_without_preload_content( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -219,28 +224,26 @@ async def build_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_get_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Build", - '400': "APIErrors", - '403': "APIErrors", + "200": "Build", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _build_get_serialize( self, build, @@ -252,8 +255,7 @@ def _build_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -264,30 +266,23 @@ def _build_get_serialize( # process the path parameters if build is not None: - _path_params['build'] = build + _path_params["build"] = build # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/build/{build}', + method="GET", + resource_path="/api/v1/cloud/build/{build}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -297,7 +292,5 @@ def _build_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py index 31cb4503..a53fbf95 100644 --- a/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py @@ -12,12 +12,9 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Dict +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized @@ -37,18 +34,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def feature_flags_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,24 +81,23 @@ async def feature_flags_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._feature_flags_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, str]", - '400': "APIErrors", - '403': "APIErrors", + "200": "Dict[str, str]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -106,18 +105,21 @@ async def feature_flags_list( response_types_map=_response_types_map, ).data - @validate_call async def feature_flags_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -150,24 +152,23 @@ async def feature_flags_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._feature_flags_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, str]", - '400': "APIErrors", - '403': "APIErrors", + "200": "Dict[str, str]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -175,18 +176,21 @@ async def feature_flags_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def feature_flags_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -219,28 +223,26 @@ async def feature_flags_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._feature_flags_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, str]", - '400': "APIErrors", - '403': "APIErrors", + "200": "Dict[str, str]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _feature_flags_list_serialize( self, tenant, @@ -252,8 +254,7 @@ def _feature_flags_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -264,30 +265,23 @@ def _feature_flags_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/tenants/{tenant}/feature-flags', + method="GET", + resource_path="/api/v1/cloud/tenants/{tenant}/feature-flags", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -297,7 +291,5 @@ def _feature_flags_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/github_api.py b/hatchet_sdk/clients/cloud_rest/api/github_api.py index 34fc20b7..04fdf4fe 100644 --- a/hatchet_sdk/clients/cloud_rest/api/github_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/github_api.py @@ -12,19 +12,18 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import List +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch -from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch +from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( + ListGithubAppInstallationsResponse, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -40,20 +39,26 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def github_app_list_branches( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -90,7 +95,7 @@ async def github_app_list_branches( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_branches_serialize( gh_installation=gh_installation, @@ -99,18 +104,17 @@ async def github_app_list_branches( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubBranch]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubBranch]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -118,20 +122,26 @@ async def github_app_list_branches( response_types_map=_response_types_map, ).data - @validate_call async def github_app_list_branches_with_http_info( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -168,7 +178,7 @@ async def github_app_list_branches_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_branches_serialize( gh_installation=gh_installation, @@ -177,18 +187,17 @@ async def github_app_list_branches_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubBranch]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubBranch]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -196,20 +205,26 @@ async def github_app_list_branches_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def github_app_list_branches_without_preload_content( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], gh_repo_owner: Annotated[StrictStr, Field(description="The repository owner")], gh_repo_name: Annotated[StrictStr, Field(description="The repository name")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -246,7 +261,7 @@ async def github_app_list_branches_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_branches_serialize( gh_installation=gh_installation, @@ -255,22 +270,20 @@ async def github_app_list_branches_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubBranch]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubBranch]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _github_app_list_branches_serialize( self, gh_installation, @@ -284,8 +297,7 @@ def _github_app_list_branches_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -296,33 +308,27 @@ def _github_app_list_branches_serialize( # process the path parameters if gh_installation is not None: - _path_params['gh-installation'] = gh_installation + _path_params["gh-installation"] = gh_installation if gh_repo_owner is not None: - _path_params['gh-repo-owner'] = gh_repo_owner + _path_params["gh-repo-owner"] = gh_repo_owner if gh_repo_name is not None: - _path_params['gh-repo-name'] = gh_repo_name + _path_params["gh-repo-name"] = gh_repo_name # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/github-app/installations/{gh-installation}/repos/{gh-repo-owner}/{gh-repo-name}/branches', + method="GET", + resource_path="/api/v1/cloud/github-app/installations/{gh-installation}/repos/{gh-repo-owner}/{gh-repo-name}/branches", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -332,12 +338,9 @@ def _github_app_list_branches_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def github_app_list_installations( self, @@ -345,9 +348,8 @@ async def github_app_list_installations( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -378,24 +380,23 @@ async def github_app_list_installations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_installations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListGithubAppInstallationsResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListGithubAppInstallationsResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -403,7 +404,6 @@ async def github_app_list_installations( response_types_map=_response_types_map, ).data - @validate_call async def github_app_list_installations_with_http_info( self, @@ -411,9 +411,8 @@ async def github_app_list_installations_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -444,24 +443,23 @@ async def github_app_list_installations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_installations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListGithubAppInstallationsResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListGithubAppInstallationsResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -469,7 +467,6 @@ async def github_app_list_installations_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def github_app_list_installations_without_preload_content( self, @@ -477,9 +474,8 @@ async def github_app_list_installations_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -510,28 +506,26 @@ async def github_app_list_installations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_installations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListGithubAppInstallationsResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListGithubAppInstallationsResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _github_app_list_installations_serialize( self, _request_auth, @@ -542,8 +536,7 @@ def _github_app_list_installations_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -558,23 +551,17 @@ def _github_app_list_installations_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/github-app/installations', + method="GET", + resource_path="/api/v1/cloud/github-app/installations", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -584,23 +571,27 @@ def _github_app_list_installations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def github_app_list_repos( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -633,25 +624,24 @@ async def github_app_list_repos( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_repos_serialize( gh_installation=gh_installation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubRepo]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubRepo]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -659,18 +649,24 @@ async def github_app_list_repos( response_types_map=_response_types_map, ).data - @validate_call async def github_app_list_repos_with_http_info( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -703,25 +699,24 @@ async def github_app_list_repos_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_repos_serialize( gh_installation=gh_installation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubRepo]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubRepo]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -729,18 +724,24 @@ async def github_app_list_repos_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def github_app_list_repos_without_preload_content( self, - gh_installation: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The installation id")], + gh_installation: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The installation id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -773,29 +774,27 @@ async def github_app_list_repos_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_app_list_repos_serialize( gh_installation=gh_installation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GithubRepo]", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "List[GithubRepo]", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _github_app_list_repos_serialize( self, gh_installation, @@ -807,8 +806,7 @@ def _github_app_list_repos_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -819,29 +817,23 @@ def _github_app_list_repos_serialize( # process the path parameters if gh_installation is not None: - _path_params['gh-installation'] = gh_installation + _path_params["gh-installation"] = gh_installation # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/github-app/installations/{gh-installation}/repos', + method="GET", + resource_path="/api/v1/cloud/github-app/installations/{gh-installation}/repos", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -851,12 +843,9 @@ def _github_app_list_repos_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def github_update_global_webhook( self, @@ -864,9 +853,8 @@ async def github_update_global_webhook( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -897,24 +885,23 @@ async def github_update_global_webhook( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_global_webhook_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -922,7 +909,6 @@ async def github_update_global_webhook( response_types_map=_response_types_map, ).data - @validate_call async def github_update_global_webhook_with_http_info( self, @@ -930,9 +916,8 @@ async def github_update_global_webhook_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -963,24 +948,23 @@ async def github_update_global_webhook_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_global_webhook_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -988,7 +972,6 @@ async def github_update_global_webhook_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def github_update_global_webhook_without_preload_content( self, @@ -996,9 +979,8 @@ async def github_update_global_webhook_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1029,28 +1011,26 @@ async def github_update_global_webhook_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_global_webhook_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _github_update_global_webhook_serialize( self, _request_auth, @@ -1061,8 +1041,7 @@ def _github_update_global_webhook_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1077,22 +1056,17 @@ def _github_update_global_webhook_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/github/webhook', + method="POST", + resource_path="/api/v1/cloud/github/webhook", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1102,23 +1076,24 @@ def _github_update_global_webhook_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def github_update_tenant_webhook( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1151,25 +1126,24 @@ async def github_update_tenant_webhook( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_tenant_webhook_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1177,18 +1151,21 @@ async def github_update_tenant_webhook( response_types_map=_response_types_map, ).data - @validate_call async def github_update_tenant_webhook_with_http_info( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1221,25 +1198,24 @@ async def github_update_tenant_webhook_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_tenant_webhook_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1247,18 +1223,21 @@ async def github_update_tenant_webhook_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def github_update_tenant_webhook_without_preload_content( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1291,29 +1270,27 @@ async def github_update_tenant_webhook_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._github_update_tenant_webhook_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _github_update_tenant_webhook_serialize( self, webhook, @@ -1325,8 +1302,7 @@ def _github_update_tenant_webhook_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1337,28 +1313,23 @@ def _github_update_tenant_webhook_serialize( # process the path parameters if webhook is not None: - _path_params['webhook'] = webhook + _path_params["webhook"] = webhook # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/github/webhook/{webhook}', + method="POST", + resource_path="/api/v1/cloud/github/webhook/{webhook}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1368,7 +1339,5 @@ def _github_update_tenant_webhook_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/log_api.py b/hatchet_sdk/clients/cloud_rest/api/log_api.py index 96136224..ba947bbe 100644 --- a/hatchet_sdk/clients/cloud_rest/api/log_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/log_api.py @@ -12,19 +12,23 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from datetime import datetime -from pydantic import Field, StrictStr, field_validator -from typing import List, Optional +from pydantic import ( + Field, + StrictFloat, + StrictInt, + StrictStr, + field_validator, + validate_call, +) from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject -from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject +from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -40,18 +44,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def build_logs_list( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -84,24 +91,23 @@ async def build_logs_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_logs_list_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -109,18 +115,21 @@ async def build_logs_list( response_types_map=_response_types_map, ).data - @validate_call async def build_logs_list_with_http_info( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -153,24 +162,23 @@ async def build_logs_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_logs_list_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -178,18 +186,21 @@ async def build_logs_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def build_logs_list_without_preload_content( self, - build: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The build id")], + build: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The build id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -222,28 +233,26 @@ async def build_logs_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._build_logs_list_serialize( build=build, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _build_logs_list_serialize( self, build, @@ -255,8 +264,7 @@ def _build_logs_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -267,30 +275,23 @@ def _build_logs_list_serialize( # process the path parameters if build is not None: - _path_params['build'] = build + _path_params["build"] = build # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/build/{build}/logs', + method="GET", + resource_path="/api/v1/cloud/build/{build}/logs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -300,24 +301,25 @@ def _build_logs_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def log_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], event_object: Optional[List[EventObject]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -352,7 +354,7 @@ async def log_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_create_serialize( tenant=tenant, @@ -360,17 +362,16 @@ async def log_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -378,19 +379,22 @@ async def log_create( response_types_map=_response_types_map, ).data - @validate_call async def log_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], event_object: Optional[List[EventObject]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -425,7 +429,7 @@ async def log_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_create_serialize( tenant=tenant, @@ -433,17 +437,16 @@ async def log_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -451,19 +454,22 @@ async def log_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def log_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], event_object: Optional[List[EventObject]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -498,7 +504,7 @@ async def log_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_create_serialize( tenant=tenant, @@ -506,21 +512,19 @@ async def log_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _log_create_serialize( self, tenant, @@ -534,7 +538,7 @@ def _log_create_serialize( _host = None _collection_formats: Dict[str, str] = { - 'EventObject': '', + "EventObject": "", } _path_params: Dict[str, str] = {} @@ -546,7 +550,7 @@ def _log_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -554,36 +558,27 @@ def _log_create_serialize( if event_object is not None: _body_params = event_object - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'bearerAuth' - ] + _auth_settings: List[str] = ["bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/tenants/{tenant}/logs', + method="POST", + resource_path="/api/v1/cloud/tenants/{tenant}/logs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -593,27 +588,39 @@ def _log_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def log_list( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the logs should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the logs should end") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + direction: Annotated[ + Optional[StrictStr], Field(description="The direction to sort the logs") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -654,7 +661,7 @@ async def log_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_list_serialize( managed_worker=managed_worker, @@ -665,17 +672,16 @@ async def log_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -683,22 +689,36 @@ async def log_list( response_types_map=_response_types_map, ).data - @validate_call async def log_list_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the logs should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the logs should end") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + direction: Annotated[ + Optional[StrictStr], Field(description="The direction to sort the logs") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -739,7 +759,7 @@ async def log_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_list_serialize( managed_worker=managed_worker, @@ -750,17 +770,16 @@ async def log_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -768,22 +787,36 @@ async def log_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def log_list_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the logs should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the logs should end")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - direction: Annotated[Optional[StrictStr], Field(description="The direction to sort the logs")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the logs should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the logs should end") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + direction: Annotated[ + Optional[StrictStr], Field(description="The direction to sort the logs") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -824,7 +857,7 @@ async def log_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_list_serialize( managed_worker=managed_worker, @@ -835,21 +868,19 @@ async def log_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _log_list_serialize( self, managed_worker, @@ -865,8 +896,7 @@ def _log_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -877,64 +907,53 @@ def _log_list_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters if after is not None: if isinstance(after, datetime): _query_params.append( ( - 'after', - after.strftime( - self.api_client.configuration.datetime_format - ) + "after", + after.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('after', after)) - + _query_params.append(("after", after)) + if before is not None: if isinstance(before, datetime): _query_params.append( ( - 'before', - before.strftime( - self.api_client.configuration.datetime_format - ) + "before", + before.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('before', before)) - + _query_params.append(("before", before)) + if search is not None: - - _query_params.append(('search', search)) - + + _query_params.append(("search", search)) + if direction is not None: - - _query_params.append(('direction', direction)) - + + _query_params.append(("direction", direction)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/logs', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/logs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -944,7 +963,5 @@ def _log_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py index 9c4254fd..3adc95f6 100644 --- a/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py @@ -12,24 +12,31 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest -from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( + CreateManagedWorkerRequest, +) +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( + InfraAsCodeRequest, +) +from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList +from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( + ManagedWorkerEventList, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( + RuntimeConfigActionsResponse, +) +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( + UpdateManagedWorkerRequest, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -45,19 +52,25 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def infra_as_code_create( self, - infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The infra as code request id", + ), + ], infra_as_code_request2: Optional[InfraAsCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -92,7 +105,7 @@ async def infra_as_code_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, @@ -100,17 +113,16 @@ async def infra_as_code_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -118,19 +130,25 @@ async def infra_as_code_create( response_types_map=_response_types_map, ).data - @validate_call async def infra_as_code_create_with_http_info( self, - infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The infra as code request id", + ), + ], infra_as_code_request2: Optional[InfraAsCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -165,7 +183,7 @@ async def infra_as_code_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, @@ -173,17 +191,16 @@ async def infra_as_code_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -191,19 +208,25 @@ async def infra_as_code_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def infra_as_code_create_without_preload_content( self, - infra_as_code_request: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The infra as code request id")], + infra_as_code_request: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The infra as code request id", + ), + ], infra_as_code_request2: Optional[InfraAsCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -238,7 +261,7 @@ async def infra_as_code_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, @@ -246,21 +269,19 @@ async def infra_as_code_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIErrors", + "200": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _infra_as_code_create_serialize( self, infra_as_code_request, @@ -273,8 +294,7 @@ def _infra_as_code_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -285,7 +305,7 @@ def _infra_as_code_create_serialize( # process the path parameters if infra_as_code_request is not None: - _path_params['infra-as-code-request'] = infra_as_code_request + _path_params["infra-as-code-request"] = infra_as_code_request # process the query parameters # process the header parameters # process the form parameters @@ -293,37 +313,27 @@ def _infra_as_code_create_serialize( if infra_as_code_request2 is not None: _body_params = infra_as_code_request2 - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/infra-as-code/{infra-as-code-request}', + method="POST", + resource_path="/api/v1/cloud/infra-as-code/{infra-as-code-request}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -333,24 +343,25 @@ def _infra_as_code_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -385,7 +396,7 @@ async def managed_worker_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_create_serialize( tenant=tenant, @@ -393,17 +404,16 @@ async def managed_worker_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -411,19 +421,22 @@ async def managed_worker_create( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -458,7 +471,7 @@ async def managed_worker_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_create_serialize( tenant=tenant, @@ -466,17 +479,16 @@ async def managed_worker_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -484,19 +496,22 @@ async def managed_worker_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -531,7 +546,7 @@ async def managed_worker_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_create_serialize( tenant=tenant, @@ -539,21 +554,19 @@ async def managed_worker_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_create_serialize( self, tenant, @@ -566,8 +579,7 @@ def _managed_worker_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -578,7 +590,7 @@ def _managed_worker_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -586,37 +598,27 @@ def _managed_worker_create_serialize( if create_managed_worker_request is not None: _body_params = create_managed_worker_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/tenants/{tenant}/managed-worker', + method="POST", + resource_path="/api/v1/cloud/tenants/{tenant}/managed-worker", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -626,23 +628,27 @@ def _managed_worker_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_delete( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -675,25 +681,24 @@ async def managed_worker_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_delete_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -701,18 +706,24 @@ async def managed_worker_delete( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_delete_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -745,25 +756,24 @@ async def managed_worker_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_delete_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -771,18 +781,24 @@ async def managed_worker_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_delete_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -815,29 +831,27 @@ async def managed_worker_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_delete_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_delete_serialize( self, managed_worker, @@ -849,8 +863,7 @@ def _managed_worker_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -861,30 +874,23 @@ def _managed_worker_delete_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + method="DELETE", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -894,23 +900,27 @@ def _managed_worker_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_events_list( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -943,24 +953,23 @@ async def managed_worker_events_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_events_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerEventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerEventList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -968,18 +977,24 @@ async def managed_worker_events_list( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_events_list_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1012,24 +1027,23 @@ async def managed_worker_events_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_events_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerEventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerEventList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1037,18 +1051,24 @@ async def managed_worker_events_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_events_list_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1081,28 +1101,26 @@ async def managed_worker_events_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_events_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerEventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerEventList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_events_list_serialize( self, managed_worker, @@ -1114,8 +1132,7 @@ def _managed_worker_events_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1126,30 +1143,23 @@ def _managed_worker_events_list_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/events', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/events", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1159,23 +1169,27 @@ def _managed_worker_events_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_get( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1208,25 +1222,24 @@ async def managed_worker_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_get_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1234,18 +1247,24 @@ async def managed_worker_get( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_get_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1278,25 +1297,24 @@ async def managed_worker_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_get_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1304,18 +1322,24 @@ async def managed_worker_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_get_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1348,29 +1372,27 @@ async def managed_worker_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_get_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_get_serialize( self, managed_worker, @@ -1382,8 +1404,7 @@ def _managed_worker_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1394,30 +1415,23 @@ def _managed_worker_get_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1427,23 +1441,27 @@ def _managed_worker_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_instances_list( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1476,24 +1494,23 @@ async def managed_worker_instances_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_instances_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceList", - '400': "APIErrors", - '403': "APIErrors", + "200": "InstanceList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1501,18 +1518,24 @@ async def managed_worker_instances_list( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_instances_list_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1545,24 +1568,23 @@ async def managed_worker_instances_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_instances_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceList", - '400': "APIErrors", - '403': "APIErrors", + "200": "InstanceList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1570,18 +1592,24 @@ async def managed_worker_instances_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_instances_list_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1614,28 +1642,26 @@ async def managed_worker_instances_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_instances_list_serialize( managed_worker=managed_worker, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceList", - '400': "APIErrors", - '403': "APIErrors", + "200": "InstanceList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_instances_list_serialize( self, managed_worker, @@ -1647,8 +1673,7 @@ def _managed_worker_instances_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1659,30 +1684,23 @@ def _managed_worker_instances_list_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/instances', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1692,23 +1710,24 @@ def _managed_worker_instances_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1741,24 +1760,23 @@ async def managed_worker_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1766,18 +1784,21 @@ async def managed_worker_list( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1810,24 +1831,23 @@ async def managed_worker_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1835,18 +1855,21 @@ async def managed_worker_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1879,28 +1902,26 @@ async def managed_worker_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "ManagedWorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_list_serialize( self, tenant, @@ -1912,8 +1933,7 @@ def _managed_worker_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1924,30 +1944,23 @@ def _managed_worker_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/tenants/{tenant}/managed-worker', + method="GET", + resource_path="/api/v1/cloud/tenants/{tenant}/managed-worker", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1957,24 +1970,28 @@ def _managed_worker_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def managed_worker_update( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2009,7 +2026,7 @@ async def managed_worker_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_update_serialize( managed_worker=managed_worker, @@ -2017,18 +2034,17 @@ async def managed_worker_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2036,19 +2052,25 @@ async def managed_worker_update( response_types_map=_response_types_map, ).data - @validate_call async def managed_worker_update_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2083,7 +2105,7 @@ async def managed_worker_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_update_serialize( managed_worker=managed_worker, @@ -2091,18 +2113,17 @@ async def managed_worker_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2110,19 +2131,25 @@ async def managed_worker_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def managed_worker_update_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2157,7 +2184,7 @@ async def managed_worker_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._managed_worker_update_serialize( managed_worker=managed_worker, @@ -2165,22 +2192,20 @@ async def managed_worker_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ManagedWorker", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "ManagedWorker", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _managed_worker_update_serialize( self, managed_worker, @@ -2193,8 +2218,7 @@ def _managed_worker_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2205,7 +2229,7 @@ def _managed_worker_update_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters # process the header parameters # process the form parameters @@ -2213,37 +2237,27 @@ def _managed_worker_update_serialize( if update_managed_worker_request is not None: _body_params = update_managed_worker_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}', + method="POST", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2253,23 +2267,27 @@ def _managed_worker_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def runtime_config_list_actions( self, - runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + runtime_config: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The runtime config id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2302,24 +2320,23 @@ async def runtime_config_list_actions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._runtime_config_list_actions_serialize( runtime_config=runtime_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RuntimeConfigActionsResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "RuntimeConfigActionsResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2327,18 +2344,24 @@ async def runtime_config_list_actions( response_types_map=_response_types_map, ).data - @validate_call async def runtime_config_list_actions_with_http_info( self, - runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + runtime_config: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The runtime config id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2371,24 +2394,23 @@ async def runtime_config_list_actions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._runtime_config_list_actions_serialize( runtime_config=runtime_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RuntimeConfigActionsResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "RuntimeConfigActionsResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2396,18 +2418,24 @@ async def runtime_config_list_actions_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def runtime_config_list_actions_without_preload_content( self, - runtime_config: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The runtime config id")], + runtime_config: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The runtime config id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2440,28 +2468,26 @@ async def runtime_config_list_actions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._runtime_config_list_actions_serialize( runtime_config=runtime_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RuntimeConfigActionsResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "RuntimeConfigActionsResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _runtime_config_list_actions_serialize( self, runtime_config, @@ -2473,8 +2499,7 @@ def _runtime_config_list_actions_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2485,30 +2510,23 @@ def _runtime_config_list_actions_serialize( # process the path parameters if runtime_config is not None: - _path_params['runtime-config'] = runtime_config + _path_params["runtime-config"] = runtime_config # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/runtime-config/{runtime-config}/actions', + method="GET", + resource_path="/api/v1/cloud/runtime-config/{runtime-config}/actions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2518,7 +2536,5 @@ def _runtime_config_list_actions_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/metadata_api.py b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py index a82b77a9..1fa8e3c7 100644 --- a/hatchet_sdk/clients/cloud_rest/api/metadata_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py @@ -12,14 +12,14 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -35,7 +35,6 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def metadata_get( self, @@ -43,9 +42,8 @@ async def metadata_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -76,22 +74,21 @@ async def metadata_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APICloudMetadata", - '400': "APIErrors", + "200": "APICloudMetadata", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -99,7 +96,6 @@ async def metadata_get( response_types_map=_response_types_map, ).data - @validate_call async def metadata_get_with_http_info( self, @@ -107,9 +103,8 @@ async def metadata_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -140,22 +135,21 @@ async def metadata_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APICloudMetadata", - '400': "APIErrors", + "200": "APICloudMetadata", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -163,7 +157,6 @@ async def metadata_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metadata_get_without_preload_content( self, @@ -171,9 +164,8 @@ async def metadata_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -204,26 +196,24 @@ async def metadata_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APICloudMetadata", - '400': "APIErrors", + "200": "APICloudMetadata", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metadata_get_serialize( self, _request_auth, @@ -234,8 +224,7 @@ def _metadata_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -250,22 +239,17 @@ def _metadata_get_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/metadata', + method="GET", + resource_path="/api/v1/cloud/metadata", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -275,7 +259,5 @@ def _metadata_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/metrics_api.py b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py index 58f63b83..34f8e684 100644 --- a/hatchet_sdk/clients/cloud_rest/api/metrics_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py @@ -12,18 +12,15 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from datetime import datetime -from pydantic import Field -from typing import List, Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -39,20 +36,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def metrics_cpu_get( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +96,7 @@ async def metrics_cpu_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_cpu_get_serialize( managed_worker=managed_worker, @@ -98,17 +105,16 @@ async def metrics_cpu_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -116,20 +122,30 @@ async def metrics_cpu_get( response_types_map=_response_types_map, ).data - @validate_call async def metrics_cpu_get_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -166,7 +182,7 @@ async def metrics_cpu_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_cpu_get_serialize( managed_worker=managed_worker, @@ -175,17 +191,16 @@ async def metrics_cpu_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -193,20 +208,30 @@ async def metrics_cpu_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metrics_cpu_get_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -243,7 +268,7 @@ async def metrics_cpu_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_cpu_get_serialize( managed_worker=managed_worker, @@ -252,21 +277,19 @@ async def metrics_cpu_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metrics_cpu_get_serialize( self, managed_worker, @@ -280,8 +303,7 @@ def _metrics_cpu_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -292,56 +314,45 @@ def _metrics_cpu_get_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters if after is not None: if isinstance(after, datetime): _query_params.append( ( - 'after', - after.strftime( - self.api_client.configuration.datetime_format - ) + "after", + after.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('after', after)) - + _query_params.append(("after", after)) + if before is not None: if isinstance(before, datetime): _query_params.append( ( - 'before', - before.strftime( - self.api_client.configuration.datetime_format - ) + "before", + before.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('before', before)) - + _query_params.append(("before", before)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/cpu', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/metrics/cpu", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -351,25 +362,33 @@ def _metrics_cpu_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def metrics_disk_get( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -406,7 +425,7 @@ async def metrics_disk_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_disk_get_serialize( managed_worker=managed_worker, @@ -415,17 +434,16 @@ async def metrics_disk_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -433,20 +451,30 @@ async def metrics_disk_get( response_types_map=_response_types_map, ).data - @validate_call async def metrics_disk_get_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -483,7 +511,7 @@ async def metrics_disk_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_disk_get_serialize( managed_worker=managed_worker, @@ -492,17 +520,16 @@ async def metrics_disk_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -510,20 +537,30 @@ async def metrics_disk_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metrics_disk_get_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -560,7 +597,7 @@ async def metrics_disk_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_disk_get_serialize( managed_worker=managed_worker, @@ -569,21 +606,19 @@ async def metrics_disk_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metrics_disk_get_serialize( self, managed_worker, @@ -597,8 +632,7 @@ def _metrics_disk_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -609,56 +643,45 @@ def _metrics_disk_get_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters if after is not None: if isinstance(after, datetime): _query_params.append( ( - 'after', - after.strftime( - self.api_client.configuration.datetime_format - ) + "after", + after.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('after', after)) - + _query_params.append(("after", after)) + if before is not None: if isinstance(before, datetime): _query_params.append( ( - 'before', - before.strftime( - self.api_client.configuration.datetime_format - ) + "before", + before.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('before', before)) - + _query_params.append(("before", before)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/disk', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/metrics/disk", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -668,25 +691,33 @@ def _metrics_disk_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def metrics_memory_get( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -723,7 +754,7 @@ async def metrics_memory_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_memory_get_serialize( managed_worker=managed_worker, @@ -732,17 +763,16 @@ async def metrics_memory_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -750,20 +780,30 @@ async def metrics_memory_get( response_types_map=_response_types_map, ).data - @validate_call async def metrics_memory_get_with_http_info( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -800,7 +840,7 @@ async def metrics_memory_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_memory_get_serialize( managed_worker=managed_worker, @@ -809,17 +849,16 @@ async def metrics_memory_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -827,20 +866,30 @@ async def metrics_memory_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metrics_memory_get_without_preload_content( self, - managed_worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The managed worker id")], - after: Annotated[Optional[datetime], Field(description="When the metrics should start")] = None, - before: Annotated[Optional[datetime], Field(description="When the metrics should end")] = None, + managed_worker: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The managed worker id", + ), + ], + after: Annotated[ + Optional[datetime], Field(description="When the metrics should start") + ] = None, + before: Annotated[ + Optional[datetime], Field(description="When the metrics should end") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -877,7 +926,7 @@ async def metrics_memory_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metrics_memory_get_serialize( managed_worker=managed_worker, @@ -886,21 +935,19 @@ async def metrics_memory_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[SampleStream]", - '400': "APIErrors", - '403': "APIErrors", + "200": "List[SampleStream]", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metrics_memory_get_serialize( self, managed_worker, @@ -914,8 +961,7 @@ def _metrics_memory_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -926,56 +972,45 @@ def _metrics_memory_get_serialize( # process the path parameters if managed_worker is not None: - _path_params['managed-worker'] = managed_worker + _path_params["managed-worker"] = managed_worker # process the query parameters if after is not None: if isinstance(after, datetime): _query_params.append( ( - 'after', - after.strftime( - self.api_client.configuration.datetime_format - ) + "after", + after.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('after', after)) - + _query_params.append(("after", after)) + if before is not None: if isinstance(before, datetime): _query_params.append( ( - 'before', - before.strftime( - self.api_client.configuration.datetime_format - ) + "before", + before.strftime(self.api_client.configuration.datetime_format), ) ) else: - _query_params.append(('before', before)) - + _query_params.append(("before", before)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/managed-worker/{managed-worker}/metrics/memory', + method="GET", + resource_path="/api/v1/cloud/managed-worker/{managed-worker}/metrics/memory", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -985,7 +1020,5 @@ def _metrics_memory_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/tenant_api.py b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py index b9a48c59..0133ba61 100644 --- a/hatchet_sdk/clients/cloud_rest/api/tenant_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py @@ -12,16 +12,16 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( + TenantBillingState, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -37,18 +37,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def tenant_billing_state_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,25 +84,24 @@ async def tenant_billing_state_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_billing_state_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantBillingState", - '400': "APIErrors", - '403': "APIError", - '405': "APIErrors", + "200": "TenantBillingState", + "400": "APIErrors", + "403": "APIError", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -107,18 +109,21 @@ async def tenant_billing_state_get( response_types_map=_response_types_map, ).data - @validate_call async def tenant_billing_state_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -151,25 +156,24 @@ async def tenant_billing_state_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_billing_state_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantBillingState", - '400': "APIErrors", - '403': "APIError", - '405': "APIErrors", + "200": "TenantBillingState", + "400": "APIErrors", + "403": "APIError", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -177,18 +181,21 @@ async def tenant_billing_state_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_billing_state_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -221,29 +228,27 @@ async def tenant_billing_state_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_billing_state_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantBillingState", - '400': "APIErrors", - '403': "APIError", - '405': "APIErrors", + "200": "TenantBillingState", + "400": "APIErrors", + "403": "APIError", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_billing_state_get_serialize( self, tenant, @@ -255,8 +260,7 @@ def _tenant_billing_state_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -267,30 +271,23 @@ def _tenant_billing_state_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/billing/tenants/{tenant}', + method="GET", + resource_path="/api/v1/billing/tenants/{tenant}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -300,7 +297,5 @@ def _tenant_billing_state_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/user_api.py b/hatchet_sdk/clients/cloud_rest/api/user_api.py index c402c9c4..d0c56de3 100644 --- a/hatchet_sdk/clients/cloud_rest/api/user_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/user_api.py @@ -12,10 +12,10 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse @@ -34,7 +34,6 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def user_update_github_app_oauth_callback( self, @@ -42,9 +41,8 @@ async def user_update_github_app_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -75,21 +73,20 @@ async def user_update_github_app_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -97,7 +94,6 @@ async def user_update_github_app_oauth_callback( response_types_map=_response_types_map, ).data - @validate_call async def user_update_github_app_oauth_callback_with_http_info( self, @@ -105,9 +101,8 @@ async def user_update_github_app_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -138,21 +133,20 @@ async def user_update_github_app_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -160,7 +154,6 @@ async def user_update_github_app_oauth_callback_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_github_app_oauth_callback_without_preload_content( self, @@ -168,9 +161,8 @@ async def user_update_github_app_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -201,25 +193,23 @@ async def user_update_github_app_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_github_app_oauth_callback_serialize( self, _request_auth, @@ -230,8 +220,7 @@ def _user_update_github_app_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -246,17 +235,12 @@ def _user_update_github_app_oauth_callback_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/users/github-app/callback', + method="GET", + resource_path="/api/v1/cloud/users/github-app/callback", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -266,12 +250,9 @@ def _user_update_github_app_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_github_app_oauth_start( self, @@ -279,9 +260,8 @@ async def user_update_github_app_oauth_start( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -312,21 +292,20 @@ async def user_update_github_app_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -334,7 +313,6 @@ async def user_update_github_app_oauth_start( response_types_map=_response_types_map, ).data - @validate_call async def user_update_github_app_oauth_start_with_http_info( self, @@ -342,9 +320,8 @@ async def user_update_github_app_oauth_start_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -375,21 +352,20 @@ async def user_update_github_app_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -397,7 +373,6 @@ async def user_update_github_app_oauth_start_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_github_app_oauth_start_without_preload_content( self, @@ -405,9 +380,8 @@ async def user_update_github_app_oauth_start_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -438,25 +412,23 @@ async def user_update_github_app_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_app_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_github_app_oauth_start_serialize( self, _request_auth, @@ -467,8 +439,7 @@ def _user_update_github_app_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -483,17 +454,12 @@ def _user_update_github_app_oauth_start_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/users/github-app/start', + method="GET", + resource_path="/api/v1/cloud/users/github-app/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -503,7 +469,5 @@ def _user_update_github_app_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api/workflow_api.py b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py index ccb52364..6f6b659d 100644 --- a/hatchet_sdk/clients/cloud_rest/api/workflow_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py @@ -12,18 +12,17 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from datetime import datetime -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( + WorkflowRunEventsMetricsCounts, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -39,20 +38,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def workflow_run_events_get_metrics( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was completed"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -89,7 +97,7 @@ async def workflow_run_events_get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_events_get_metrics_serialize( tenant=tenant, @@ -98,17 +106,16 @@ async def workflow_run_events_get_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunEventsMetricsCounts", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunEventsMetricsCounts", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -116,20 +123,29 @@ async def workflow_run_events_get_metrics( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_events_get_metrics_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was completed"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -166,7 +182,7 @@ async def workflow_run_events_get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_events_get_metrics_serialize( tenant=tenant, @@ -175,17 +191,16 @@ async def workflow_run_events_get_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunEventsMetricsCounts", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunEventsMetricsCounts", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -193,20 +208,29 @@ async def workflow_run_events_get_metrics_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_events_get_metrics_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - finished_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was completed")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was completed"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -243,7 +267,7 @@ async def workflow_run_events_get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_events_get_metrics_serialize( tenant=tenant, @@ -252,21 +276,19 @@ async def workflow_run_events_get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunEventsMetricsCounts", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunEventsMetricsCounts", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_events_get_metrics_serialize( self, tenant, @@ -280,8 +302,7 @@ def _workflow_run_events_get_metrics_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -292,56 +313,49 @@ def _workflow_run_events_get_metrics_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters if created_after is not None: if isinstance(created_after, datetime): _query_params.append( ( - 'createdAfter', + "createdAfter", created_after.strftime( self.api_client.configuration.datetime_format - ) + ), ) ) else: - _query_params.append(('createdAfter', created_after)) - + _query_params.append(("createdAfter", created_after)) + if finished_before is not None: if isinstance(finished_before, datetime): _query_params.append( ( - 'finishedBefore', + "finishedBefore", finished_before.strftime( self.api_client.configuration.datetime_format - ) + ), ) ) else: - _query_params.append(('finishedBefore', finished_before)) - + _query_params.append(("finishedBefore", finished_before)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/tenants/{tenant}/runs-metrics', + method="GET", + resource_path="/api/v1/cloud/tenants/{tenant}/runs-metrics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -351,7 +365,5 @@ def _workflow_run_events_get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/cloud_rest/api_client.py b/hatchet_sdk/clients/cloud_rest/api_client.py index 187bf934..04b3f909 100644 --- a/hatchet_sdk/clients/cloud_rest/api_client.py +++ b/hatchet_sdk/clients/cloud_rest/api_client.py @@ -13,34 +13,36 @@ import datetime -from dateutil.parser import parse -from enum import Enum import json import mimetypes import os import re import tempfile - +from enum import Enum +from typing import Dict, List, Optional, Tuple, Union from urllib.parse import quote -from typing import Tuple, Optional, List, Dict, Union + +from dateutil.parser import parse from pydantic import SecretStr -from hatchet_sdk.clients.cloud_rest.configuration import Configuration -from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse, T as ApiResponseT import hatchet_sdk.clients.cloud_rest.models from hatchet_sdk.clients.cloud_rest import rest +from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse +from hatchet_sdk.clients.cloud_rest.api_response import T as ApiResponseT +from hatchet_sdk.clients.cloud_rest.configuration import Configuration from hatchet_sdk.clients.cloud_rest.exceptions import ( - ApiValueError, ApiException, + ApiValueError, BadRequestException, - UnauthorizedException, ForbiddenException, NotFoundException, - ServiceException + ServiceException, + UnauthorizedException, ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + class ApiClient: """Generic API client for OpenAPI client library builds. @@ -59,23 +61,19 @@ class ApiClient: PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, # TODO remove as only py3 is supported? - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, } _pool = None def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None + self, configuration=None, header_name=None, header_value=None, cookie=None ) -> None: # use default configuration if none is provided if configuration is None: @@ -88,7 +86,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.user_agent = "OpenAPI-Generator/1.0.0/python" self.client_side_validation = configuration.client_side_validation async def __aenter__(self): @@ -103,16 +101,15 @@ async def close(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers['User-Agent'] + return self.default_headers["User-Agent"] @user_agent.setter def user_agent(self, value): - self.default_headers['User-Agent'] = value + self.default_headers["User-Agent"] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - _default = None @classmethod @@ -148,12 +145,12 @@ def param_serialize( header_params=None, body=None, post_params=None, - files=None, auth_settings=None, + files=None, + auth_settings=None, collection_formats=None, _host=None, - _request_auth=None + _request_auth=None, ) -> RequestSerialized: - """Builds the HTTP request params needed by the request. :param method: Method to call. :param resource_path: Path to method endpoint. @@ -182,35 +179,28 @@ def param_serialize( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params['Cookie'] = self.cookie + header_params["Cookie"] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict( - self.parameters_to_tuples(header_params,collection_formats) + self.parameters_to_tuples(header_params, collection_formats) ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples( - path_params, - collection_formats - ) + path_params = self.parameters_to_tuples(path_params, collection_formats) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) ) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples( - post_params, - collection_formats - ) + post_params = self.parameters_to_tuples(post_params, collection_formats) if files: post_params.extend(self.files_parameters(files)) @@ -222,7 +212,7 @@ def param_serialize( resource_path, method, body, - request_auth=_request_auth + request_auth=_request_auth, ) # body @@ -239,15 +229,11 @@ def param_serialize( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query( - query_params, - collection_formats - ) + url_query = self.parameters_to_url_query(query_params, collection_formats) url += "?" + url_query return method, url, header_params, body, post_params - async def call_api( self, method, @@ -255,7 +241,7 @@ async def call_api( header_params=None, body=None, post_params=None, - _request_timeout=None + _request_timeout=None, ) -> rest.RESTResponse: """Makes the HTTP request (synchronous) :param method: Method to call. @@ -272,10 +258,12 @@ async def call_api( try: # perform request and return response response_data = await self.rest_client.request( - method, url, + method, + url, headers=header_params, - body=body, post_params=post_params, - _request_timeout=_request_timeout + body=body, + post_params=post_params, + _request_timeout=_request_timeout, ) except ApiException as e: @@ -286,7 +274,7 @@ async def call_api( def response_deserialize( self, response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None + response_types_map: Optional[Dict[str, ApiResponseT]] = None, ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. @@ -298,9 +286,15 @@ def response_deserialize( assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) # deserialize response data response_text = None @@ -312,13 +306,15 @@ def response_deserialize( return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader('content-type') + content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) + return_data = self.__deserialize_primitive( + response_text, response_type + ) else: return_data = self.deserialize(response_text, response_type) finally: @@ -330,10 +326,10 @@ def response_deserialize( ) return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, ) def sanitize_for_serialization(self, obj): @@ -360,13 +356,9 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [ - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ] + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] elif isinstance(obj, tuple): - return tuple( - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ) + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() @@ -378,14 +370,13 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): obj_dict = obj.to_dict() else: obj_dict = obj.__dict__ return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() + key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } def deserialize(self, response_text, response_type): @@ -418,19 +409,17 @@ def __deserialize(self, data, klass): return None if isinstance(klass, str): - if klass.startswith('List['): - m = re.match(r'List\[(.*)]', klass) + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) assert m is not None, "Malformed List type definition" sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] - if klass.startswith('Dict['): - m = re.match(r'Dict\[([^,]*), (.*)]', klass) + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) assert m is not None, "Malformed Dict type definition" sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -464,19 +453,18 @@ def parameters_to_tuples(self, params, collection_formats): for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, value) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -501,17 +489,17 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, str(value)) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' + delimiter = "," new_params.append( (k, delimiter.join(quote(str(value)) for value in v)) ) @@ -529,7 +517,7 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): params = [] for k, v in files.items(): if isinstance(v, str): - with open(v, 'rb') as f: + with open(v, "rb") as f: filename = os.path.basename(f.name) filedata = f.read() elif isinstance(v, bytes): @@ -537,13 +525,8 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): filedata = v else: raise ValueError("Unsupported file value") - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -556,7 +539,7 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: return None for accept in accepts: - if re.search('json', accept, re.IGNORECASE): + if re.search("json", accept, re.IGNORECASE): return accept return accepts[0] @@ -571,7 +554,7 @@ def select_header_content_type(self, content_types): return None for content_type in content_types: - if re.search('json', content_type, re.IGNORECASE): + if re.search("json", content_type, re.IGNORECASE): return content_type return content_types[0] @@ -584,7 +567,7 @@ def update_params_for_auth( resource_path, method, body, - request_auth=None + request_auth=None, ) -> None: """Updates header and query params based on authentication setting. @@ -603,34 +586,18 @@ def update_params_for_auth( if request_auth: self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - request_auth + headers, queries, resource_path, method, body, request_auth ) else: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - auth_setting + headers, queries, resource_path, method, body, auth_setting ) def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting + self, headers, queries, resource_path, method, body, auth_setting ) -> None: """Updates the request parameters based on a single auth_setting @@ -642,17 +609,15 @@ def _apply_auth_params( The object type is the return value of sanitize_for_serialization(). :param auth_setting: auth settings for the endpoint """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + raise ApiValueError("Authentication token must be in `query` or `header`") def __deserialize_file(self, response): """Deserializes body to file @@ -672,10 +637,7 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - m = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition - ) + m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) assert m is not None, "Unexpected 'content-disposition' header value" filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) @@ -719,8 +681,7 @@ def __deserialize_date(self, string): return string except ValueError: raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) + status=0, reason="Failed to parse `{0}` as date object".format(string) ) def __deserialize_datetime(self, string): @@ -738,10 +699,7 @@ def __deserialize_datetime(self, string): except ValueError: raise rest.ApiException( status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) + reason=("Failed to parse `{0}` as datetime object".format(string)), ) def __deserialize_enum(self, data, klass): @@ -755,11 +713,7 @@ def __deserialize_enum(self, data, klass): return klass(data) except ValueError: raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as `{1}`" - .format(data, klass) - ) + status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) ) def __deserialize_model(self, data, klass): diff --git a/hatchet_sdk/clients/cloud_rest/api_response.py b/hatchet_sdk/clients/cloud_rest/api_response.py index 9bc7c11f..ca801da0 100644 --- a/hatchet_sdk/clients/cloud_rest/api_response.py +++ b/hatchet_sdk/clients/cloud_rest/api_response.py @@ -1,11 +1,14 @@ """API response object.""" from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel + +from typing import Generic, Mapping, Optional, TypeVar + +from pydantic import BaseModel, Field, StrictBytes, StrictInt T = TypeVar("T") + class ApiResponse(BaseModel, Generic[T]): """ API response object @@ -16,6 +19,4 @@ class ApiResponse(BaseModel, Generic[T]): data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - model_config = { - "arbitrary_types_allowed": True - } + model_config = {"arbitrary_types_allowed": True} diff --git a/hatchet_sdk/clients/cloud_rest/configuration.py b/hatchet_sdk/clients/cloud_rest/configuration.py index 09c41ade..1b5b1850 100644 --- a/hatchet_sdk/clients/cloud_rest/configuration.py +++ b/hatchet_sdk/clients/cloud_rest/configuration.py @@ -13,81 +13,94 @@ import copy +import http.client as httplib import logging -from logging import FileHandler import sys +from logging import FileHandler from typing import Optional -import urllib3 -import http.client as httplib +import urllib3 JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", } + class Configuration: """This class contains various settings of the API client. - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = hatchet_sdk.clients.cloud_rest.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = hatchet_sdk.clients.cloud_rest.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default = None - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: - """Constructor - """ + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + username=None, + password=None, + access_token=None, + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor""" self._base_path = "http://localhost" if host is None else host """Default Base url """ @@ -128,9 +141,11 @@ def __init__(self, host=None, self.logger = {} """Logging Settings """ - self.logger["package_logger"] = logging.getLogger("hatchet_sdk.clients.cloud_rest") + self.logger["package_logger"] = logging.getLogger( + "hatchet_sdk.clients.cloud_rest" + ) self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format """ self.logger_stream_handler = None @@ -179,7 +194,7 @@ def __init__(self, host=None, self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = "" """Safe chars for path_param """ self.retries = None @@ -205,7 +220,7 @@ def __deepcopy__(self, memo): result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): + if k not in ("logger", "logger_file_handler"): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -346,7 +361,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): """ if self.refresh_api_key_hook is not None: self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) if key: prefix = self.api_key_prefix.get(identifier) if prefix: @@ -365,9 +382,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) def auth_settings(self): """Gets Auth Settings dict for api client. @@ -376,19 +393,19 @@ def auth_settings(self): """ auth = {} if self.access_token is not None: - auth['bearerAuth'] = { - 'type': 'bearer', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token + auth["bearerAuth"] = { + "type": "bearer", + "in": "header", + "key": "Authorization", + "value": "Bearer " + self.access_token, } - if 'cookieAuth' in self.api_key: - auth['cookieAuth'] = { - 'type': 'api_key', - 'in': 'cookie', - 'key': 'hatchet', - 'value': self.get_api_key_with_prefix( - 'cookieAuth', + if "cookieAuth" in self.api_key: + auth["cookieAuth"] = { + "type": "api_key", + "in": "cookie", + "key": "hatchet", + "value": self.get_api_key_with_prefix( + "cookieAuth", ), } return auth @@ -398,12 +415,13 @@ def to_debug_report(self): :return: The report for debugging. """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: 1.0.0\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) def get_host_settings(self): """Gets an array of host settings @@ -412,8 +430,8 @@ def get_host_settings(self): """ return [ { - 'url': "", - 'description': "No description provided", + "url": "", + "description": "No description provided", } ] @@ -435,22 +453,22 @@ def get_host_from_settings(self, index, variables=None, servers=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) + "Must be less than {1}".format(index, len(servers)) + ) - url = server['url'] + url = server["url"] # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: + if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) + variable_name, variables[variable_name], variable["enum_values"] + ) + ) url = url.replace("{" + variable_name + "}", used_value) @@ -459,7 +477,9 @@ def get_host_from_settings(self, index, variables=None, servers=None): @property def host(self): """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) @host.setter def host(self, value): diff --git a/hatchet_sdk/clients/cloud_rest/exceptions.py b/hatchet_sdk/clients/cloud_rest/exceptions.py index 205c95b6..b41ac1d2 100644 --- a/hatchet_sdk/clients/cloud_rest/exceptions.py +++ b/hatchet_sdk/clients/cloud_rest/exceptions.py @@ -12,16 +12,19 @@ """ # noqa: E501 from typing import Any, Optional + from typing_extensions import Self + class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None) -> None: - """ Raises an exception for TypeErrors + def __init__( + self, msg, path_to_item=None, valid_classes=None, key_type=None + ) -> None: + """Raises an exception for TypeErrors Args: msg (str): the exception message @@ -104,9 +107,9 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): def __init__( - self, - status=None, - reason=None, + self, + status=None, + reason=None, http_resp=None, *, body: Optional[str] = None, @@ -125,17 +128,17 @@ def __init__( self.reason = http_resp.reason if self.body is None: try: - self.body = http_resp.data.decode('utf-8') + self.body = http_resp.data.decode("utf-8") except Exception: pass self.headers = http_resp.getheaders() @classmethod def from_response( - cls, - *, - http_resp, - body: Optional[str], + cls, + *, + http_resp, + body: Optional[str], data: Optional[Any], ) -> Self: if http_resp.status == 400: @@ -156,11 +159,9 @@ def from_response( def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) + error_message += "HTTP response headers: {0}\n".format(self.headers) if self.data or self.body: error_message += "HTTP response body: {0}\n".format(self.data or self.body) diff --git a/hatchet_sdk/clients/cloud_rest/models/__init__.py b/hatchet_sdk/clients/cloud_rest/models/__init__.py index da5e8039..fd04062b 100644 --- a/hatchet_sdk/clients/cloud_rest/models/__init__.py +++ b/hatchet_sdk/clients/cloud_rest/models/__init__.py @@ -18,49 +18,95 @@ from hatchet_sdk.clients.cloud_rest.models.api_error import APIError from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import BillingPortalLinkGet200Response +from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( + BillingPortalLinkGet200Response, +) from hatchet_sdk.clients.cloud_rest.models.build import Build from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import CreateManagedWorkerRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( + CreateBuildStepRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( + CreateManagedWorkerBuildConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( + CreateManagedWorkerRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( + GithubAppInstallation, +) from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( + InfraAsCodeRequest, +) from hatchet_sdk.clients.cloud_rest.models.instance import Instance from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ListGithubAppInstallationsResponse +from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( + ListGithubAppInstallationsResponse, +) from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ManagedWorkerEventList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( + ManagedWorkerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( + ManagedWorkerEvent, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( + ManagedWorkerEventList, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( + ManagedWorkerEventStatus, +) from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( + ManagedWorkerRuntimeConfig, +) from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import RuntimeConfigActionsResponse +from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( + RuntimeConfigActionsResponse, +) from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( + SampleHistogramPair, +) from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import TenantBillingState -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( + TenantBillingState, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( + TenantPaymentMethod, +) from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import UpdateManagedWorkerRequest -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import UpdateTenantSubscription -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import WorkflowRunEventsMetricsCounts +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( + TenantSubscriptionStatus, +) +from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( + UpdateManagedWorkerRequest, +) +from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( + UpdateTenantSubscription, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( + WorkflowRunEventsMetric, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( + WorkflowRunEventsMetricsCounts, +) diff --git a/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py b/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py index 6aea38d5..334d28ae 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py +++ b/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py @@ -13,22 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class APICloudMetadata(BaseModel): """ APICloudMetadata - """ # noqa: E501 - can_bill: Optional[StrictBool] = Field(default=None, description="whether the tenant can be billed", alias="canBill") - can_link_github: Optional[StrictBool] = Field(default=None, description="whether the tenant can link to GitHub", alias="canLinkGithub") - metrics_enabled: Optional[StrictBool] = Field(default=None, description="whether metrics are enabled for the tenant", alias="metricsEnabled") + """ # noqa: E501 + + can_bill: Optional[StrictBool] = Field( + default=None, description="whether the tenant can be billed", alias="canBill" + ) + can_link_github: Optional[StrictBool] = Field( + default=None, + description="whether the tenant can link to GitHub", + alias="canLinkGithub", + ) + metrics_enabled: Optional[StrictBool] = Field( + default=None, + description="whether metrics are enabled for the tenant", + alias="metricsEnabled", + ) __properties: ClassVar[List[str]] = ["canBill", "canLinkGithub", "metricsEnabled"] model_config = ConfigDict( @@ -37,7 +49,6 @@ class APICloudMetadata(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +91,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "canBill": obj.get("canBill"), - "canLinkGithub": obj.get("canLinkGithub"), - "metricsEnabled": obj.get("metricsEnabled") - }) + _obj = cls.model_validate( + { + "canBill": obj.get("canBill"), + "canLinkGithub": obj.get("canLinkGithub"), + "metricsEnabled": obj.get("metricsEnabled"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/api_error.py b/hatchet_sdk/clients/cloud_rest/models/api_error.py index bb448b2d..64edc80f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_error.py +++ b/hatchet_sdk/clients/cloud_rest/models/api_error.py @@ -13,23 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class APIError(BaseModel): """ APIError - """ # noqa: E501 - code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") - var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") + """ # noqa: E501 + + code: Optional[StrictInt] = Field( + default=None, description="a custom Hatchet error code" + ) + var_field: Optional[StrictStr] = Field( + default=None, + description="the field that this error is associated with, if applicable", + alias="field", + ) description: StrictStr = Field(description="a description for this error") - docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") + docs_link: Optional[StrictStr] = Field( + default=None, + description="a link to the documentation for this error, if it exists", + ) __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] model_config = ConfigDict( @@ -38,7 +49,6 @@ class APIError(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "code": obj.get("code"), - "field": obj.get("field"), - "description": obj.get("description"), - "docs_link": obj.get("docs_link") - }) + _obj = cls.model_validate( + { + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/api_errors.py b/hatchet_sdk/clients/cloud_rest/models/api_errors.py index 5db2c014..f2579465 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_errors.py +++ b/hatchet_sdk/clients/cloud_rest/models/api_errors.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.api_error import APIError -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_error import APIError + + class APIErrors(BaseModel): """ APIErrors - """ # noqa: E501 + """ # noqa: E501 + errors: List[APIError] __properties: ClassVar[List[str]] = ["errors"] @@ -36,7 +39,6 @@ class APIErrors(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.errors: if _item: _items.append(_item.to_dict()) - _dict['errors'] = _items + _dict["errors"] = _items return _dict @classmethod @@ -87,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "errors": [APIError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None - }) + _obj = cls.model_validate( + { + "errors": ( + [APIError.from_dict(_item) for _item in obj["errors"]] + if obj.get("errors") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py b/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py index 69e062b1..bb8ad457 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py +++ b/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py @@ -13,24 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class APIResourceMeta(BaseModel): """ APIResourceMeta - """ # noqa: E501 - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") - created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") - updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") + """ # noqa: E501 + + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="the id of this resource, in UUID format" + ) + created_at: datetime = Field( + description="the time that this resource was created", alias="createdAt" + ) + updated_at: datetime = Field( + description="the time that this resource was last updated", alias="updatedAt" + ) __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] model_config = ConfigDict( @@ -39,7 +46,6 @@ class APIResourceMeta(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,11 +88,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "createdAt": obj.get("createdAt"), - "updatedAt": obj.get("updatedAt") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py b/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py index a18b12b2..00f4a044 100644 --- a/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py @@ -13,20 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class BillingPortalLinkGet200Response(BaseModel): """ BillingPortalLinkGet200Response - """ # noqa: E501 - url: Optional[StrictStr] = Field(default=None, description="The url to the billing portal") + """ # noqa: E501 + + url: Optional[StrictStr] = Field( + default=None, description="The url to the billing portal" + ) __properties: ClassVar[List[str]] = ["url"] model_config = ConfigDict( @@ -35,7 +39,6 @@ class BillingPortalLinkGet200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "url": obj.get("url") - }) + _obj = cls.model_validate({"url": obj.get("url")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/build.py b/hatchet_sdk/clients/cloud_rest/models/build.py index d479fe30..3a44e882 100644 --- a/hatchet_sdk/clients/cloud_rest/models/build.py +++ b/hatchet_sdk/clients/cloud_rest/models/build.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta + + class Build(BaseModel): """ Build - """ # noqa: E501 + """ # noqa: E501 + metadata: Optional[APIResourceMeta] = None status: StrictStr status_detail: Optional[StrictStr] = Field(default=None, alias="statusDetail") @@ -35,7 +38,15 @@ class Build(BaseModel): start_time: Optional[datetime] = Field(default=None, alias="startTime") finish_time: Optional[datetime] = Field(default=None, alias="finishTime") build_config_id: StrictStr = Field(alias="buildConfigId") - __properties: ClassVar[List[str]] = ["metadata", "status", "statusDetail", "createTime", "startTime", "finishTime", "buildConfigId"] + __properties: ClassVar[List[str]] = [ + "metadata", + "status", + "statusDetail", + "createTime", + "startTime", + "finishTime", + "buildConfigId", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +54,6 @@ class Build(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +78,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,15 +99,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "status": obj.get("status"), - "statusDetail": obj.get("statusDetail"), - "createTime": obj.get("createTime"), - "startTime": obj.get("startTime"), - "finishTime": obj.get("finishTime"), - "buildConfigId": obj.get("buildConfigId") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "status": obj.get("status"), + "statusDetail": obj.get("statusDetail"), + "createTime": obj.get("createTime"), + "startTime": obj.get("startTime"), + "finishTime": obj.get("finishTime"), + "buildConfigId": obj.get("buildConfigId"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/build_step.py b/hatchet_sdk/clients/cloud_rest/models/build_step.py index 28d12826..387a82c3 100644 --- a/hatchet_sdk/clients/cloud_rest/models/build_step.py +++ b/hatchet_sdk/clients/cloud_rest/models/build_step.py @@ -13,23 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta + + class BuildStep(BaseModel): """ BuildStep - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") - dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + build_dir: StrictStr = Field( + description="The relative path to the build directory", alias="buildDir" + ) + dockerfile_path: StrictStr = Field( + description="The relative path from the build dir to the Dockerfile", + alias="dockerfilePath", + ) __properties: ClassVar[List[str]] = ["metadata", "buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -38,7 +46,6 @@ class BuildStep(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -85,11 +91,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon.py b/hatchet_sdk/clients/cloud_rest/models/coupon.py index 941a291c..af0c0b76 100644 --- a/hatchet_sdk/clients/cloud_rest/models/coupon.py +++ b/hatchet_sdk/clients/cloud_rest/models/coupon.py @@ -13,29 +13,53 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency + + class Coupon(BaseModel): """ Coupon - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the coupon.") - amount_cents: Optional[StrictInt] = Field(default=None, description="The amount off of the coupon.") - amount_cents_remaining: Optional[StrictInt] = Field(default=None, description="The amount remaining on the coupon.") - amount_currency: Optional[StrictStr] = Field(default=None, description="The currency of the coupon.") + amount_cents: Optional[StrictInt] = Field( + default=None, description="The amount off of the coupon." + ) + amount_cents_remaining: Optional[StrictInt] = Field( + default=None, description="The amount remaining on the coupon." + ) + amount_currency: Optional[StrictStr] = Field( + default=None, description="The currency of the coupon." + ) frequency: CouponFrequency = Field(description="The frequency of the coupon.") - frequency_duration: Optional[StrictInt] = Field(default=None, description="The frequency duration of the coupon.") - frequency_duration_remaining: Optional[StrictInt] = Field(default=None, description="The frequency duration remaining of the coupon.") - percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The percentage off of the coupon.") - __properties: ClassVar[List[str]] = ["name", "amount_cents", "amount_cents_remaining", "amount_currency", "frequency", "frequency_duration", "frequency_duration_remaining", "percent"] + frequency_duration: Optional[StrictInt] = Field( + default=None, description="The frequency duration of the coupon." + ) + frequency_duration_remaining: Optional[StrictInt] = Field( + default=None, description="The frequency duration remaining of the coupon." + ) + percent: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="The percentage off of the coupon." + ) + __properties: ClassVar[List[str]] = [ + "name", + "amount_cents", + "amount_cents_remaining", + "amount_currency", + "frequency", + "frequency_duration", + "frequency_duration_remaining", + "percent", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +67,6 @@ class Coupon(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +91,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,16 +109,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "amount_cents": obj.get("amount_cents"), - "amount_cents_remaining": obj.get("amount_cents_remaining"), - "amount_currency": obj.get("amount_currency"), - "frequency": obj.get("frequency"), - "frequency_duration": obj.get("frequency_duration"), - "frequency_duration_remaining": obj.get("frequency_duration_remaining"), - "percent": obj.get("percent") - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "amount_cents": obj.get("amount_cents"), + "amount_cents_remaining": obj.get("amount_cents_remaining"), + "amount_currency": obj.get("amount_currency"), + "frequency": obj.get("frequency"), + "frequency_duration": obj.get("frequency_duration"), + "frequency_duration_remaining": obj.get("frequency_duration_remaining"), + "percent": obj.get("percent"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py b/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py index 9ba1a381..79f8f74f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py +++ b/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class CouponFrequency(str, Enum): """ allowed enum values """ - ONCE = 'once' - RECURRING = 'recurring' + ONCE = "once" + RECURRING = "recurring" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of CouponFrequency from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py b/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py index 7b52e464..4d4fe075 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreateBuildStepRequest(BaseModel): """ CreateBuildStepRequest - """ # noqa: E501 - build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") - dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + """ # noqa: E501 + + build_dir: StrictStr = Field( + description="The relative path to the build directory", alias="buildDir" + ) + dockerfile_path: StrictStr = Field( + description="The relative path from the build dir to the Dockerfile", + alias="dockerfilePath", + ) __properties: ClassVar[List[str]] = ["buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -36,7 +43,6 @@ class CreateBuildStepRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +85,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath") - }) + _obj = cls.model_validate( + { + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py index 1a97f7b2..66226cda 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py @@ -13,27 +13,39 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import CreateBuildStepRequest -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + +from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( + CreateBuildStepRequest, +) + class CreateManagedWorkerBuildConfigRequest(BaseModel): """ CreateManagedWorkerBuildConfigRequest - """ # noqa: E501 - github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + """ # noqa: E501 + + github_installation_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36) + ] = Field(alias="githubInstallationId") github_repository_owner: StrictStr = Field(alias="githubRepositoryOwner") github_repository_name: StrictStr = Field(alias="githubRepositoryName") github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") steps: List[CreateBuildStepRequest] - __properties: ClassVar[List[str]] = ["githubInstallationId", "githubRepositoryOwner", "githubRepositoryName", "githubRepositoryBranch", "steps"] + __properties: ClassVar[List[str]] = [ + "githubInstallationId", + "githubRepositoryOwner", + "githubRepositoryName", + "githubRepositoryBranch", + "steps", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +53,6 @@ class CreateManagedWorkerBuildConfigRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict['steps'] = _items + _dict["steps"] = _items return _dict @classmethod @@ -92,13 +102,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepositoryOwner": obj.get("githubRepositoryOwner"), - "githubRepositoryName": obj.get("githubRepositoryName"), - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": [CreateBuildStepRequest.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None - }) + _obj = cls.model_validate( + { + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepositoryOwner": obj.get("githubRepositoryOwner"), + "githubRepositoryName": obj.get("githubRepositoryName"), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": ( + [CreateBuildStepRequest.from_dict(_item) for _item in obj["steps"]] + if obj.get("steps") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py index 97666a06..6aa9c562 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py @@ -13,27 +13,45 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( + CreateManagedWorkerBuildConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) + + class CreateManagedWorkerRequest(BaseModel): """ CreateManagedWorkerRequest - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr build_config: CreateManagedWorkerBuildConfigRequest = Field(alias="buildConfig") - env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") + env_vars: Dict[str, StrictStr] = Field( + description="A map of environment variables to set for the worker", + alias="envVars", + ) is_iac: StrictBool = Field(alias="isIac") - runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field(default=None, alias="runtimeConfig") - __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field( + default=None, alias="runtimeConfig" + ) + __properties: ClassVar[List[str]] = [ + "name", + "buildConfig", + "envVars", + "isIac", + "runtimeConfig", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +59,6 @@ class CreateManagedWorkerRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +83,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,10 +92,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict['runtimeConfig'] = self.runtime_config.to_dict() + _dict["runtimeConfig"] = self.runtime_config.to_dict() return _dict @classmethod @@ -91,12 +107,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "buildConfig": CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfig": CreateManagedWorkerRuntimeConfigRequest.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "buildConfig": ( + CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfig": ( + CreateManagedWorkerRuntimeConfigRequest.from_dict( + obj["runtimeConfig"] + ) + if obj.get("runtimeConfig") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py index 938f29bb..89bc9586 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py @@ -13,28 +13,49 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) + class CreateManagedWorkerRuntimeConfigRequest(BaseModel): """ CreateManagedWorkerRuntimeConfigRequest - """ # noqa: E501 - num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(alias="numReplicas") - region: Optional[ManagedWorkerRegion] = Field(default=None, description="The region to deploy the worker to") - cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") - cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") - memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + """ # noqa: E501 + + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( + alias="numReplicas" + ) + region: Optional[ManagedWorkerRegion] = Field( + default=None, description="The region to deploy the worker to" + ) + cpu_kind: StrictStr = Field( + description="The kind of CPU to use for the worker", alias="cpuKind" + ) + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field( + description="The number of CPUs to use for the worker" + ) + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field( + description="The amount of memory in MB to use for the worker", alias="memoryMb" + ) actions: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["numReplicas", "region", "cpuKind", "cpus", "memoryMb", "actions"] + __properties: ClassVar[List[str]] = [ + "numReplicas", + "region", + "cpuKind", + "cpus", + "memoryMb", + "actions", + ] model_config = ConfigDict( populate_by_name=True, @@ -42,7 +63,6 @@ class CreateManagedWorkerRuntimeConfigRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +87,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -86,14 +105,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "numReplicas": obj.get("numReplicas"), - "region": obj.get("region"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "actions": obj.get("actions") - }) + _obj = cls.model_validate( + { + "numReplicas": obj.get("numReplicas"), + "region": obj.get("region"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "actions": obj.get("actions"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object.py b/hatchet_sdk/clients/cloud_rest/models/event_object.py index 33a2943b..01c2c9b2 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object.py +++ b/hatchet_sdk/clients/cloud_rest/models/event_object.py @@ -13,30 +13,40 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog -from typing import Optional, Set -from typing_extensions import Self + class EventObject(BaseModel): """ EventObject - """ # noqa: E501 + """ # noqa: E501 + event: Optional[EventObjectEvent] = None fly: Optional[EventObjectFly] = None host: Optional[StrictStr] = None log: Optional[EventObjectLog] = None message: Optional[StrictStr] = None timestamp: Optional[datetime] = None - __properties: ClassVar[List[str]] = ["event", "fly", "host", "log", "message", "timestamp"] + __properties: ClassVar[List[str]] = [ + "event", + "fly", + "host", + "log", + "message", + "timestamp", + ] model_config = ConfigDict( populate_by_name=True, @@ -44,7 +54,6 @@ class EventObject(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,8 +78,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,13 +87,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of event if self.event: - _dict['event'] = self.event.to_dict() + _dict["event"] = self.event.to_dict() # override the default output from pydantic by calling `to_dict()` of fly if self.fly: - _dict['fly'] = self.fly.to_dict() + _dict["fly"] = self.fly.to_dict() # override the default output from pydantic by calling `to_dict()` of log if self.log: - _dict['log'] = self.log.to_dict() + _dict["log"] = self.log.to_dict() return _dict @classmethod @@ -97,14 +105,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "event": EventObjectEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, - "fly": EventObjectFly.from_dict(obj["fly"]) if obj.get("fly") is not None else None, - "host": obj.get("host"), - "log": EventObjectLog.from_dict(obj["log"]) if obj.get("log") is not None else None, - "message": obj.get("message"), - "timestamp": obj.get("timestamp") - }) + _obj = cls.model_validate( + { + "event": ( + EventObjectEvent.from_dict(obj["event"]) + if obj.get("event") is not None + else None + ), + "fly": ( + EventObjectFly.from_dict(obj["fly"]) + if obj.get("fly") is not None + else None + ), + "host": obj.get("host"), + "log": ( + EventObjectLog.from_dict(obj["log"]) + if obj.get("log") is not None + else None + ), + "message": obj.get("message"), + "timestamp": obj.get("timestamp"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_event.py b/hatchet_sdk/clients/cloud_rest/models/event_object_event.py index 4ac8a299..6d5154f1 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_event.py +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_event.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class EventObjectEvent(BaseModel): """ EventObjectEvent - """ # noqa: E501 + """ # noqa: E501 + provider: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["provider"] @@ -35,7 +37,6 @@ class EventObjectEvent(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "provider": obj.get("provider") - }) + _obj = cls.model_validate({"provider": obj.get("provider")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py b/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py index 75542efc..3cbb7843 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp + + class EventObjectFly(BaseModel): """ EventObjectFly - """ # noqa: E501 + """ # noqa: E501 + app: Optional[EventObjectFlyApp] = None region: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["app", "region"] @@ -37,7 +40,6 @@ class EventObjectFly(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict['app'] = self.app.to_dict() + _dict["app"] = self.app.to_dict() return _dict @classmethod @@ -84,10 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "app": EventObjectFlyApp.from_dict(obj["app"]) if obj.get("app") is not None else None, - "region": obj.get("region") - }) + _obj = cls.model_validate( + { + "app": ( + EventObjectFlyApp.from_dict(obj["app"]) + if obj.get("app") is not None + else None + ), + "region": obj.get("region"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py b/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py index 8149e3e0..3f7b87a0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class EventObjectFlyApp(BaseModel): """ EventObjectFlyApp - """ # noqa: E501 + """ # noqa: E501 + instance: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["instance", "name"] @@ -36,7 +38,6 @@ class EventObjectFlyApp(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "name": obj.get("name") - }) + _obj = cls.model_validate( + {"instance": obj.get("instance"), "name": obj.get("name")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_log.py b/hatchet_sdk/clients/cloud_rest/models/event_object_log.py index c5647b85..b3d93b83 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_log.py +++ b/hatchet_sdk/clients/cloud_rest/models/event_object_log.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class EventObjectLog(BaseModel): """ EventObjectLog - """ # noqa: E501 + """ # noqa: E501 + level: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["level"] @@ -35,7 +37,6 @@ class EventObjectLog(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "level": obj.get("level") - }) + _obj = cls.model_validate({"level": obj.get("level")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py b/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py index 9e99d004..f8f533fa 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py @@ -13,25 +13,33 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta + + class GithubAppInstallation(BaseModel): """ GithubAppInstallation - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta installation_settings_url: StrictStr account_name: StrictStr account_avatar_url: StrictStr - __properties: ClassVar[List[str]] = ["metadata", "installation_settings_url", "account_name", "account_avatar_url"] + __properties: ClassVar[List[str]] = [ + "metadata", + "installation_settings_url", + "account_name", + "account_avatar_url", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +47,6 @@ class GithubAppInstallation(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +71,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -74,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -86,12 +92,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "installation_settings_url": obj.get("installation_settings_url"), - "account_name": obj.get("account_name"), - "account_avatar_url": obj.get("account_avatar_url") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "installation_settings_url": obj.get("installation_settings_url"), + "account_name": obj.get("account_name"), + "account_avatar_url": obj.get("account_avatar_url"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_branch.py b/hatchet_sdk/clients/cloud_rest/models/github_branch.py index 7ddd7b8f..16501da3 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_branch.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_branch.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class GithubBranch(BaseModel): """ GithubBranch - """ # noqa: E501 + """ # noqa: E501 + branch_name: StrictStr is_default: StrictBool __properties: ClassVar[List[str]] = ["branch_name", "is_default"] @@ -36,7 +38,6 @@ class GithubBranch(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "branch_name": obj.get("branch_name"), - "is_default": obj.get("is_default") - }) + _obj = cls.model_validate( + {"branch_name": obj.get("branch_name"), "is_default": obj.get("is_default")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_repo.py b/hatchet_sdk/clients/cloud_rest/models/github_repo.py index edf734b9..3bc4d179 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_repo.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_repo.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class GithubRepo(BaseModel): """ GithubRepo - """ # noqa: E501 + """ # noqa: E501 + repo_owner: StrictStr repo_name: StrictStr __properties: ClassVar[List[str]] = ["repo_owner", "repo_name"] @@ -36,7 +38,6 @@ class GithubRepo(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "repo_owner": obj.get("repo_owner"), - "repo_name": obj.get("repo_name") - }) + _obj = cls.model_validate( + {"repo_owner": obj.get("repo_owner"), "repo_name": obj.get("repo_name")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py b/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py index 45614e61..b9dd9730 100644 --- a/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py +++ b/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set from typing_extensions import Self + class HistogramBucket(BaseModel): """ HistogramBucket - """ # noqa: E501 + """ # noqa: E501 + boundaries: Optional[StrictInt] = None lower: Optional[Union[StrictFloat, StrictInt]] = None upper: Optional[Union[StrictFloat, StrictInt]] = None @@ -38,7 +40,6 @@ class HistogramBucket(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +82,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "boundaries": obj.get("boundaries"), - "lower": obj.get("lower"), - "upper": obj.get("upper"), - "count": obj.get("count") - }) + _obj = cls.model_validate( + { + "boundaries": obj.get("boundaries"), + "lower": obj.get("lower"), + "upper": obj.get("upper"), + "count": obj.get("count"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py index cea57a63..4d97db73 100644 --- a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) + + class InfraAsCodeRequest(BaseModel): """ InfraAsCodeRequest - """ # noqa: E501 - runtime_configs: List[CreateManagedWorkerRuntimeConfigRequest] = Field(alias="runtimeConfigs") + """ # noqa: E501 + + runtime_configs: List[CreateManagedWorkerRuntimeConfigRequest] = Field( + alias="runtimeConfigs" + ) __properties: ClassVar[List[str]] = ["runtimeConfigs"] model_config = ConfigDict( @@ -36,7 +43,6 @@ class InfraAsCodeRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict['runtimeConfigs'] = _items + _dict["runtimeConfigs"] = _items return _dict @classmethod @@ -87,9 +92,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "runtimeConfigs": [CreateManagedWorkerRuntimeConfigRequest.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None - }) + _obj = cls.model_validate( + { + "runtimeConfigs": ( + [ + CreateManagedWorkerRuntimeConfigRequest.from_dict(_item) + for _item in obj["runtimeConfigs"] + ] + if obj.get("runtimeConfigs") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/instance.py b/hatchet_sdk/clients/cloud_rest/models/instance.py index 53e85315..20236f9d 100644 --- a/hatchet_sdk/clients/cloud_rest/models/instance.py +++ b/hatchet_sdk/clients/cloud_rest/models/instance.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class Instance(BaseModel): """ Instance - """ # noqa: E501 + """ # noqa: E501 + instance_id: StrictStr = Field(alias="instanceId") name: StrictStr region: StrictStr @@ -35,7 +37,17 @@ class Instance(BaseModel): memory_mb: StrictInt = Field(alias="memoryMb") disk_gb: StrictInt = Field(alias="diskGb") commit_sha: StrictStr = Field(alias="commitSha") - __properties: ClassVar[List[str]] = ["instanceId", "name", "region", "state", "cpuKind", "cpus", "memoryMb", "diskGb", "commitSha"] + __properties: ClassVar[List[str]] = [ + "instanceId", + "name", + "region", + "state", + "cpuKind", + "cpus", + "memoryMb", + "diskGb", + "commitSha", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +55,6 @@ class Instance(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +79,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,17 +97,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "name": obj.get("name"), - "region": obj.get("region"), - "state": obj.get("state"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "diskGb": obj.get("diskGb"), - "commitSha": obj.get("commitSha") - }) + _obj = cls.model_validate( + { + "instanceId": obj.get("instanceId"), + "name": obj.get("name"), + "region": obj.get("region"), + "state": obj.get("state"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "diskGb": obj.get("diskGb"), + "commitSha": obj.get("commitSha"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/instance_list.py b/hatchet_sdk/clients/cloud_rest/models/instance_list.py index 4d6f99ec..9a8b1bf8 100644 --- a/hatchet_sdk/clients/cloud_rest/models/instance_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/instance_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.cloud_rest.models.instance import Instance from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class InstanceList(BaseModel): """ InstanceList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[Instance]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class InstanceList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [Instance.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [Instance.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py b/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py index c7d783ff..cc4f82fc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import GithubAppInstallation -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( + GithubAppInstallation, +) +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse + + class ListGithubAppInstallationsResponse(BaseModel): """ ListGithubAppInstallationsResponse - """ # noqa: E501 + """ # noqa: E501 + pagination: PaginationResponse rows: List[GithubAppInstallation] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +43,6 @@ class ListGithubAppInstallationsResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +76,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +95,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [GithubAppInstallation.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [GithubAppInstallation.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line.py b/hatchet_sdk/clients/cloud_rest/models/log_line.py index 277b9888..c571f1a7 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_line.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_line.py @@ -13,20 +13,22 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class LogLine(BaseModel): """ LogLine - """ # noqa: E501 + """ # noqa: E501 + timestamp: datetime instance: StrictStr line: StrictStr @@ -38,7 +40,6 @@ class LogLine(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "instance": obj.get("instance"), - "line": obj.get("line") - }) + _obj = cls.model_validate( + { + "timestamp": obj.get("timestamp"), + "instance": obj.get("instance"), + "line": obj.get("line"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line_list.py b/hatchet_sdk/clients/cloud_rest/models/log_line_list.py index ca0b9b76..7ddf7cd3 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_line_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_line_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class LogLineList(BaseModel): """ LogLineList - """ # noqa: E501 + """ # noqa: E501 + rows: Optional[List[LogLine]] = None pagination: Optional[PaginationResponse] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -38,7 +41,6 @@ class LogLineList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rows": [LogLine.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "rows": ( + [LogLine.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker.py index 0f6adac9..3ab7a453 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker.py @@ -13,29 +13,48 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ManagedWorkerBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ManagedWorkerRuntimeConfig -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( + ManagedWorkerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( + ManagedWorkerRuntimeConfig, +) + + class ManagedWorker(BaseModel): """ ManagedWorker - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr build_config: ManagedWorkerBuildConfig = Field(alias="buildConfig") is_iac: StrictBool = Field(alias="isIac") - env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") - runtime_configs: Optional[List[ManagedWorkerRuntimeConfig]] = Field(default=None, alias="runtimeConfigs") - __properties: ClassVar[List[str]] = ["metadata", "name", "buildConfig", "isIac", "envVars", "runtimeConfigs"] + env_vars: Dict[str, StrictStr] = Field( + description="A map of environment variables to set for the worker", + alias="envVars", + ) + runtime_configs: Optional[List[ManagedWorkerRuntimeConfig]] = Field( + default=None, alias="runtimeConfigs" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "buildConfig", + "isIac", + "envVars", + "runtimeConfigs", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +62,6 @@ class ManagedWorker(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,17 +95,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list) _items = [] if self.runtime_configs: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict['runtimeConfigs'] = _items + _dict["runtimeConfigs"] = _items return _dict @classmethod @@ -100,13 +117,28 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "buildConfig": ManagedWorkerBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfigs": [ManagedWorkerRuntimeConfig.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "buildConfig": ( + ManagedWorkerBuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfigs": ( + [ + ManagedWorkerRuntimeConfig.from_dict(_item) + for _item in obj["runtimeConfigs"] + ] + if obj.get("runtimeConfigs") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py index 1715b20f..500fac21 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py @@ -13,29 +13,39 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated +from typing_extensions import Annotated, Self + from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo -from typing import Optional, Set -from typing_extensions import Self + class ManagedWorkerBuildConfig(BaseModel): """ ManagedWorkerBuildConfig - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + github_installation_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36) + ] = Field(alias="githubInstallationId") github_repository: GithubRepo = Field(alias="githubRepository") github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") steps: Optional[List[BuildStep]] = None - __properties: ClassVar[List[str]] = ["metadata", "githubInstallationId", "githubRepository", "githubRepositoryBranch", "steps"] + __properties: ClassVar[List[str]] = [ + "metadata", + "githubInstallationId", + "githubRepository", + "githubRepositoryBranch", + "steps", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +53,6 @@ class ManagedWorkerBuildConfig(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,17 +86,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of github_repository if self.github_repository: - _dict['githubRepository'] = self.github_repository.to_dict() + _dict["githubRepository"] = self.github_repository.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict['steps'] = _items + _dict["steps"] = _items return _dict @classmethod @@ -100,13 +108,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepository": GithubRepo.from_dict(obj["githubRepository"]) if obj.get("githubRepository") is not None else None, - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": [BuildStep.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepository": ( + GithubRepo.from_dict(obj["githubRepository"]) + if obj.get("githubRepository") is not None + else None + ), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": ( + [BuildStep.from_dict(_item) for _item in obj["steps"]] + if obj.get("steps") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py index 67323d4b..e431112a 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ManagedWorkerEventStatus -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( + ManagedWorkerEventStatus, +) + + class ManagedWorkerEvent(BaseModel): """ ManagedWorkerEvent - """ # noqa: E501 + """ # noqa: E501 + id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") @@ -35,7 +40,15 @@ class ManagedWorkerEvent(BaseModel): status: ManagedWorkerEventStatus message: StrictStr data: Dict[str, Any] - __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "managedWorkerId", "status", "message", "data"] + __properties: ClassVar[List[str]] = [ + "id", + "timeFirstSeen", + "timeLastSeen", + "managedWorkerId", + "status", + "message", + "data", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +56,6 @@ class ManagedWorkerEvent(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +80,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,15 +98,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "timeFirstSeen": obj.get("timeFirstSeen"), - "timeLastSeen": obj.get("timeLastSeen"), - "managedWorkerId": obj.get("managedWorkerId"), - "status": obj.get("status"), - "message": obj.get("message"), - "data": obj.get("data") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "managedWorkerId": obj.get("managedWorkerId"), + "status": obj.get("status"), + "message": obj.get("message"), + "data": obj.get("data"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py index 22a5d3a3..185c0d54 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ManagedWorkerEvent -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( + ManagedWorkerEvent, +) +from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse + + class ManagedWorkerEventList(BaseModel): """ ManagedWorkerEventList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[ManagedWorkerEvent]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +43,6 @@ class ManagedWorkerEventList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +76,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +95,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [ManagedWorkerEvent.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [ManagedWorkerEvent.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py index 176586ab..db784111 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,14 +28,12 @@ class ManagedWorkerEventStatus(str, Enum): """ allowed enum values """ - IN_PROGRESS = 'IN_PROGRESS' - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - CANCELLED = 'CANCELLED' + IN_PROGRESS = "IN_PROGRESS" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ManagedWorkerEventStatus from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py index 297daf33..838e803c 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class ManagedWorkerList(BaseModel): """ ManagedWorkerList - """ # noqa: E501 + """ # noqa: E501 + rows: Optional[List[ManagedWorker]] = None pagination: Optional[PaginationResponse] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -38,7 +41,6 @@ class ManagedWorkerList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rows": [ManagedWorker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "rows": ( + [ManagedWorker.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py index d49aa594..2b07a20a 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,43 +28,41 @@ class ManagedWorkerRegion(str, Enum): """ allowed enum values """ - AMS = 'ams' - ARN = 'arn' - ATL = 'atl' - BOG = 'bog' - BOS = 'bos' - CDG = 'cdg' - DEN = 'den' - DFW = 'dfw' - EWR = 'ewr' - EZE = 'eze' - GDL = 'gdl' - GIG = 'gig' - GRU = 'gru' - HKG = 'hkg' - IAD = 'iad' - JNB = 'jnb' - LAX = 'lax' - LHR = 'lhr' - MAD = 'mad' - MIA = 'mia' - NRT = 'nrt' - ORD = 'ord' - OTP = 'otp' - PHX = 'phx' - QRO = 'qro' - SCL = 'scl' - SEA = 'sea' - SIN = 'sin' - SJC = 'sjc' - SYD = 'syd' - WAW = 'waw' - YUL = 'yul' - YYZ = 'yyz' + AMS = "ams" + ARN = "arn" + ATL = "atl" + BOG = "bog" + BOS = "bos" + CDG = "cdg" + DEN = "den" + DFW = "dfw" + EWR = "ewr" + EZE = "eze" + GDL = "gdl" + GIG = "gig" + GRU = "gru" + HKG = "hkg" + IAD = "iad" + JNB = "jnb" + LAX = "lax" + LHR = "lhr" + MAD = "mad" + MIA = "mia" + NRT = "nrt" + ORD = "ord" + OTP = "otp" + PHX = "phx" + QRO = "qro" + SCL = "scl" + SEA = "sea" + SIN = "sin" + SJC = "sjc" + SYD = "syd" + WAW = "waw" + YUL = "yul" + YYZ = "yyz" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of ManagedWorkerRegion from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py index 86cfa94c..d4732f3f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py @@ -13,29 +13,50 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) + + class ManagedWorkerRuntimeConfig(BaseModel): """ ManagedWorkerRuntimeConfig - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta num_replicas: StrictInt = Field(alias="numReplicas") - cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpu_kind: StrictStr = Field( + description="The kind of CPU to use for the worker", alias="cpuKind" + ) cpus: StrictInt = Field(description="The number of CPUs to use for the worker") - memory_mb: StrictInt = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") - region: ManagedWorkerRegion = Field(description="The region that the worker is deployed to") - actions: Optional[List[StrictStr]] = Field(default=None, description="A list of actions this runtime config corresponds to") - __properties: ClassVar[List[str]] = ["metadata", "numReplicas", "cpuKind", "cpus", "memoryMb", "region", "actions"] + memory_mb: StrictInt = Field( + description="The amount of memory in MB to use for the worker", alias="memoryMb" + ) + region: ManagedWorkerRegion = Field( + description="The region that the worker is deployed to" + ) + actions: Optional[List[StrictStr]] = Field( + default=None, description="A list of actions this runtime config corresponds to" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "numReplicas", + "cpuKind", + "cpus", + "memoryMb", + "region", + "actions", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +64,6 @@ class ManagedWorkerRuntimeConfig(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +88,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +97,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,15 +109,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "numReplicas": obj.get("numReplicas"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "region": obj.get("region"), - "actions": obj.get("actions") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "numReplicas": obj.get("numReplicas"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "region": obj.get("region"), + "actions": obj.get("actions"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/pagination_response.py b/hatchet_sdk/clients/cloud_rest/models/pagination_response.py index 8d1ebd1e..2994dee9 100644 --- a/hatchet_sdk/clients/cloud_rest/models/pagination_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/pagination_response.py @@ -13,22 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class PaginationResponse(BaseModel): """ PaginationResponse - """ # noqa: E501 - current_page: Optional[StrictInt] = Field(default=None, description="the current page") + """ # noqa: E501 + + current_page: Optional[StrictInt] = Field( + default=None, description="the current page" + ) next_page: Optional[StrictInt] = Field(default=None, description="the next page") - num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") + num_pages: Optional[StrictInt] = Field( + default=None, description="the total number of pages for listing" + ) __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] model_config = ConfigDict( @@ -37,7 +43,6 @@ class PaginationResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "current_page": obj.get("current_page"), - "next_page": obj.get("next_page"), - "num_pages": obj.get("num_pages") - }) + _obj = cls.model_validate( + { + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py b/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py index 9ef008f6..8d02a0fe 100644 --- a/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class RuntimeConfigActionsResponse(BaseModel): """ RuntimeConfigActionsResponse - """ # noqa: E501 + """ # noqa: E501 + actions: List[StrictStr] __properties: ClassVar[List[str]] = ["actions"] @@ -35,7 +37,6 @@ class RuntimeConfigActionsResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "actions": obj.get("actions") - }) + _obj = cls.model_validate({"actions": obj.get("actions")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py b/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py index 6d07a2fb..5f84eff8 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py +++ b/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket + + class SampleHistogram(BaseModel): """ SampleHistogram - """ # noqa: E501 + """ # noqa: E501 + count: Optional[Union[StrictFloat, StrictInt]] = None sum: Optional[Union[StrictFloat, StrictInt]] = None buckets: Optional[List[HistogramBucket]] = None @@ -38,7 +41,6 @@ class SampleHistogram(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.buckets: if _item: _items.append(_item.to_dict()) - _dict['buckets'] = _items + _dict["buckets"] = _items return _dict @classmethod @@ -89,11 +90,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "count": obj.get("count"), - "sum": obj.get("sum"), - "buckets": [HistogramBucket.from_dict(_item) for _item in obj["buckets"]] if obj.get("buckets") is not None else None - }) + _obj = cls.model_validate( + { + "count": obj.get("count"), + "sum": obj.get("sum"), + "buckets": ( + [HistogramBucket.from_dict(_item) for _item in obj["buckets"]] + if obj.get("buckets") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py b/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py index ec874700..e78aa9c5 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py +++ b/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram + + class SampleHistogramPair(BaseModel): """ SampleHistogramPair - """ # noqa: E501 + """ # noqa: E501 + timestamp: Optional[StrictInt] = None histogram: Optional[SampleHistogram] = None __properties: ClassVar[List[str]] = ["timestamp", "histogram"] @@ -37,7 +40,6 @@ class SampleHistogramPair(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of histogram if self.histogram: - _dict['histogram'] = self.histogram.to_dict() + _dict["histogram"] = self.histogram.to_dict() return _dict @classmethod @@ -84,10 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "histogram": SampleHistogram.from_dict(obj["histogram"]) if obj.get("histogram") is not None else None - }) + _obj = cls.model_validate( + { + "timestamp": obj.get("timestamp"), + "histogram": ( + SampleHistogram.from_dict(obj["histogram"]) + if obj.get("histogram") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_stream.py b/hatchet_sdk/clients/cloud_rest/models/sample_stream.py index dbfb00e4..446c3f6c 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_stream.py +++ b/hatchet_sdk/clients/cloud_rest/models/sample_stream.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import SampleHistogramPair -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( + SampleHistogramPair, +) + + class SampleStream(BaseModel): """ SampleStream - """ # noqa: E501 + """ # noqa: E501 + metric: Optional[Dict[str, StrictStr]] = None values: Optional[List[List[StrictStr]]] = None histograms: Optional[List[SampleHistogramPair]] = None @@ -38,7 +43,6 @@ class SampleStream(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.histograms: if _item: _items.append(_item.to_dict()) - _dict['histograms'] = _items + _dict["histograms"] = _items return _dict @classmethod @@ -89,10 +92,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "values": obj.get("values"), - "histograms": [SampleHistogramPair.from_dict(_item) for _item in obj["histograms"]] if obj.get("histograms") is not None else None - }) + _obj = cls.model_validate( + { + "values": obj.get("values"), + "histograms": ( + [ + SampleHistogramPair.from_dict(_item) + for _item in obj["histograms"] + ] + if obj.get("histograms") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py b/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py index 424cfbc8..b775c1bd 100644 --- a/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py @@ -13,25 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class SubscriptionPlan(BaseModel): """ SubscriptionPlan - """ # noqa: E501 + """ # noqa: E501 + plan_code: StrictStr = Field(description="The code of the plan.") name: StrictStr = Field(description="The name of the plan.") description: StrictStr = Field(description="The description of the plan.") amount_cents: StrictInt = Field(description="The price of the plan.") - period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") - __properties: ClassVar[List[str]] = ["plan_code", "name", "description", "amount_cents", "period"] + period: Optional[StrictStr] = Field( + default=None, description="The period of the plan." + ) + __properties: ClassVar[List[str]] = [ + "plan_code", + "name", + "description", + "amount_cents", + "period", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +49,6 @@ class SubscriptionPlan(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,13 +91,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan_code": obj.get("plan_code"), - "name": obj.get("name"), - "description": obj.get("description"), - "amount_cents": obj.get("amount_cents"), - "period": obj.get("period") - }) + _obj = cls.model_validate( + { + "plan_code": obj.get("plan_code"), + "name": obj.get("name"), + "description": obj.get("description"), + "amount_cents": obj.get("amount_cents"), + "period": obj.get("period"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py index b5859a1f..8b25bedf 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py @@ -13,28 +13,46 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import TenantPaymentMethod +from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( + TenantPaymentMethod, +) from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from typing import Optional, Set -from typing_extensions import Self + class TenantBillingState(BaseModel): """ TenantBillingState - """ # noqa: E501 - payment_methods: Optional[List[TenantPaymentMethod]] = Field(default=None, alias="paymentMethods") - subscription: TenantSubscription = Field(description="The subscription associated with this policy.") - plans: Optional[List[SubscriptionPlan]] = Field(default=None, description="A list of plans available for the tenant.") - coupons: Optional[List[Coupon]] = Field(default=None, description="A list of coupons applied to the tenant.") - __properties: ClassVar[List[str]] = ["paymentMethods", "subscription", "plans", "coupons"] + """ # noqa: E501 + + payment_methods: Optional[List[TenantPaymentMethod]] = Field( + default=None, alias="paymentMethods" + ) + subscription: TenantSubscription = Field( + description="The subscription associated with this policy." + ) + plans: Optional[List[SubscriptionPlan]] = Field( + default=None, description="A list of plans available for the tenant." + ) + coupons: Optional[List[Coupon]] = Field( + default=None, description="A list of coupons applied to the tenant." + ) + __properties: ClassVar[List[str]] = [ + "paymentMethods", + "subscription", + "plans", + "coupons", + ] model_config = ConfigDict( populate_by_name=True, @@ -42,7 +60,6 @@ class TenantBillingState(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +84,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,24 +97,24 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.payment_methods: if _item: _items.append(_item.to_dict()) - _dict['paymentMethods'] = _items + _dict["paymentMethods"] = _items # override the default output from pydantic by calling `to_dict()` of subscription if self.subscription: - _dict['subscription'] = self.subscription.to_dict() + _dict["subscription"] = self.subscription.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in plans (list) _items = [] if self.plans: for _item in self.plans: if _item: _items.append(_item.to_dict()) - _dict['plans'] = _items + _dict["plans"] = _items # override the default output from pydantic by calling `to_dict()` of each item in coupons (list) _items = [] if self.coupons: for _item in self.coupons: if _item: _items.append(_item.to_dict()) - _dict['coupons'] = _items + _dict["coupons"] = _items return _dict @classmethod @@ -110,12 +126,31 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "paymentMethods": [TenantPaymentMethod.from_dict(_item) for _item in obj["paymentMethods"]] if obj.get("paymentMethods") is not None else None, - "subscription": TenantSubscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None, - "plans": [SubscriptionPlan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None, - "coupons": [Coupon.from_dict(_item) for _item in obj["coupons"]] if obj.get("coupons") is not None else None - }) + _obj = cls.model_validate( + { + "paymentMethods": ( + [ + TenantPaymentMethod.from_dict(_item) + for _item in obj["paymentMethods"] + ] + if obj.get("paymentMethods") is not None + else None + ), + "subscription": ( + TenantSubscription.from_dict(obj["subscription"]) + if obj.get("subscription") is not None + else None + ), + "plans": ( + [SubscriptionPlan.from_dict(_item) for _item in obj["plans"]] + if obj.get("plans") is not None + else None + ), + "coupons": ( + [Coupon.from_dict(_item) for _item in obj["coupons"]] + if obj.get("coupons") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py b/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py index 31f10fb0..b73208da 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py @@ -13,23 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TenantPaymentMethod(BaseModel): """ TenantPaymentMethod - """ # noqa: E501 + """ # noqa: E501 + brand: StrictStr = Field(description="The brand of the payment method.") - last4: Optional[StrictStr] = Field(default=None, description="The last 4 digits of the card.") - expiration: Optional[StrictStr] = Field(default=None, description="The expiration date of the card.") - description: Optional[StrictStr] = Field(default=None, description="The description of the payment method.") + last4: Optional[StrictStr] = Field( + default=None, description="The last 4 digits of the card." + ) + expiration: Optional[StrictStr] = Field( + default=None, description="The expiration date of the card." + ) + description: Optional[StrictStr] = Field( + default=None, description="The description of the payment method." + ) __properties: ClassVar[List[str]] = ["brand", "last4", "expiration", "description"] model_config = ConfigDict( @@ -38,7 +46,6 @@ class TenantPaymentMethod(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +88,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "brand": obj.get("brand"), - "last4": obj.get("last4"), - "expiration": obj.get("expiration"), - "description": obj.get("description") - }) + _obj = cls.model_validate( + { + "brand": obj.get("brand"), + "last4": obj.get("last4"), + "expiration": obj.get("expiration"), + "description": obj.get("description"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py index 9f160280..cf89100f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py @@ -13,24 +13,38 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import TenantSubscriptionStatus -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( + TenantSubscriptionStatus, +) + + class TenantSubscription(BaseModel): """ TenantSubscription - """ # noqa: E501 - plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") - period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") - status: Optional[TenantSubscriptionStatus] = Field(default=None, description="The status of the tenant subscription.") - note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") + """ # noqa: E501 + + plan: Optional[StrictStr] = Field( + default=None, + description="The plan code associated with the tenant subscription.", + ) + period: Optional[StrictStr] = Field( + default=None, description="The period associated with the tenant subscription." + ) + status: Optional[TenantSubscriptionStatus] = Field( + default=None, description="The status of the tenant subscription." + ) + note: Optional[StrictStr] = Field( + default=None, description="A note associated with the tenant subscription." + ) __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] model_config = ConfigDict( @@ -39,7 +53,6 @@ class TenantSubscription(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,12 +95,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan": obj.get("plan"), - "period": obj.get("period"), - "status": obj.get("status"), - "note": obj.get("note") - }) + _obj = cls.model_validate( + { + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py index 4df0c6bc..ab9edba1 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,14 +28,12 @@ class TenantSubscriptionStatus(str, Enum): """ allowed enum values """ - ACTIVE = 'active' - PENDING = 'pending' - TERMINATED = 'terminated' - CANCELED = 'canceled' + ACTIVE = "active" + PENDING = "pending" + TERMINATED = "terminated" + CANCELED = "canceled" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TenantSubscriptionStatus from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py index a8991434..62979281 100644 --- a/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py @@ -13,27 +13,48 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import CreateManagedWorkerBuildConfigRequest -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( + CreateManagedWorkerBuildConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) + + class UpdateManagedWorkerRequest(BaseModel): """ UpdateManagedWorkerRequest - """ # noqa: E501 + """ # noqa: E501 + name: Optional[StrictStr] = None - build_config: Optional[CreateManagedWorkerBuildConfigRequest] = Field(default=None, alias="buildConfig") - env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of environment variables to set for the worker", alias="envVars") + build_config: Optional[CreateManagedWorkerBuildConfigRequest] = Field( + default=None, alias="buildConfig" + ) + env_vars: Optional[Dict[str, StrictStr]] = Field( + default=None, + description="A map of environment variables to set for the worker", + alias="envVars", + ) is_iac: Optional[StrictBool] = Field(default=None, alias="isIac") - runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field(default=None, alias="runtimeConfig") - __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field( + default=None, alias="runtimeConfig" + ) + __properties: ClassVar[List[str]] = [ + "name", + "buildConfig", + "envVars", + "isIac", + "runtimeConfig", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +62,6 @@ class UpdateManagedWorkerRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,10 +95,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict['runtimeConfig'] = self.runtime_config.to_dict() + _dict["runtimeConfig"] = self.runtime_config.to_dict() return _dict @classmethod @@ -91,12 +110,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "buildConfig": CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfig": CreateManagedWorkerRuntimeConfigRequest.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "buildConfig": ( + CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfig": ( + CreateManagedWorkerRuntimeConfigRequest.from_dict( + obj["runtimeConfig"] + ) + if obj.get("runtimeConfig") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py index d2ae860e..33babb9e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py +++ b/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class UpdateTenantSubscription(BaseModel): """ UpdateTenantSubscription - """ # noqa: E501 + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The code of the plan.") - period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") + period: Optional[StrictStr] = Field( + default=None, description="The period of the plan." + ) __properties: ClassVar[List[str]] = ["plan", "period"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class UpdateTenantSubscription(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan": obj.get("plan"), - "period": obj.get("period") - }) + _obj = cls.model_validate( + {"plan": obj.get("plan"), "period": obj.get("period")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py index 37840dce..94547c63 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py @@ -13,27 +13,36 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class WorkflowRunEventsMetric(BaseModel): """ WorkflowRunEventsMetric - """ # noqa: E501 + """ # noqa: E501 + time: datetime pending: StrictInt = Field(alias="PENDING") running: StrictInt = Field(alias="RUNNING") succeeded: StrictInt = Field(alias="SUCCEEDED") failed: StrictInt = Field(alias="FAILED") queued: StrictInt = Field(alias="QUEUED") - __properties: ClassVar[List[str]] = ["time", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] + __properties: ClassVar[List[str]] = [ + "time", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "QUEUED", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +50,6 @@ class WorkflowRunEventsMetric(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -85,14 +92,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "time": obj.get("time"), - "PENDING": obj.get("PENDING"), - "RUNNING": obj.get("RUNNING"), - "SUCCEEDED": obj.get("SUCCEEDED"), - "FAILED": obj.get("FAILED"), - "QUEUED": obj.get("QUEUED") - }) + _obj = cls.model_validate( + { + "time": obj.get("time"), + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py index 17406b11..d324a2c0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import WorkflowRunEventsMetric -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( + WorkflowRunEventsMetric, +) + + class WorkflowRunEventsMetricsCounts(BaseModel): """ WorkflowRunEventsMetricsCounts - """ # noqa: E501 + """ # noqa: E501 + results: Optional[List[WorkflowRunEventsMetric]] = None __properties: ClassVar[List[str]] = ["results"] @@ -36,7 +41,6 @@ class WorkflowRunEventsMetricsCounts(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.results: if _item: _items.append(_item.to_dict()) - _dict['results'] = _items + _dict["results"] = _items return _dict @classmethod @@ -87,9 +90,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "results": [WorkflowRunEventsMetric.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None - }) + _obj = cls.model_validate( + { + "results": ( + [ + WorkflowRunEventsMetric.from_dict(_item) + for _item in obj["results"] + ] + if obj.get("results") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/rest.py b/hatchet_sdk/clients/cloud_rest/rest.py index 35fe64cc..f7188ae4 100644 --- a/hatchet_sdk/clients/cloud_rest/rest.py +++ b/hatchet_sdk/clients/cloud_rest/rest.py @@ -25,7 +25,8 @@ RESTResponseType = aiohttp.ClientResponse -ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) +ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"}) + class RESTResponse(io.IOBase): @@ -56,9 +57,7 @@ def __init__(self, configuration) -> None: # maxsize is number of requests to host that are allowed in parallel maxsize = configuration.connection_pool_maxsize - ssl_context = ssl.create_default_context( - cafile=configuration.ssl_ca_cert - ) + ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -68,19 +67,13 @@ def __init__(self, configuration) -> None: ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) + connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context) self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers # https pool manager - self.pool_manager = aiohttp.ClientSession( - connector=connector, - trust_env=True - ) + self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) retries = configuration.retries self.retry_client: Optional[aiohttp_retry.RetryClient] @@ -88,11 +81,8 @@ def __init__(self, configuration) -> None: self.retry_client = aiohttp_retry.RetryClient( client_session=self.pool_manager, retry_options=aiohttp_retry.ExponentialRetry( - attempts=retries, - factor=0.0, - start_timeout=0.0, - max_timeout=120.0 - ) + attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 + ), ) else: self.retry_client = None @@ -109,7 +99,7 @@ async def request( headers=None, body=None, post_params=None, - _request_timeout=None + _request_timeout=None, ): """Execute request @@ -126,15 +116,7 @@ async def request( (connection, read) timeouts. """ method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] if post_params and body: raise ApiValueError( @@ -146,15 +128,10 @@ async def request( # url already contains the URL query string timeout = _request_timeout or 5 * 60 - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" - args = { - "method": method, - "url": url, - "timeout": timeout, - "headers": headers - } + args = {"method": method, "url": url, "timeout": timeout, "headers": headers} if self.proxy: args["proxy"] = self.proxy @@ -162,27 +139,22 @@ async def request( args["proxy_headers"] = self.proxy_headers # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if re.search("json", headers["Content-Type"], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + elif headers["Content-Type"] == "application/x-www-form-urlencoded": args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': + elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by aiohttp - del headers['Content-Type'] + del headers["Content-Type"] data = aiohttp.FormData() for param in post_params: k, v = param if isinstance(v, tuple) and len(v) == 3: - data.add_field( - k, - value=v[1], - filename=v[0], - content_type=v[2] - ) + data.add_field(k, value=v[1], filename=v[0], content_type=v[2]) else: data.add_field(k, v) args["data"] = data @@ -208,8 +180,3 @@ async def request( r = await pool_manager.request(**args) return RESTResponse(r) - - - - - diff --git a/hatchet_sdk/clients/rest/__init__.py b/hatchet_sdk/clients/rest/__init__.py index ce52b51d..31cf4825 100644 --- a/hatchet_sdk/clients/rest/__init__.py +++ b/hatchet_sdk/clients/rest/__init__.py @@ -18,32 +18,35 @@ # import apis into sdk package from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi +from hatchet_sdk.clients.rest.api.default_api import DefaultApi from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.github_api import GithubApi from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi -from hatchet_sdk.clients.rest.api.sns_api import SNSApi +from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi from hatchet_sdk.clients.rest.api.slack_api import SlackApi +from hatchet_sdk.clients.rest.api.sns_api import SNSApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi from hatchet_sdk.clients.rest.api.tenant_api import TenantApi from hatchet_sdk.clients.rest.api.user_api import UserApi from hatchet_sdk.clients.rest.api.worker_api import WorkerApi from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi -from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi -from hatchet_sdk.clients.rest.api.default_api import DefaultApi +from hatchet_sdk.clients.rest.api_client import ApiClient # import ApiClient from hatchet_sdk.clients.rest.api_response import ApiResponse -from hatchet_sdk.clients.rest.api_client import ApiClient from hatchet_sdk.clients.rest.configuration import Configuration -from hatchet_sdk.clients.rest.exceptions import OpenApiException -from hatchet_sdk.clients.rest.exceptions import ApiTypeError -from hatchet_sdk.clients.rest.exceptions import ApiValueError -from hatchet_sdk.clients.rest.exceptions import ApiKeyError -from hatchet_sdk.clients.rest.exceptions import ApiAttributeError -from hatchet_sdk.clients.rest.exceptions import ApiException +from hatchet_sdk.clients.rest.exceptions import ( + ApiAttributeError, + ApiException, + ApiKeyError, + ApiTypeError, + ApiValueError, + OpenApiException, +) +from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest # import models into sdk package from hatchet_sdk.clients.rest.models.api_error import APIError @@ -54,48 +57,93 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest -from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest -from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse +from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( + BulkCreateEventRequest, +) +from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( + BulkCreateEventResponse, +) +from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest +from hatchet_sdk.clients.rest.models.create_api_token_request import ( + CreateAPITokenRequest, +) +from hatchet_sdk.clients.rest.models.create_api_token_response import ( + CreateAPITokenResponse, +) from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest -from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import CreatePullRequestFromStepRun -from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest +from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import ( + CreatePullRequestFromStepRun, +) +from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( + CreateSNSIntegrationRequest, +) +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( + CreateTenantAlertEmailGroupRequest, +) +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( + CreateTenantInviteRequest, +) from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection +from hatchet_sdk.clients.rest.models.event_order_by_direction import ( + EventOrderByDirection, +) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary -from hatchet_sdk.clients.rest.models.get_step_run_diff_response import GetStepRunDiffResponse +from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( + EventUpdateCancel200Response, +) +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( + EventWorkflowRunSummary, +) +from hatchet_sdk.clients.rest.models.get_step_run_diff_response import ( + GetStepRunDiffResponse, +) from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run import JobRun from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse -from hatchet_sdk.clients.rest.models.list_pull_requests_response import ListPullRequestsResponse -from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( + ListAPITokensResponse, +) +from hatchet_sdk.clients.rest.models.list_pull_requests_response import ( + ListPullRequestsResponse, +) from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks +from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( + LogLineOrderByDirection, +) from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.pull_request import PullRequest from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics +from hatchet_sdk.clients.rest.models.rate_limit import RateLimit +from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList +from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import ( + RateLimitOrderByDirection, +) +from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import ( + RateLimitOrderByField, +) from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( + ReplayWorkflowRunsRequest, +) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( + ReplayWorkflowRunsResponse, +) from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive @@ -107,9 +155,15 @@ from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( + TenantAlertEmailGroup, +) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( + TenantAlertEmailGroupList, +) +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( + TenantAlertingSettings, +) from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_list import TenantList @@ -120,25 +174,48 @@ from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest +from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import ( + TenantStepRunQueueMetrics, +) +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( + TriggerWorkflowRunRequest, +) +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( + UpdateTenantAlertEmailGroupRequest, +) +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( + UpdateTenantInviteRequest, +) from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest +from hatchet_sdk.clients.rest.models.user_change_password_request import ( + UserChangePasswordRequest, +) from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( + UserTenantMembershipsList, +) from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest -from hatchet_sdk.clients.rest.models.webhook_worker_create_response import WebhookWorkerCreateResponse +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( + WebhookWorkerCreateRequest, +) +from hatchet_sdk.clients.rest.models.webhook_worker_create_response import ( + WebhookWorkerCreateResponse, +) from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( + WebhookWorkerListResponse, +) from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( + WebhookWorkerRequestListResponse, +) +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( + WebhookWorkerRequestMethod, +) from hatchet_sdk.clients.rest.models.worker import Worker from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel from hatchet_sdk.clients.rest.models.worker_list import WorkerList @@ -148,19 +225,39 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( + WorkflowRunOrderByDirection, +) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( + WorkflowRunOrderByField, +) +from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( + WorkflowRunTriggeredBy, +) +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( + WorkflowRunsCancelRequest, +) from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics -from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import WorkflowRunsMetricsCounts +from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( + WorkflowRunsMetricsCounts, +) from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( + WorkflowTriggerCronRef, +) +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( + WorkflowTriggerEventRef, +) from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers +from hatchet_sdk.clients.rest.models.workflow_update_request import ( + WorkflowUpdateRequest, +) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition +from hatchet_sdk.clients.rest.models.workflow_version_definition import ( + WorkflowVersionDefinition, +) from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta +from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount diff --git a/hatchet_sdk/clients/rest/api/__init__.py b/hatchet_sdk/clients/rest/api/__init__.py index 0e873f57..f6ecbe38 100644 --- a/hatchet_sdk/clients/rest/api/__init__.py +++ b/hatchet_sdk/clients/rest/api/__init__.py @@ -2,19 +2,18 @@ # import apis into api package from hatchet_sdk.clients.rest.api.api_token_api import APITokenApi +from hatchet_sdk.clients.rest.api.default_api import DefaultApi from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.github_api import GithubApi from hatchet_sdk.clients.rest.api.healthcheck_api import HealthcheckApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.metadata_api import MetadataApi -from hatchet_sdk.clients.rest.api.sns_api import SNSApi +from hatchet_sdk.clients.rest.api.rate_limits_api import RateLimitsApi from hatchet_sdk.clients.rest.api.slack_api import SlackApi +from hatchet_sdk.clients.rest.api.sns_api import SNSApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi from hatchet_sdk.clients.rest.api.tenant_api import TenantApi from hatchet_sdk.clients.rest.api.user_api import UserApi from hatchet_sdk.clients.rest.api.worker_api import WorkerApi from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi -from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi -from hatchet_sdk.clients.rest.api.default_api import DefaultApi - diff --git a/hatchet_sdk/clients/rest/api/api_token_api.py b/hatchet_sdk/clients/rest/api/api_token_api.py index 097cd1e4..5b32d0aa 100644 --- a/hatchet_sdk/clients/rest/api/api_token_api.py +++ b/hatchet_sdk/clients/rest/api/api_token_api.py @@ -12,19 +12,22 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest -from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.create_api_token_request import ( + CreateAPITokenRequest, +) +from hatchet_sdk.clients.rest.models.create_api_token_response import ( + CreateAPITokenResponse, +) +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( + ListAPITokensResponse, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,19 +43,22 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def api_token_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -87,7 +93,7 @@ async def api_token_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -95,17 +101,16 @@ async def api_token_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateAPITokenResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "CreateAPITokenResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -113,19 +118,22 @@ async def api_token_create( response_types_map=_response_types_map, ).data - @validate_call async def api_token_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -160,7 +168,7 @@ async def api_token_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -168,17 +176,16 @@ async def api_token_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateAPITokenResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "CreateAPITokenResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -186,19 +193,22 @@ async def api_token_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def api_token_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_api_token_request: Optional[CreateAPITokenRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -233,7 +243,7 @@ async def api_token_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_create_serialize( tenant=tenant, @@ -241,21 +251,19 @@ async def api_token_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateAPITokenResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "CreateAPITokenResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _api_token_create_serialize( self, tenant, @@ -268,8 +276,7 @@ def _api_token_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -280,7 +287,7 @@ def _api_token_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -288,37 +295,27 @@ def _api_token_create_serialize( if create_api_token_request is not None: _body_params = create_api_token_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/api-tokens', + method="POST", + resource_path="/api/v1/tenants/{tenant}/api-tokens", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -328,23 +325,24 @@ def _api_token_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def api_token_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -377,24 +375,23 @@ async def api_token_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAPITokensResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "ListAPITokensResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -402,18 +399,21 @@ async def api_token_list( response_types_map=_response_types_map, ).data - @validate_call async def api_token_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -446,24 +446,23 @@ async def api_token_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAPITokensResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "ListAPITokensResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -471,18 +470,21 @@ async def api_token_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def api_token_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -515,28 +517,26 @@ async def api_token_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListAPITokensResponse", - '400': "APIErrors", - '403': "APIErrors", + "200": "ListAPITokensResponse", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _api_token_list_serialize( self, tenant, @@ -548,8 +548,7 @@ def _api_token_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -560,30 +559,23 @@ def _api_token_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/api-tokens', + method="GET", + resource_path="/api/v1/tenants/{tenant}/api-tokens", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -593,23 +585,24 @@ def _api_token_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def api_token_update_revoke( self, - api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], + api_token: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The API token" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -642,24 +635,23 @@ async def api_token_update_revoke( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -667,18 +659,21 @@ async def api_token_update_revoke( response_types_map=_response_types_map, ).data - @validate_call async def api_token_update_revoke_with_http_info( self, - api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], + api_token: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The API token" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -711,24 +706,23 @@ async def api_token_update_revoke_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -736,18 +730,21 @@ async def api_token_update_revoke_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def api_token_update_revoke_without_preload_content( self, - api_token: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The API token")], + api_token: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The API token" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -780,28 +777,26 @@ async def api_token_update_revoke_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._api_token_update_revoke_serialize( api_token=api_token, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _api_token_update_revoke_serialize( self, api_token, @@ -813,8 +808,7 @@ def _api_token_update_revoke_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -825,30 +819,23 @@ def _api_token_update_revoke_serialize( # process the path parameters if api_token is not None: - _path_params['api-token'] = api_token + _path_params["api-token"] = api_token # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/api-tokens/{api-token}', + method="POST", + resource_path="/api/v1/api-tokens/{api-token}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -858,7 +845,5 @@ def _api_token_update_revoke_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/default_api.py b/hatchet_sdk/clients/rest/api/default_api.py index 902461ab..5cd078e4 100644 --- a/hatchet_sdk/clients/rest/api/default_api.py +++ b/hatchet_sdk/clients/rest/api/default_api.py @@ -12,22 +12,27 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest -from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( + UpdateTenantInviteRequest, +) +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( + WebhookWorkerCreateRequest, +) +from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( + WebhookWorkerListResponse, +) +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( + WebhookWorkerRequestListResponse, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -43,19 +48,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def tenant_invite_delete( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -90,7 +106,7 @@ async def tenant_invite_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -98,16 +114,15 @@ async def tenant_invite_delete( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -115,19 +130,30 @@ async def tenant_invite_delete( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_delete_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -162,7 +188,7 @@ async def tenant_invite_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -170,16 +196,15 @@ async def tenant_invite_delete_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -187,19 +212,30 @@ async def tenant_invite_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_delete_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -234,7 +270,7 @@ async def tenant_invite_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_delete_serialize( tenant=tenant, @@ -242,20 +278,18 @@ async def tenant_invite_delete_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_delete_serialize( self, tenant, @@ -268,8 +302,7 @@ def _tenant_invite_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -280,32 +313,25 @@ def _tenant_invite_delete_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if tenant_invite is not None: - _path_params['tenant-invite'] = tenant_invite + _path_params["tenant-invite"] = tenant_invite # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/tenants/{tenant}/invites/{tenant-invite}', + method="DELETE", + resource_path="/api/v1/tenants/{tenant}/invites/{tenant-invite}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -315,25 +341,36 @@ def _tenant_invite_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_invite_update( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], - update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], + update_tenant_invite_request: Annotated[ + UpdateTenantInviteRequest, Field(description="The tenant invite to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -370,7 +407,7 @@ async def tenant_invite_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -379,16 +416,15 @@ async def tenant_invite_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -396,20 +432,33 @@ async def tenant_invite_update( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_update_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], - update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], + update_tenant_invite_request: Annotated[ + UpdateTenantInviteRequest, Field(description="The tenant invite to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -446,7 +495,7 @@ async def tenant_invite_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -455,16 +504,15 @@ async def tenant_invite_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -472,20 +520,33 @@ async def tenant_invite_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_update_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - tenant_invite: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant invite id")], - update_tenant_invite_request: Annotated[UpdateTenantInviteRequest, Field(description="The tenant invite to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + tenant_invite: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant invite id", + ), + ], + update_tenant_invite_request: Annotated[ + UpdateTenantInviteRequest, Field(description="The tenant invite to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -522,7 +583,7 @@ async def tenant_invite_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_update_serialize( tenant=tenant, @@ -531,20 +592,18 @@ async def tenant_invite_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInvite", - '400': "APIErrors", + "200": "TenantInvite", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_update_serialize( self, tenant, @@ -558,8 +617,7 @@ def _tenant_invite_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -570,9 +628,9 @@ def _tenant_invite_update_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if tenant_invite is not None: - _path_params['tenant-invite'] = tenant_invite + _path_params["tenant-invite"] = tenant_invite # process the query parameters # process the header parameters # process the form parameters @@ -580,37 +638,27 @@ def _tenant_invite_update_serialize( if update_tenant_invite_request is not None: _body_params = update_tenant_invite_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/tenants/{tenant}/invites/{tenant-invite}', + method="PATCH", + resource_path="/api/v1/tenants/{tenant}/invites/{tenant-invite}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -620,24 +668,25 @@ def _tenant_invite_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def webhook_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -672,7 +721,7 @@ async def webhook_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -680,18 +729,17 @@ async def webhook_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerCreated", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerCreated", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -699,19 +747,22 @@ async def webhook_create( response_types_map=_response_types_map, ).data - @validate_call async def webhook_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -746,7 +797,7 @@ async def webhook_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -754,18 +805,17 @@ async def webhook_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerCreated", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerCreated", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -773,19 +823,22 @@ async def webhook_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def webhook_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], webhook_worker_create_request: Optional[WebhookWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -820,7 +873,7 @@ async def webhook_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_create_serialize( tenant=tenant, @@ -828,22 +881,20 @@ async def webhook_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerCreated", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerCreated", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _webhook_create_serialize( self, tenant, @@ -856,8 +907,7 @@ def _webhook_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -868,7 +918,7 @@ def _webhook_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -876,37 +926,27 @@ def _webhook_create_serialize( if webhook_worker_create_request is not None: _body_params = webhook_worker_create_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/webhook-workers', + method="POST", + resource_path="/api/v1/tenants/{tenant}/webhook-workers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -916,23 +956,24 @@ def _webhook_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def webhook_delete( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -965,25 +1006,24 @@ async def webhook_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -991,18 +1031,21 @@ async def webhook_delete( response_types_map=_response_types_map, ).data - @validate_call async def webhook_delete_with_http_info( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1035,25 +1078,24 @@ async def webhook_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1061,18 +1103,21 @@ async def webhook_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def webhook_delete_without_preload_content( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1105,29 +1150,27 @@ async def webhook_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_delete_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _webhook_delete_serialize( self, webhook, @@ -1139,8 +1182,7 @@ def _webhook_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1151,30 +1193,23 @@ def _webhook_delete_serialize( # process the path parameters if webhook is not None: - _path_params['webhook'] = webhook + _path_params["webhook"] = webhook # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/webhook-workers/{webhook}', + method="DELETE", + resource_path="/api/v1/webhook-workers/{webhook}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1184,23 +1219,24 @@ def _webhook_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def webhook_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1233,25 +1269,24 @@ async def webhook_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1259,18 +1294,21 @@ async def webhook_list( response_types_map=_response_types_map, ).data - @validate_call async def webhook_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1303,25 +1341,24 @@ async def webhook_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1329,18 +1366,21 @@ async def webhook_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def webhook_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1373,29 +1413,27 @@ async def webhook_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _webhook_list_serialize( self, tenant, @@ -1407,8 +1445,7 @@ def _webhook_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1419,30 +1456,23 @@ def _webhook_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/webhook-workers', + method="GET", + resource_path="/api/v1/tenants/{tenant}/webhook-workers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1452,23 +1482,24 @@ def _webhook_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def webhook_requests_list( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1501,25 +1532,24 @@ async def webhook_requests_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerRequestListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerRequestListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1527,18 +1557,21 @@ async def webhook_requests_list( response_types_map=_response_types_map, ).data - @validate_call async def webhook_requests_list_with_http_info( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1571,25 +1604,24 @@ async def webhook_requests_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerRequestListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerRequestListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1597,18 +1629,21 @@ async def webhook_requests_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def webhook_requests_list_without_preload_content( self, - webhook: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The webhook id")], + webhook: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The webhook id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1641,29 +1676,27 @@ async def webhook_requests_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._webhook_requests_list_serialize( webhook=webhook, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WebhookWorkerRequestListResponse", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "WebhookWorkerRequestListResponse", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _webhook_requests_list_serialize( self, webhook, @@ -1675,8 +1708,7 @@ def _webhook_requests_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1687,30 +1719,23 @@ def _webhook_requests_list_serialize( # process the path parameters if webhook is not None: - _path_params['webhook'] = webhook + _path_params["webhook"] = webhook # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/webhook-workers/{webhook}/requests', + method="GET", + resource_path="/api/v1/webhook-workers/{webhook}/requests", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1720,7 +1745,5 @@ def _webhook_requests_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/event_api.py b/hatchet_sdk/clients/rest/api/event_api.py index 0f6e5889..e7544196 100644 --- a/hatchet_sdk/clients/rest/api/event_api.py +++ b/hatchet_sdk/clients/rest/api/event_api.py @@ -12,25 +12,34 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr -from typing import List, Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( + BulkCreateEventRequest, +) +from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( + BulkCreateEventResponse, +) +from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection +from hatchet_sdk.clients.rest.models.event_order_by_direction import ( + EventOrderByDirection, +) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField +from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( + EventUpdateCancel200Response, +) from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus - -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -46,19 +55,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def event_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_event_request: Annotated[ + CreateEventRequest, Field(description="The event to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -93,7 +107,7 @@ async def event_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -101,18 +115,17 @@ async def event_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Event", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -120,19 +133,24 @@ async def event_create( response_types_map=_response_types_map, ).data - @validate_call async def event_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_event_request: Annotated[ + CreateEventRequest, Field(description="The event to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -167,7 +185,7 @@ async def event_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -175,18 +193,17 @@ async def event_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Event", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -194,19 +211,24 @@ async def event_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def event_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_event_request: Annotated[CreateEventRequest, Field(description="The event to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_event_request: Annotated[ + CreateEventRequest, Field(description="The event to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -241,7 +263,7 @@ async def event_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_create_serialize( tenant=tenant, @@ -249,22 +271,20 @@ async def event_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Event", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _event_create_serialize( self, tenant, @@ -277,8 +297,7 @@ def _event_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -289,7 +308,7 @@ def _event_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -297,37 +316,27 @@ def _event_create_serialize( if create_event_request is not None: _body_params = create_event_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/events', + method="POST", + resource_path="/api/v1/tenants/{tenant}/events", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -337,35 +346,41 @@ def _event_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def event_data_get( + async def event_create_bulk( self, - event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + bulk_create_event_request: Annotated[ + BulkCreateEventRequest, Field(description="The events to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventData: - """Get event data + ) -> BulkCreateEventResponse: + """Bulk Create events - Get the data for an event. + Bulk creates new events. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str + :param bulk_create_event_request: The events to create (required) + :type bulk_create_event_request: BulkCreateEventRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -386,24 +401,25 @@ async def event_data_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_create_bulk_serialize( + tenant=tenant, + bulk_create_event_request=bulk_create_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventData", - '400': "APIErrors", - '403': "APIErrors", + "200": "BulkCreateEventResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -411,30 +427,38 @@ async def event_data_get( response_types_map=_response_types_map, ).data - @validate_call - async def event_data_get_with_http_info( + async def event_create_bulk_with_http_info( self, - event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + bulk_create_event_request: Annotated[ + BulkCreateEventRequest, Field(description="The events to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventData]: - """Get event data + ) -> ApiResponse[BulkCreateEventResponse]: + """Bulk Create events - Get the data for an event. + Bulk creates new events. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str + :param bulk_create_event_request: The events to create (required) + :type bulk_create_event_request: BulkCreateEventRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -455,24 +479,25 @@ async def event_data_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_create_bulk_serialize( + tenant=tenant, + bulk_create_event_request=bulk_create_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventData", - '400': "APIErrors", - '403': "APIErrors", + "200": "BulkCreateEventResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -480,30 +505,38 @@ async def event_data_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def event_data_get_without_preload_content( + async def event_create_bulk_without_preload_content( self, - event: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The event id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + bulk_create_event_request: Annotated[ + BulkCreateEventRequest, Field(description="The events to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get event data + """Bulk Create events - Get the data for an event. + Bulk creates new events. - :param event: The event id (required) - :type event: str + :param tenant: The tenant id (required) + :type tenant: str + :param bulk_create_event_request: The events to create (required) + :type bulk_create_event_request: BulkCreateEventRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -524,31 +557,32 @@ async def event_data_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_data_get_serialize( - event=event, + _param = self._event_create_bulk_serialize( + tenant=tenant, + bulk_create_event_request=bulk_create_event_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventData", - '400': "APIErrors", - '403': "APIErrors", + "200": "BulkCreateEventResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _event_data_get_serialize( + def _event_create_bulk_serialize( self, - event, + tenant, + bulk_create_event_request, _request_auth, _content_type, _headers, @@ -557,8 +591,7 @@ def _event_data_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -568,31 +601,36 @@ def _event_data_get_serialize( _body_params: Optional[bytes] = None # process the path parameters - if event is not None: - _path_params['event'] = event + if tenant is not None: + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - + if bulk_create_event_request is not None: + _body_params = bulk_create_event_request # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/events/{event}/data', + method="POST", + resource_path="/api/v1/tenants/{tenant}/events/bulk", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -602,35 +640,36 @@ def _event_data_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def event_key_list( + async def event_data_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventKeyList: - """List event keys + ) -> EventData: + """Get event data - Lists all event keys for a tenant. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -651,24 +690,23 @@ async def event_key_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_key_list_serialize( - tenant=tenant, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventKeyList", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventData", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -676,30 +714,33 @@ async def event_key_list( response_types_map=_response_types_map, ).data - @validate_call - async def event_key_list_with_http_info( + async def event_data_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventKeyList]: - """List event keys + ) -> ApiResponse[EventData]: + """Get event data - Lists all event keys for a tenant. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -720,24 +761,23 @@ async def event_key_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_key_list_serialize( - tenant=tenant, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventKeyList", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventData", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -745,30 +785,33 @@ async def event_key_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def event_key_list_without_preload_content( + async def event_data_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List event keys + """Get event data - Lists all event keys for a tenant. + Get the data for an event. - :param tenant: The tenant id (required) - :type tenant: str + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -789,31 +832,29 @@ async def event_key_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_key_list_serialize( - tenant=tenant, + _param = self._event_data_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventKeyList", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventData", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _event_key_list_serialize( + def _event_data_get_serialize( self, - tenant, + event, _request_auth, _content_type, _headers, @@ -822,8 +863,7 @@ def _event_key_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -833,31 +873,24 @@ def _event_key_list_serialize( _body_params: Optional[bytes] = None # process the path parameters - if tenant is not None: - _path_params['tenant'] = tenant + if event is not None: + _path_params["event"] = event # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/events/keys', + method="GET", + resource_path="/api/v1/events/{event}/data", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -867,62 +900,36 @@ def _event_key_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def event_list( + async def event_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EventList: - """List events + ) -> Event: + """Get event data - Lists all events for a tenant. + Get an event. - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -943,33 +950,23 @@ async def event_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, + _param = self._event_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -977,57 +974,33 @@ async def event_list( response_types_map=_response_types_map, ).data - @validate_call - async def event_list_with_http_info( + async def event_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EventList]: - """List events + ) -> ApiResponse[Event]: + """Get event data - Lists all events for a tenant. + Get an event. - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1048,33 +1021,23 @@ async def event_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, + _param = self._event_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1082,57 +1045,33 @@ async def event_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def event_list_without_preload_content( + async def event_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - keys: Annotated[Optional[List[StrictStr]], Field(description="A list of keys to filter by")] = None, - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[EventOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[EventOrderByDirection], Field(description="The order direction")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + event: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The event id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List events + """Get event data - Lists all events for a tenant. + Get an event. - :param tenant: The tenant id (required) - :type tenant: str - :param offset: The number to skip - :type offset: int - :param limit: The number to limit by - :type limit: int - :param keys: A list of keys to filter by - :type keys: List[str] - :param workflows: A list of workflow IDs to filter by - :type workflows: List[str] - :param statuses: A list of workflow run statuses to filter by - :type statuses: List[WorkflowRunStatus] - :param search: The search query to filter for - :type search: str - :param order_by_field: What to order by - :type order_by_field: EventOrderByField - :param order_by_direction: The order direction - :type order_by_direction: EventOrderByDirection - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] + :param event: The event id (required) + :type event: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1153,40 +1092,747 @@ async def event_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._event_list_serialize( - tenant=tenant, - offset=offset, - limit=limit, - keys=keys, - workflows=workflows, - statuses=statuses, - search=search, - order_by_field=order_by_field, - order_by_direction=order_by_direction, - additional_metadata=additional_metadata, + _param = self._event_get_serialize( + event=event, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", + "200": "Event", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _event_list_serialize( + def _event_get_serialize( self, - tenant, + event, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if event is not None: + _path_params["event"] = event + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/events/{event}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def event_key_list( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventKeyList: + """List event keys + + Lists all event keys for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_key_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventKeyList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def event_key_list_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventKeyList]: + """List event keys + + Lists all event keys for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_key_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventKeyList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def event_key_list_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List event keys + + Lists all event keys for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_key_list_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventKeyList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _event_key_list_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/tenants/{tenant}/events/keys", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def event_list( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + event_ids: Annotated[ + Optional[ + List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] + ], + Field(description="A list of event ids to filter by"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventList: + """List events + + Lists all events for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param event_ids: A list of event ids to filter by + :type event_ids: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, + event_ids=event_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def event_list_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + event_ids: Annotated[ + Optional[ + List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] + ], + Field(description="A list of event ids to filter by"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventList]: + """List events + + Lists all events for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param event_ids: A list of event ids to filter by + :type event_ids: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, + event_ids=event_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def event_list_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + keys: Annotated[ + Optional[List[StrictStr]], Field(description="A list of keys to filter by") + ] = None, + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[EventOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[EventOrderByDirection], Field(description="The order direction") + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + event_ids: Annotated[ + Optional[ + List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] + ], + Field(description="A list of event ids to filter by"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List events + + Lists all events for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param keys: A list of keys to filter by + :type keys: List[str] + :param workflows: A list of workflow IDs to filter by + :type workflows: List[str] + :param statuses: A list of workflow run statuses to filter by + :type statuses: List[WorkflowRunStatus] + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: EventOrderByField + :param order_by_direction: The order direction + :type order_by_direction: EventOrderByDirection + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param event_ids: A list of event ids to filter by + :type event_ids: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + keys=keys, + workflows=workflows, + statuses=statuses, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + additional_metadata=additional_metadata, + event_ids=event_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _event_list_serialize( + self, + tenant, offset, limit, keys, @@ -1196,6 +1842,7 @@ def _event_list_serialize( order_by_field, order_by_direction, additional_metadata, + event_ids, _request_auth, _content_type, _headers, @@ -1205,10 +1852,11 @@ def _event_list_serialize( _host = None _collection_formats: Dict[str, str] = { - 'keys': 'multi', - 'workflows': 'multi', - 'statuses': 'multi', - 'additionalMetadata': 'multi', + "keys": "multi", + "workflows": "multi", + "statuses": "multi", + "additionalMetadata": "multi", + "eventIds": "multi", } _path_params: Dict[str, str] = {} @@ -1220,66 +1868,63 @@ def _event_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + if keys is not None: - - _query_params.append(('keys', keys)) - + + _query_params.append(("keys", keys)) + if workflows is not None: - - _query_params.append(('workflows', workflows)) - + + _query_params.append(("workflows", workflows)) + if statuses is not None: - - _query_params.append(('statuses', statuses)) - + + _query_params.append(("statuses", statuses)) + if search is not None: - - _query_params.append(('search', search)) - + + _query_params.append(("search", search)) + if order_by_field is not None: - - _query_params.append(('orderByField', order_by_field.value)) - + + _query_params.append(("orderByField", order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(('orderByDirection', order_by_direction.value)) - + + _query_params.append(("orderByDirection", order_by_direction.value)) + if additional_metadata is not None: - - _query_params.append(('additionalMetadata', additional_metadata)) - + + _query_params.append(("additionalMetadata", additional_metadata)) + + if event_ids is not None: + + _query_params.append(("eventIds", event_ids)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/events', + method="GET", + resource_path="/api/v1/tenants/{tenant}/events", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1289,24 +1934,321 @@ def _event_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, + ) + + @validate_call + async def event_update_cancel( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + cancel_event_request: Annotated[ + CancelEventRequest, Field(description="The event ids to replay") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventUpdateCancel200Response: + """Replay events + + Cancels all runs for a list of events. + + :param tenant: The tenant id (required) + :type tenant: str + :param cancel_event_request: The event ids to replay (required) + :type cancel_event_request: CancelEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_update_cancel_serialize( + tenant=tenant, + cancel_event_request=cancel_event_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def event_update_cancel_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + cancel_event_request: Annotated[ + CancelEventRequest, Field(description="The event ids to replay") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventUpdateCancel200Response]: + """Replay events + + Cancels all runs for a list of events. + + :param tenant: The tenant id (required) + :type tenant: str + :param cancel_event_request: The event ids to replay (required) + :type cancel_event_request: CancelEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_update_cancel_serialize( + tenant=tenant, + cancel_event_request=cancel_event_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def event_update_cancel_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + cancel_event_request: Annotated[ + CancelEventRequest, Field(description="The event ids to replay") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Replay events + + Cancels all runs for a list of events. + + :param tenant: The tenant id (required) + :type tenant: str + :param cancel_event_request: The event ids to replay (required) + :type cancel_event_request: CancelEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._event_update_cancel_serialize( + tenant=tenant, + cancel_event_request=cancel_event_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _event_update_cancel_serialize( + self, + tenant, + cancel_event_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if cancel_event_request is not None: + _body_params = cancel_event_request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + return self.api_client.param_serialize( + method="POST", + resource_path="/api/v1/tenants/{tenant}/events/cancel", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) @validate_call async def event_update_replay( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_event_request: Annotated[ + ReplayEventRequest, Field(description="The event ids to replay") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1341,7 +2283,7 @@ async def event_update_replay( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1349,18 +2291,17 @@ async def event_update_replay( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1368,19 +2309,24 @@ async def event_update_replay( response_types_map=_response_types_map, ).data - @validate_call async def event_update_replay_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_event_request: Annotated[ + ReplayEventRequest, Field(description="The event ids to replay") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1415,7 +2361,7 @@ async def event_update_replay_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1423,18 +2369,17 @@ async def event_update_replay_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1442,19 +2387,24 @@ async def event_update_replay_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def event_update_replay_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_event_request: Annotated[ReplayEventRequest, Field(description="The event ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_event_request: Annotated[ + ReplayEventRequest, Field(description="The event ids to replay") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1489,7 +2439,7 @@ async def event_update_replay_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._event_update_replay_serialize( tenant=tenant, @@ -1497,22 +2447,20 @@ async def event_update_replay_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EventList", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "EventList", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _event_update_replay_serialize( self, tenant, @@ -1525,8 +2473,7 @@ def _event_update_replay_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1537,7 +2484,7 @@ def _event_update_replay_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -1545,37 +2492,27 @@ def _event_update_replay_serialize( if replay_event_request is not None: _body_params = replay_event_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/events/replay', + method="POST", + resource_path="/api/v1/tenants/{tenant}/events/replay", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1585,7 +2522,5 @@ def _event_update_replay_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/github_api.py b/hatchet_sdk/clients/rest/api/github_api.py index 05b1aadc..121441df 100644 --- a/hatchet_sdk/clients/rest/api/github_api.py +++ b/hatchet_sdk/clients/rest/api/github_api.py @@ -12,11 +12,9 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized @@ -36,19 +34,27 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def sns_update( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event: Annotated[ + str, + Field( + min_length=1, strict=True, max_length=255, description="The event key" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -83,7 +89,7 @@ async def sns_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -91,18 +97,17 @@ async def sns_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -110,19 +115,27 @@ async def sns_update( response_types_map=_response_types_map, ).data - @validate_call async def sns_update_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event: Annotated[ + str, + Field( + min_length=1, strict=True, max_length=255, description="The event key" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -157,7 +170,7 @@ async def sns_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -165,18 +178,17 @@ async def sns_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -184,19 +196,27 @@ async def sns_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def sns_update_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event: Annotated[str, Field(min_length=1, strict=True, max_length=255, description="The event key")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event: Annotated[ + str, + Field( + min_length=1, strict=True, max_length=255, description="The event key" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -231,7 +251,7 @@ async def sns_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_update_serialize( tenant=tenant, @@ -239,22 +259,20 @@ async def sns_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _sns_update_serialize( self, tenant, @@ -267,8 +285,7 @@ def _sns_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -279,30 +296,25 @@ def _sns_update_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if event is not None: - _path_params['event'] = event + _path_params["event"] = event # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/sns/{tenant}/{event}', + method="POST", + resource_path="/api/v1/sns/{tenant}/{event}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -312,7 +324,5 @@ def _sns_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/healthcheck_api.py b/hatchet_sdk/clients/rest/api/healthcheck_api.py index 67dc9488..7eb18a36 100644 --- a/hatchet_sdk/clients/rest/api/healthcheck_api.py +++ b/hatchet_sdk/clients/rest/api/healthcheck_api.py @@ -12,10 +12,10 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse @@ -34,7 +34,6 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def liveness_get( self, @@ -42,9 +41,8 @@ async def liveness_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -75,22 +73,21 @@ async def liveness_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -98,7 +95,6 @@ async def liveness_get( response_types_map=_response_types_map, ).data - @validate_call async def liveness_get_with_http_info( self, @@ -106,9 +102,8 @@ async def liveness_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -139,22 +134,21 @@ async def liveness_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -162,7 +156,6 @@ async def liveness_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def liveness_get_without_preload_content( self, @@ -170,9 +163,8 @@ async def liveness_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -203,26 +195,24 @@ async def liveness_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._liveness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _liveness_get_serialize( self, _request_auth, @@ -233,8 +223,7 @@ def _liveness_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -249,16 +238,12 @@ def _liveness_get_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/live', + method="GET", + resource_path="/api/live", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -268,12 +253,9 @@ def _liveness_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def readiness_get( self, @@ -281,9 +263,8 @@ async def readiness_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -314,22 +295,21 @@ async def readiness_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -337,7 +317,6 @@ async def readiness_get( response_types_map=_response_types_map, ).data - @validate_call async def readiness_get_with_http_info( self, @@ -345,9 +324,8 @@ async def readiness_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -378,22 +356,21 @@ async def readiness_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -401,7 +378,6 @@ async def readiness_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def readiness_get_without_preload_content( self, @@ -409,9 +385,8 @@ async def readiness_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -442,26 +417,24 @@ async def readiness_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._readiness_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '500': None, + "200": None, + "500": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _readiness_get_serialize( self, _request_auth, @@ -472,8 +445,7 @@ def _readiness_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -488,16 +460,12 @@ def _readiness_get_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/ready', + method="GET", + resource_path="/api/ready", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -507,7 +475,5 @@ def _readiness_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/log_api.py b/hatchet_sdk/clients/rest/api/log_api.py index 9f28aab7..dd941af0 100644 --- a/hatchet_sdk/clients/rest/api/log_api.py +++ b/hatchet_sdk/clients/rest/api/log_api.py @@ -12,20 +12,19 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr -from typing import List, Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel -from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection -from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel +from hatchet_sdk.clients.rest.models.log_line_list import LogLineList +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( + LogLineOrderByDirection, +) +from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -41,24 +40,40 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def log_line_list( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + levels: Annotated[ + Optional[List[LogLineLevel]], + Field(description="A list of levels to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[LogLineOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[LogLineOrderByDirection], Field(description="The order direction") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -103,7 +118,7 @@ async def log_line_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -116,17 +131,16 @@ async def log_line_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -134,24 +148,40 @@ async def log_line_list( response_types_map=_response_types_map, ).data - @validate_call async def log_line_list_with_http_info( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + levels: Annotated[ + Optional[List[LogLineLevel]], + Field(description="A list of levels to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[LogLineOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[LogLineOrderByDirection], Field(description="The order direction") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -196,7 +226,7 @@ async def log_line_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -209,17 +239,16 @@ async def log_line_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -227,24 +256,40 @@ async def log_line_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def log_line_list_without_preload_content( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - levels: Annotated[Optional[List[LogLineLevel]], Field(description="A list of levels to filter by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[LogLineOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[LogLineOrderByDirection], Field(description="The order direction")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + levels: Annotated[ + Optional[List[LogLineLevel]], + Field(description="A list of levels to filter by"), + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[LogLineOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[LogLineOrderByDirection], Field(description="The order direction") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -289,7 +334,7 @@ async def log_line_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._log_line_list_serialize( step_run=step_run, @@ -302,21 +347,19 @@ async def log_line_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LogLineList", - '400': "APIErrors", - '403': "APIErrors", + "200": "LogLineList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _log_line_list_serialize( self, step_run, @@ -335,7 +378,7 @@ def _log_line_list_serialize( _host = None _collection_formats: Dict[str, str] = { - 'levels': 'multi', + "levels": "multi", } _path_params: Dict[str, str] = {} @@ -347,54 +390,47 @@ def _log_line_list_serialize( # process the path parameters if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + if levels is not None: - - _query_params.append(('levels', levels)) - + + _query_params.append(("levels", levels)) + if search is not None: - - _query_params.append(('search', search)) - + + _query_params.append(("search", search)) + if order_by_field is not None: - - _query_params.append(('orderByField', order_by_field.value)) - + + _query_params.append(("orderByField", order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(('orderByDirection', order_by_direction.value)) - + + _query_params.append(("orderByDirection", order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/step-runs/{step-run}/logs', + method="GET", + resource_path="/api/v1/step-runs/{step-run}/logs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -404,7 +440,5 @@ def _log_line_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/metadata_api.py b/hatchet_sdk/clients/rest/api/metadata_api.py index 10bbf1b8..44248e20 100644 --- a/hatchet_sdk/clients/rest/api/metadata_api.py +++ b/hatchet_sdk/clients/rest/api/metadata_api.py @@ -12,17 +12,16 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from typing import List +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.models.api_errors import APIErrors from hatchet_sdk.clients.rest.models.api_meta import APIMeta from hatchet_sdk.clients.rest.models.api_meta_integration import APIMetaIntegration - -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -38,7 +37,6 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def cloud_metadata_get( self, @@ -46,9 +44,8 @@ async def cloud_metadata_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -79,22 +76,21 @@ async def cloud_metadata_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIErrors", - '400': "APIErrors", + "200": "APIErrors", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -102,7 +98,6 @@ async def cloud_metadata_get( response_types_map=_response_types_map, ).data - @validate_call async def cloud_metadata_get_with_http_info( self, @@ -110,9 +105,8 @@ async def cloud_metadata_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -143,22 +137,21 @@ async def cloud_metadata_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIErrors", - '400': "APIErrors", + "200": "APIErrors", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -166,7 +159,6 @@ async def cloud_metadata_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def cloud_metadata_get_without_preload_content( self, @@ -174,9 +166,8 @@ async def cloud_metadata_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -207,26 +198,24 @@ async def cloud_metadata_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._cloud_metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIErrors", - '400': "APIErrors", + "200": "APIErrors", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _cloud_metadata_get_serialize( self, _request_auth, @@ -237,8 +226,7 @@ def _cloud_metadata_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -253,22 +241,17 @@ def _cloud_metadata_get_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/cloud/metadata', + method="GET", + resource_path="/api/v1/cloud/metadata", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -278,12 +261,9 @@ def _cloud_metadata_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def metadata_get( self, @@ -291,9 +271,8 @@ async def metadata_get( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -324,22 +303,21 @@ async def metadata_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIMeta", - '400': "APIErrors", + "200": "APIMeta", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -347,7 +325,6 @@ async def metadata_get( response_types_map=_response_types_map, ).data - @validate_call async def metadata_get_with_http_info( self, @@ -355,9 +332,8 @@ async def metadata_get_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -388,22 +364,21 @@ async def metadata_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIMeta", - '400': "APIErrors", + "200": "APIMeta", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -411,7 +386,6 @@ async def metadata_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metadata_get_without_preload_content( self, @@ -419,9 +393,8 @@ async def metadata_get_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -452,26 +425,24 @@ async def metadata_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_get_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "APIMeta", - '400': "APIErrors", + "200": "APIMeta", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metadata_get_serialize( self, _request_auth, @@ -482,8 +453,7 @@ def _metadata_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -498,22 +468,17 @@ def _metadata_get_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/meta', + method="GET", + resource_path="/api/v1/meta", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -523,12 +488,9 @@ def _metadata_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def metadata_list_integrations( self, @@ -536,9 +498,8 @@ async def metadata_list_integrations( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -569,22 +530,21 @@ async def metadata_list_integrations( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[APIMetaIntegration]", - '400': "APIErrors", + "200": "List[APIMetaIntegration]", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -592,7 +552,6 @@ async def metadata_list_integrations( response_types_map=_response_types_map, ).data - @validate_call async def metadata_list_integrations_with_http_info( self, @@ -600,9 +559,8 @@ async def metadata_list_integrations_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -633,22 +591,21 @@ async def metadata_list_integrations_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[APIMetaIntegration]", - '400': "APIErrors", + "200": "List[APIMetaIntegration]", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -656,7 +613,6 @@ async def metadata_list_integrations_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def metadata_list_integrations_without_preload_content( self, @@ -664,9 +620,8 @@ async def metadata_list_integrations_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -697,26 +652,24 @@ async def metadata_list_integrations_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._metadata_list_integrations_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[APIMetaIntegration]", - '400': "APIErrors", + "200": "List[APIMetaIntegration]", + "400": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _metadata_list_integrations_serialize( self, _request_auth, @@ -727,8 +680,7 @@ def _metadata_list_integrations_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -743,24 +695,17 @@ def _metadata_list_integrations_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/meta/integrations', + method="GET", + resource_path="/api/v1/meta/integrations", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -770,7 +715,5 @@ def _metadata_list_integrations_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/rate_limits_api.py b/hatchet_sdk/clients/rest/api/rate_limits_api.py new file mode 100644 index 00000000..7022fd93 --- /dev/null +++ b/hatchet_sdk/clients/rest/api/rate_limits_api.py @@ -0,0 +1,391 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList +from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import RateLimitOrderByDirection +from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import RateLimitOrderByField + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.rest import RESTResponseType + + +class RateLimitsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def rate_limit_list( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RateLimitList: + """List rate limits + + Lists all rate limits for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: RateLimitOrderByField + :param order_by_direction: The order direction + :type order_by_direction: RateLimitOrderByDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rate_limit_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RateLimitList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def rate_limit_list_with_http_info( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RateLimitList]: + """List rate limits + + Lists all rate limits for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: RateLimitOrderByField + :param order_by_direction: The order direction + :type order_by_direction: RateLimitOrderByDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rate_limit_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RateLimitList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def rate_limit_list_without_preload_content( + self, + tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, + order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, + order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List rate limits + + Lists all rate limits for a tenant. + + :param tenant: The tenant id (required) + :type tenant: str + :param offset: The number to skip + :type offset: int + :param limit: The number to limit by + :type limit: int + :param search: The search query to filter for + :type search: str + :param order_by_field: What to order by + :type order_by_field: RateLimitOrderByField + :param order_by_direction: The order direction + :type order_by_direction: RateLimitOrderByDirection + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rate_limit_list_serialize( + tenant=tenant, + offset=offset, + limit=limit, + search=search, + order_by_field=order_by_field, + order_by_direction=order_by_direction, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RateLimitList", + '400': "APIErrors", + '403': "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rate_limit_list_serialize( + self, + tenant, + offset, + limit, + search, + order_by_field, + order_by_direction, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params['tenant'] = tenant + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if search is not None: + + _query_params.append(('search', search)) + + if order_by_field is not None: + + _query_params.append(('orderByField', order_by_field.value)) + + if order_by_direction is not None: + + _query_params.append(('orderByDirection', order_by_direction.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'cookieAuth', + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/tenants/{tenant}/rate-limits', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/hatchet_sdk/clients/rest/api/slack_api.py b/hatchet_sdk/clients/rest/api/slack_api.py index d753a5b0..6a0a0e43 100644 --- a/hatchet_sdk/clients/rest/api/slack_api.py +++ b/hatchet_sdk/clients/rest/api/slack_api.py @@ -12,16 +12,14 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -37,18 +35,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def slack_webhook_delete( self, - slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], + slack: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The Slack webhook id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -81,25 +85,24 @@ async def slack_webhook_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -107,18 +110,24 @@ async def slack_webhook_delete( response_types_map=_response_types_map, ).data - @validate_call async def slack_webhook_delete_with_http_info( self, - slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], + slack: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The Slack webhook id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -151,25 +160,24 @@ async def slack_webhook_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -177,18 +185,24 @@ async def slack_webhook_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def slack_webhook_delete_without_preload_content( self, - slack: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The Slack webhook id")], + slack: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The Slack webhook id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -221,29 +235,27 @@ async def slack_webhook_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_delete_serialize( slack=slack, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _slack_webhook_delete_serialize( self, slack, @@ -255,8 +267,7 @@ def _slack_webhook_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -267,30 +278,23 @@ def _slack_webhook_delete_serialize( # process the path parameters if slack is not None: - _path_params['slack'] = slack + _path_params["slack"] = slack # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/slack/{slack}', + method="DELETE", + resource_path="/api/v1/slack/{slack}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -300,23 +304,24 @@ def _slack_webhook_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def slack_webhook_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -349,25 +354,24 @@ async def slack_webhook_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSlackWebhooks", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSlackWebhooks", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -375,18 +379,21 @@ async def slack_webhook_list( response_types_map=_response_types_map, ).data - @validate_call async def slack_webhook_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -419,25 +426,24 @@ async def slack_webhook_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSlackWebhooks", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSlackWebhooks", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -445,18 +451,21 @@ async def slack_webhook_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def slack_webhook_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -489,29 +498,27 @@ async def slack_webhook_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._slack_webhook_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSlackWebhooks", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSlackWebhooks", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _slack_webhook_list_serialize( self, tenant, @@ -523,8 +530,7 @@ def _slack_webhook_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -535,30 +541,23 @@ def _slack_webhook_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/slack', + method="GET", + resource_path="/api/v1/tenants/{tenant}/slack", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -568,7 +567,5 @@ def _slack_webhook_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/sns_api.py b/hatchet_sdk/clients/rest/api/sns_api.py index c9b16e6b..f3214c03 100644 --- a/hatchet_sdk/clients/rest/api/sns_api.py +++ b/hatchet_sdk/clients/rest/api/sns_api.py @@ -12,19 +12,18 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest -from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( + CreateSNSIntegrationRequest, +) +from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,19 +39,22 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def sns_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -87,7 +89,7 @@ async def sns_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -95,18 +97,17 @@ async def sns_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "SNSIntegration", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "201": "SNSIntegration", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -114,19 +115,22 @@ async def sns_create( response_types_map=_response_types_map, ).data - @validate_call async def sns_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -161,7 +165,7 @@ async def sns_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -169,18 +173,17 @@ async def sns_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "SNSIntegration", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "201": "SNSIntegration", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -188,19 +191,22 @@ async def sns_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def sns_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], create_sns_integration_request: Optional[CreateSNSIntegrationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -235,7 +241,7 @@ async def sns_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_create_serialize( tenant=tenant, @@ -243,22 +249,20 @@ async def sns_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "SNSIntegration", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "201": "SNSIntegration", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _sns_create_serialize( self, tenant, @@ -271,8 +275,7 @@ def _sns_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -283,7 +286,7 @@ def _sns_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -291,37 +294,27 @@ def _sns_create_serialize( if create_sns_integration_request is not None: _body_params = create_sns_integration_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/sns', + method="POST", + resource_path="/api/v1/tenants/{tenant}/sns", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -331,23 +324,27 @@ def _sns_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def sns_delete( self, - sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], + sns: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The SNS integration id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -380,25 +377,24 @@ async def sns_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -406,18 +402,24 @@ async def sns_delete( response_types_map=_response_types_map, ).data - @validate_call async def sns_delete_with_http_info( self, - sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], + sns: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The SNS integration id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -450,25 +452,24 @@ async def sns_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -476,18 +477,24 @@ async def sns_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def sns_delete_without_preload_content( self, - sns: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The SNS integration id")], + sns: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The SNS integration id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -520,29 +527,27 @@ async def sns_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_delete_serialize( sns=sns, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "204": None, + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _sns_delete_serialize( self, sns, @@ -554,8 +559,7 @@ def _sns_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -566,30 +570,23 @@ def _sns_delete_serialize( # process the path parameters if sns is not None: - _path_params['sns'] = sns + _path_params["sns"] = sns # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/sns/{sns}', + method="DELETE", + resource_path="/api/v1/sns/{sns}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -599,23 +596,24 @@ def _sns_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def sns_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -648,25 +646,24 @@ async def sns_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSNSIntegrations", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSNSIntegrations", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -674,18 +671,21 @@ async def sns_list( response_types_map=_response_types_map, ).data - @validate_call async def sns_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -718,25 +718,24 @@ async def sns_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSNSIntegrations", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSNSIntegrations", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -744,18 +743,21 @@ async def sns_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def sns_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -788,29 +790,27 @@ async def sns_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._sns_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ListSNSIntegrations", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "ListSNSIntegrations", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _sns_list_serialize( self, tenant, @@ -822,8 +822,7 @@ def _sns_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -834,30 +833,23 @@ def _sns_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/sns', + method="GET", + resource_path="/api/v1/tenants/{tenant}/sns", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -867,7 +859,5 @@ def _sns_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/step_run_api.py b/hatchet_sdk/clients/rest/api/step_run_api.py index 4e7e924e..5c60f199 100644 --- a/hatchet_sdk/clients/rest/api/step_run_api.py +++ b/hatchet_sdk/clients/rest/api/step_run_api.py @@ -12,20 +12,17 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictInt -from typing import Any, Dict, Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive_list import StepRunArchiveList from hatchet_sdk.clients.rest.models.step_run_event_list import StepRunEventList - -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -41,19 +38,27 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def step_run_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -88,7 +93,7 @@ async def step_run_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -96,18 +101,17 @@ async def step_run_get( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -115,19 +119,27 @@ async def step_run_get( response_types_map=_response_types_map, ).data - @validate_call async def step_run_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -162,7 +174,7 @@ async def step_run_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -170,18 +182,17 @@ async def step_run_get_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -189,19 +200,27 @@ async def step_run_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -236,7 +255,7 @@ async def step_run_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_serialize( tenant=tenant, @@ -244,22 +263,20 @@ async def step_run_get_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_get_serialize( self, tenant, @@ -272,8 +289,7 @@ def _step_run_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -284,32 +300,25 @@ def _step_run_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}', + method="GET", + resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -319,24 +328,30 @@ def _step_run_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def step_run_get_schema( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -371,7 +386,7 @@ async def step_run_get_schema( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -379,18 +394,17 @@ async def step_run_get_schema( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "object", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -398,19 +412,27 @@ async def step_run_get_schema( response_types_map=_response_types_map, ).data - @validate_call async def step_run_get_schema_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -445,7 +467,7 @@ async def step_run_get_schema_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -453,18 +475,17 @@ async def step_run_get_schema_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "object", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -472,19 +493,27 @@ async def step_run_get_schema_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_get_schema_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -519,7 +548,7 @@ async def step_run_get_schema_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_get_schema_serialize( tenant=tenant, @@ -527,22 +556,20 @@ async def step_run_get_schema_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "object", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_get_schema_serialize( self, tenant, @@ -555,8 +582,7 @@ def _step_run_get_schema_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -567,32 +593,25 @@ def _step_run_get_schema_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/schema', + method="GET", + resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/schema", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -602,25 +621,30 @@ def _step_run_get_schema_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def step_run_list_archives( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -657,7 +681,7 @@ async def step_run_list_archives( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -666,18 +690,17 @@ async def step_run_list_archives( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunArchiveList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunArchiveList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -685,20 +708,27 @@ async def step_run_list_archives( response_types_map=_response_types_map, ).data - @validate_call async def step_run_list_archives_with_http_info( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -735,7 +765,7 @@ async def step_run_list_archives_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -744,18 +774,17 @@ async def step_run_list_archives_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunArchiveList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunArchiveList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -763,20 +792,27 @@ async def step_run_list_archives_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_list_archives_without_preload_content( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -813,7 +849,7 @@ async def step_run_list_archives_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_archives_serialize( step_run=step_run, @@ -822,22 +858,20 @@ async def step_run_list_archives_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunArchiveList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunArchiveList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_list_archives_serialize( self, step_run, @@ -851,8 +885,7 @@ def _step_run_list_archives_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -863,38 +896,31 @@ def _step_run_list_archives_serialize( # process the path parameters if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/step-runs/{step-run}/archives', + method="GET", + resource_path="/api/v1/step-runs/{step-run}/archives", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -904,25 +930,30 @@ def _step_run_list_archives_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def step_run_list_events( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -959,7 +990,7 @@ async def step_run_list_events( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -968,18 +999,17 @@ async def step_run_list_events( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunEventList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -987,20 +1017,27 @@ async def step_run_list_events( response_types_map=_response_types_map, ).data - @validate_call async def step_run_list_events_with_http_info( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1037,7 +1074,7 @@ async def step_run_list_events_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -1046,18 +1083,17 @@ async def step_run_list_events_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunEventList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1065,20 +1101,27 @@ async def step_run_list_events_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_list_events_without_preload_content( self, - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1115,7 +1158,7 @@ async def step_run_list_events_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_list_events_serialize( step_run=step_run, @@ -1124,22 +1167,20 @@ async def step_run_list_events_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRunEventList", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_list_events_serialize( self, step_run, @@ -1153,8 +1194,7 @@ def _step_run_list_events_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1165,38 +1205,31 @@ def _step_run_list_events_serialize( # process the path parameters if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/step-runs/{step-run}/events', + method="GET", + resource_path="/api/v1/step-runs/{step-run}/events", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1206,24 +1239,30 @@ def _step_run_list_events_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def step_run_update_cancel( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1258,7 +1297,7 @@ async def step_run_update_cancel( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1266,17 +1305,16 @@ async def step_run_update_cancel( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1284,19 +1322,27 @@ async def step_run_update_cancel( response_types_map=_response_types_map, ).data - @validate_call async def step_run_update_cancel_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1331,7 +1377,7 @@ async def step_run_update_cancel_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1339,17 +1385,16 @@ async def step_run_update_cancel_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1357,19 +1402,27 @@ async def step_run_update_cancel_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_update_cancel_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1404,7 +1457,7 @@ async def step_run_update_cancel_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_cancel_serialize( tenant=tenant, @@ -1412,21 +1465,19 @@ async def step_run_update_cancel_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_update_cancel_serialize( self, tenant, @@ -1439,8 +1490,7 @@ def _step_run_update_cancel_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1451,32 +1501,25 @@ def _step_run_update_cancel_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel', + method="POST", + resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1486,25 +1529,33 @@ def _step_run_update_cancel_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def step_run_update_rerun( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + rerun_step_run_request: Annotated[ + RerunStepRunRequest, Field(description="The input to the rerun") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1541,7 +1592,7 @@ async def step_run_update_rerun( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1550,17 +1601,16 @@ async def step_run_update_rerun( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1568,20 +1618,30 @@ async def step_run_update_rerun( response_types_map=_response_types_map, ).data - @validate_call async def step_run_update_rerun_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + rerun_step_run_request: Annotated[ + RerunStepRunRequest, Field(description="The input to the rerun") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1618,7 +1678,7 @@ async def step_run_update_rerun_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1627,17 +1687,16 @@ async def step_run_update_rerun_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1645,20 +1704,30 @@ async def step_run_update_rerun_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def step_run_update_rerun_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - step_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The step run id")], - rerun_step_run_request: Annotated[RerunStepRunRequest, Field(description="The input to the rerun")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + step_run: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The step run id" + ), + ], + rerun_step_run_request: Annotated[ + RerunStepRunRequest, Field(description="The input to the rerun") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1695,7 +1764,7 @@ async def step_run_update_rerun_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._step_run_update_rerun_serialize( tenant=tenant, @@ -1704,21 +1773,19 @@ async def step_run_update_rerun_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StepRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "StepRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _step_run_update_rerun_serialize( self, tenant, @@ -1732,8 +1799,7 @@ def _step_run_update_rerun_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1744,9 +1810,9 @@ def _step_run_update_rerun_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if step_run is not None: - _path_params['step-run'] = step_run + _path_params["step-run"] = step_run # process the query parameters # process the header parameters # process the form parameters @@ -1754,37 +1820,27 @@ def _step_run_update_rerun_serialize( if rerun_step_run_request is not None: _body_params = rerun_step_run_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/step-runs/{step-run}/rerun', + method="POST", + resource_path="/api/v1/tenants/{tenant}/step-runs/{step-run}/rerun", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1794,7 +1850,330 @@ def _step_run_update_rerun_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) + @validate_call + async def workflow_run_list_step_run_events( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + last_id: Annotated[ + Optional[StrictInt], Field(description="Last ID of the last event") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StepRunEventList: + """List events for all step runs for a workflow run + + List events for all step runs for a workflow run + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param last_id: Last ID of the last event + :type last_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_list_step_run_events_serialize( + tenant=tenant, + workflow_run=workflow_run, + last_id=last_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def workflow_run_list_step_run_events_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + last_id: Annotated[ + Optional[StrictInt], Field(description="Last ID of the last event") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StepRunEventList]: + """List events for all step runs for a workflow run + + List events for all step runs for a workflow run + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param last_id: Last ID of the last event + :type last_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_list_step_run_events_serialize( + tenant=tenant, + workflow_run=workflow_run, + last_id=last_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def workflow_run_list_step_run_events_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + last_id: Annotated[ + Optional[StrictInt], Field(description="Last ID of the last event") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List events for all step runs for a workflow run + + List events for all step runs for a workflow run + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param last_id: Last ID of the last event + :type last_id: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_list_step_run_events_serialize( + tenant=tenant, + workflow_run=workflow_run, + last_id=last_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "StepRunEventList", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _workflow_run_list_step_run_events_serialize( + self, + tenant, + workflow_run, + last_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + if workflow_run is not None: + _path_params["workflow-run"] = workflow_run + # process the query parameters + if last_id is not None: + + _query_params.append(("lastId", last_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/step-run-events", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/hatchet_sdk/clients/rest/api/tenant_api.py b/hatchet_sdk/clients/rest/api/tenant_api.py index 03eb4d0b..16fe9310 100644 --- a/hatchet_sdk/clients/rest/api/tenant_api.py +++ b/hatchet_sdk/clients/rest/api/tenant_api.py @@ -12,32 +12,44 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( + CreateTenantAlertEmailGroupRequest, +) +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( + CreateTenantInviteRequest, +) from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( + TenantAlertEmailGroup, +) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( + TenantAlertEmailGroupList, +) +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( + TenantAlertingSettings, +) from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_member import TenantMember from hatchet_sdk.clients.rest.models.tenant_member_list import TenantMemberList from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest +from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import ( + TenantStepRunQueueMetrics, +) +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( + UpdateTenantAlertEmailGroupRequest, +) from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest - -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -53,19 +65,25 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def alert_email_group_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_alert_email_group_request: Annotated[ + CreateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to create"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -100,7 +118,7 @@ async def alert_email_group_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -108,17 +126,16 @@ async def alert_email_group_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "201": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -126,19 +143,25 @@ async def alert_email_group_create( response_types_map=_response_types_map, ).data - @validate_call async def alert_email_group_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_alert_email_group_request: Annotated[ + CreateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to create"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -173,7 +196,7 @@ async def alert_email_group_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -181,17 +204,16 @@ async def alert_email_group_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "201": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -199,19 +221,25 @@ async def alert_email_group_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def alert_email_group_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_alert_email_group_request: Annotated[CreateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_alert_email_group_request: Annotated[ + CreateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to create"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -246,7 +274,7 @@ async def alert_email_group_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_create_serialize( tenant=tenant, @@ -254,21 +282,19 @@ async def alert_email_group_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "201": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _alert_email_group_create_serialize( self, tenant, @@ -281,8 +307,7 @@ def _alert_email_group_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -293,7 +318,7 @@ def _alert_email_group_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -301,37 +326,27 @@ def _alert_email_group_create_serialize( if create_tenant_alert_email_group_request is not None: _body_params = create_tenant_alert_email_group_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/alerting-email-groups', + method="POST", + resource_path="/api/v1/tenants/{tenant}/alerting-email-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -341,23 +356,27 @@ def _alert_email_group_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def alert_email_group_delete( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -390,24 +409,23 @@ async def alert_email_group_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIError", + "204": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -415,18 +433,24 @@ async def alert_email_group_delete( response_types_map=_response_types_map, ).data - @validate_call async def alert_email_group_delete_with_http_info( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -459,24 +483,23 @@ async def alert_email_group_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIError", + "204": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -484,18 +507,24 @@ async def alert_email_group_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def alert_email_group_delete_without_preload_content( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -528,28 +557,26 @@ async def alert_email_group_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_delete_serialize( alert_email_group=alert_email_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIError", + "204": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _alert_email_group_delete_serialize( self, alert_email_group, @@ -561,8 +588,7 @@ def _alert_email_group_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -573,30 +599,23 @@ def _alert_email_group_delete_serialize( # process the path parameters if alert_email_group is not None: - _path_params['alert-email-group'] = alert_email_group + _path_params["alert-email-group"] = alert_email_group # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/alerting-email-groups/{alert-email-group}', + method="DELETE", + resource_path="/api/v1/alerting-email-groups/{alert-email-group}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -606,23 +625,24 @@ def _alert_email_group_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def alert_email_group_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -655,24 +675,23 @@ async def alert_email_group_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroupList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroupList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -680,18 +699,21 @@ async def alert_email_group_list( response_types_map=_response_types_map, ).data - @validate_call async def alert_email_group_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -724,24 +746,23 @@ async def alert_email_group_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroupList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroupList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -749,18 +770,21 @@ async def alert_email_group_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def alert_email_group_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -793,28 +817,26 @@ async def alert_email_group_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroupList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroupList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _alert_email_group_list_serialize( self, tenant, @@ -826,8 +848,7 @@ def _alert_email_group_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -838,30 +859,23 @@ def _alert_email_group_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/alerting-email-groups', + method="GET", + resource_path="/api/v1/tenants/{tenant}/alerting-email-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -871,24 +885,31 @@ def _alert_email_group_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def alert_email_group_update( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], - update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], + update_tenant_alert_email_group_request: Annotated[ + UpdateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to update"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -923,7 +944,7 @@ async def alert_email_group_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -931,17 +952,16 @@ async def alert_email_group_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -949,19 +969,28 @@ async def alert_email_group_update( response_types_map=_response_types_map, ).data - @validate_call async def alert_email_group_update_with_http_info( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], - update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], + update_tenant_alert_email_group_request: Annotated[ + UpdateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to update"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -996,7 +1025,7 @@ async def alert_email_group_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -1004,17 +1033,16 @@ async def alert_email_group_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1022,19 +1050,28 @@ async def alert_email_group_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def alert_email_group_update_without_preload_content( self, - alert_email_group: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant alert email group id")], - update_tenant_alert_email_group_request: Annotated[UpdateTenantAlertEmailGroupRequest, Field(description="The tenant alert email group to update")], + alert_email_group: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant alert email group id", + ), + ], + update_tenant_alert_email_group_request: Annotated[ + UpdateTenantAlertEmailGroupRequest, + Field(description="The tenant alert email group to update"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1069,7 +1106,7 @@ async def alert_email_group_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._alert_email_group_update_serialize( alert_email_group=alert_email_group, @@ -1077,21 +1114,19 @@ async def alert_email_group_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertEmailGroup", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertEmailGroup", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _alert_email_group_update_serialize( self, alert_email_group, @@ -1104,8 +1139,7 @@ def _alert_email_group_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1116,7 +1150,7 @@ def _alert_email_group_update_serialize( # process the path parameters if alert_email_group is not None: - _path_params['alert-email-group'] = alert_email_group + _path_params["alert-email-group"] = alert_email_group # process the query parameters # process the header parameters # process the form parameters @@ -1124,37 +1158,27 @@ def _alert_email_group_update_serialize( if update_tenant_alert_email_group_request is not None: _body_params = update_tenant_alert_email_group_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/alerting-email-groups/{alert-email-group}', + method="PATCH", + resource_path="/api/v1/alerting-email-groups/{alert-email-group}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1164,23 +1188,24 @@ def _alert_email_group_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_alerting_settings_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1213,24 +1238,23 @@ async def tenant_alerting_settings_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertingSettings", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertingSettings", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1238,18 +1262,21 @@ async def tenant_alerting_settings_get( response_types_map=_response_types_map, ).data - @validate_call async def tenant_alerting_settings_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1282,24 +1309,23 @@ async def tenant_alerting_settings_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertingSettings", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertingSettings", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1307,18 +1333,21 @@ async def tenant_alerting_settings_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_alerting_settings_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1351,28 +1380,26 @@ async def tenant_alerting_settings_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_alerting_settings_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantAlertingSettings", - '400': "APIErrors", - '403': "APIError", + "200": "TenantAlertingSettings", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_alerting_settings_get_serialize( self, tenant, @@ -1384,8 +1411,7 @@ def _tenant_alerting_settings_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1396,30 +1422,23 @@ def _tenant_alerting_settings_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/alerting/settings', + method="GET", + resource_path="/api/v1/tenants/{tenant}/alerting/settings", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1429,23 +1448,21 @@ def _tenant_alerting_settings_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_create( self, - create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], + create_tenant_request: Annotated[ + CreateTenantRequest, Field(description="The tenant to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1478,24 +1495,23 @@ async def tenant_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1503,18 +1519,18 @@ async def tenant_create( response_types_map=_response_types_map, ).data - @validate_call async def tenant_create_with_http_info( self, - create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], + create_tenant_request: Annotated[ + CreateTenantRequest, Field(description="The tenant to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1547,24 +1563,23 @@ async def tenant_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1572,18 +1587,18 @@ async def tenant_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_create_without_preload_content( self, - create_tenant_request: Annotated[CreateTenantRequest, Field(description="The tenant to create")], + create_tenant_request: Annotated[ + CreateTenantRequest, Field(description="The tenant to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1616,28 +1631,26 @@ async def tenant_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_create_serialize( create_tenant_request=create_tenant_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_create_serialize( self, create_tenant_request, @@ -1649,8 +1662,7 @@ def _tenant_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1667,37 +1679,27 @@ def _tenant_create_serialize( if create_tenant_request is not None: _body_params = create_tenant_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants', + method="POST", + resource_path="/api/v1/tenants", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1707,11 +1709,271 @@ def _tenant_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, + ) + + @validate_call + async def tenant_get_step_run_queue_metrics( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TenantStepRunQueueMetrics: + """Get step run metrics + + Get the queue metrics for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_get_step_run_queue_metrics_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TenantStepRunQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def tenant_get_step_run_queue_metrics_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TenantStepRunQueueMetrics]: + """Get step run metrics + + Get the queue metrics for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_get_step_run_queue_metrics_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TenantStepRunQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def tenant_get_step_run_queue_metrics_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get step run metrics + + Get the queue metrics for the tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._tenant_get_step_run_queue_metrics_serialize( + tenant=tenant, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) + _response_types_map: Dict[str, Optional[str]] = { + "200": "TenantStepRunQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _tenant_get_step_run_queue_metrics_serialize( + self, + tenant, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/tenants/{tenant}/step-run-queue-metrics", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) @validate_call async def tenant_invite_accept( @@ -1721,9 +1983,8 @@ async def tenant_invite_accept( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1756,24 +2017,23 @@ async def tenant_invite_accept( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1781,7 +2041,6 @@ async def tenant_invite_accept( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_accept_with_http_info( self, @@ -1790,9 +2049,8 @@ async def tenant_invite_accept_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1825,24 +2083,23 @@ async def tenant_invite_accept_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1850,7 +2107,6 @@ async def tenant_invite_accept_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_accept_without_preload_content( self, @@ -1859,9 +2115,8 @@ async def tenant_invite_accept_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1894,28 +2149,26 @@ async def tenant_invite_accept_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_accept_serialize( accept_invite_request=accept_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_accept_serialize( self, accept_invite_request, @@ -1927,8 +2180,7 @@ def _tenant_invite_accept_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1945,37 +2197,27 @@ def _tenant_invite_accept_serialize( if accept_invite_request is not None: _body_params = accept_invite_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/invites/accept', + method="POST", + resource_path="/api/v1/users/invites/accept", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1985,24 +2227,27 @@ def _tenant_invite_accept_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_invite_create( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_invite_request: Annotated[ + CreateTenantInviteRequest, Field(description="The tenant invite to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2037,7 +2282,7 @@ async def tenant_invite_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2045,17 +2290,16 @@ async def tenant_invite_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantInvite", - '400': "APIErrors", - '403': "APIError", + "201": "TenantInvite", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2063,19 +2307,24 @@ async def tenant_invite_create( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_create_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_invite_request: Annotated[ + CreateTenantInviteRequest, Field(description="The tenant invite to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2110,7 +2359,7 @@ async def tenant_invite_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2118,17 +2367,16 @@ async def tenant_invite_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantInvite", - '400': "APIErrors", - '403': "APIError", + "201": "TenantInvite", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2136,19 +2384,24 @@ async def tenant_invite_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_create_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - create_tenant_invite_request: Annotated[CreateTenantInviteRequest, Field(description="The tenant invite to create")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + create_tenant_invite_request: Annotated[ + CreateTenantInviteRequest, Field(description="The tenant invite to create") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2183,7 +2436,7 @@ async def tenant_invite_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_create_serialize( tenant=tenant, @@ -2191,21 +2444,19 @@ async def tenant_invite_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '201': "TenantInvite", - '400': "APIErrors", - '403': "APIError", + "201": "TenantInvite", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_create_serialize( self, tenant, @@ -2218,8 +2469,7 @@ def _tenant_invite_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2230,7 +2480,7 @@ def _tenant_invite_create_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -2238,37 +2488,27 @@ def _tenant_invite_create_serialize( if create_tenant_invite_request is not None: _body_params = create_tenant_invite_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/invites', + method="POST", + resource_path="/api/v1/tenants/{tenant}/invites", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2278,23 +2518,24 @@ def _tenant_invite_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_invite_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2327,24 +2568,23 @@ async def tenant_invite_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2352,18 +2592,21 @@ async def tenant_invite_list( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2396,24 +2639,23 @@ async def tenant_invite_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2421,18 +2663,21 @@ async def tenant_invite_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2465,28 +2710,26 @@ async def tenant_invite_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_list_serialize( self, tenant, @@ -2498,8 +2741,7 @@ def _tenant_invite_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2510,30 +2752,23 @@ def _tenant_invite_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/invites', + method="GET", + resource_path="/api/v1/tenants/{tenant}/invites", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2543,12 +2778,9 @@ def _tenant_invite_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_invite_reject( self, @@ -2557,9 +2789,8 @@ async def tenant_invite_reject( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2592,24 +2823,23 @@ async def tenant_invite_reject( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2617,7 +2847,6 @@ async def tenant_invite_reject( response_types_map=_response_types_map, ).data - @validate_call async def tenant_invite_reject_with_http_info( self, @@ -2626,9 +2855,8 @@ async def tenant_invite_reject_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2661,24 +2889,23 @@ async def tenant_invite_reject_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2686,7 +2913,6 @@ async def tenant_invite_reject_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_invite_reject_without_preload_content( self, @@ -2695,9 +2921,8 @@ async def tenant_invite_reject_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2730,28 +2955,26 @@ async def tenant_invite_reject_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_invite_reject_serialize( reject_invite_request=reject_invite_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': None, - '400': "APIErrors", - '403': "APIError", + "200": None, + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_invite_reject_serialize( self, reject_invite_request, @@ -2763,8 +2986,7 @@ def _tenant_invite_reject_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2781,37 +3003,27 @@ def _tenant_invite_reject_serialize( if reject_invite_request is not None: _body_params = reject_invite_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/invites/reject', + method="POST", + resource_path="/api/v1/users/invites/reject", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2821,24 +3033,33 @@ def _tenant_invite_reject_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_member_delete( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + member: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant member id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2873,7 +3094,7 @@ async def tenant_member_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -2881,18 +3102,17 @@ async def tenant_member_delete( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': "TenantMember", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": "TenantMember", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2900,19 +3120,30 @@ async def tenant_member_delete( response_types_map=_response_types_map, ).data - @validate_call async def tenant_member_delete_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + member: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant member id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2947,7 +3178,7 @@ async def tenant_member_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -2955,18 +3186,17 @@ async def tenant_member_delete_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': "TenantMember", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": "TenantMember", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2974,19 +3204,30 @@ async def tenant_member_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_member_delete_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - member: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant member id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + member: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The tenant member id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3021,7 +3262,7 @@ async def tenant_member_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_delete_serialize( tenant=tenant, @@ -3029,22 +3270,20 @@ async def tenant_member_delete_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': "TenantMember", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": "TenantMember", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_member_delete_serialize( self, tenant, @@ -3057,8 +3296,7 @@ def _tenant_member_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3069,32 +3307,25 @@ def _tenant_member_delete_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant if member is not None: - _path_params['member'] = member + _path_params["member"] = member # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/tenants/{tenant}/members/{member}', + method="DELETE", + resource_path="/api/v1/tenants/{tenant}/members/{member}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3104,23 +3335,24 @@ def _tenant_member_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_member_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3153,24 +3385,23 @@ async def tenant_member_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantMemberList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantMemberList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3178,18 +3409,21 @@ async def tenant_member_list( response_types_map=_response_types_map, ).data - @validate_call async def tenant_member_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3222,24 +3456,23 @@ async def tenant_member_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantMemberList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantMemberList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3247,18 +3480,21 @@ async def tenant_member_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_member_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3291,28 +3527,26 @@ async def tenant_member_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_member_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantMemberList", - '400': "APIErrors", - '403': "APIError", + "200": "TenantMemberList", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_member_list_serialize( self, tenant, @@ -3324,8 +3558,7 @@ def _tenant_member_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3336,30 +3569,23 @@ def _tenant_member_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/members', + method="GET", + resource_path="/api/v1/tenants/{tenant}/members", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3369,23 +3595,24 @@ def _tenant_member_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_resource_policy_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3418,24 +3645,23 @@ async def tenant_resource_policy_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantResourcePolicy", - '400': "APIErrors", - '403': "APIError", + "200": "TenantResourcePolicy", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3443,18 +3669,21 @@ async def tenant_resource_policy_get( response_types_map=_response_types_map, ).data - @validate_call async def tenant_resource_policy_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3487,24 +3716,23 @@ async def tenant_resource_policy_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantResourcePolicy", - '400': "APIErrors", - '403': "APIError", + "200": "TenantResourcePolicy", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3512,18 +3740,21 @@ async def tenant_resource_policy_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_resource_policy_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3556,28 +3787,26 @@ async def tenant_resource_policy_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_resource_policy_get_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantResourcePolicy", - '400': "APIErrors", - '403': "APIError", + "200": "TenantResourcePolicy", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_resource_policy_get_serialize( self, tenant, @@ -3589,8 +3818,7 @@ def _tenant_resource_policy_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3601,30 +3829,23 @@ def _tenant_resource_policy_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/resource-policy', + method="GET", + resource_path="/api/v1/tenants/{tenant}/resource-policy", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3634,24 +3855,27 @@ def _tenant_resource_policy_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def tenant_update( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + update_tenant_request: Annotated[ + UpdateTenantRequest, Field(description="The tenant properties to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3686,7 +3910,7 @@ async def tenant_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3694,17 +3918,16 @@ async def tenant_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3712,19 +3935,24 @@ async def tenant_update( response_types_map=_response_types_map, ).data - @validate_call async def tenant_update_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + update_tenant_request: Annotated[ + UpdateTenantRequest, Field(description="The tenant properties to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3759,7 +3987,7 @@ async def tenant_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3767,17 +3995,16 @@ async def tenant_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3785,19 +4012,24 @@ async def tenant_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_update_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - update_tenant_request: Annotated[UpdateTenantRequest, Field(description="The tenant properties to update")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + update_tenant_request: Annotated[ + UpdateTenantRequest, Field(description="The tenant properties to update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3832,7 +4064,7 @@ async def tenant_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_update_serialize( tenant=tenant, @@ -3840,21 +4072,19 @@ async def tenant_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Tenant", - '400': "APIErrors", - '403': "APIError", + "200": "Tenant", + "400": "APIErrors", + "403": "APIError", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_update_serialize( self, tenant, @@ -3867,8 +4097,7 @@ def _tenant_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3879,7 +4108,7 @@ def _tenant_update_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -3887,37 +4116,27 @@ def _tenant_update_serialize( if update_tenant_request is not None: _body_params = update_tenant_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/tenants/{tenant}', + method="PATCH", + resource_path="/api/v1/tenants/{tenant}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3927,12 +4146,9 @@ def _tenant_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_list_tenant_invites( self, @@ -3940,9 +4156,8 @@ async def user_list_tenant_invites( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -3973,23 +4188,22 @@ async def user_list_tenant_invites( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3997,7 +4211,6 @@ async def user_list_tenant_invites( response_types_map=_response_types_map, ).data - @validate_call async def user_list_tenant_invites_with_http_info( self, @@ -4005,9 +4218,8 @@ async def user_list_tenant_invites_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4038,23 +4250,22 @@ async def user_list_tenant_invites_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -4062,7 +4273,6 @@ async def user_list_tenant_invites_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_list_tenant_invites_without_preload_content( self, @@ -4070,9 +4280,8 @@ async def user_list_tenant_invites_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -4103,27 +4312,25 @@ async def user_list_tenant_invites_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_list_tenant_invites_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantInviteList", - '400': "APIErrors", - '403': "APIErrors", + "200": "TenantInviteList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_list_tenant_invites_serialize( self, _request_auth, @@ -4134,8 +4341,7 @@ def _user_list_tenant_invites_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4150,23 +4356,17 @@ def _user_list_tenant_invites_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/invites', + method="GET", + resource_path="/api/v1/users/invites", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4176,7 +4376,5 @@ def _user_list_tenant_invites_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/user_api.py b/hatchet_sdk/clients/rest/api/user_api.py index d1b57adc..a0617fd3 100644 --- a/hatchet_sdk/clients/rest/api/user_api.py +++ b/hatchet_sdk/clients/rest/api/user_api.py @@ -12,21 +12,22 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest -from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest -from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.user import User +from hatchet_sdk.clients.rest.models.user_change_password_request import ( + UserChangePasswordRequest, +) +from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest +from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( + UserTenantMembershipsList, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -42,7 +43,6 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def tenant_memberships_list( self, @@ -50,9 +50,8 @@ async def tenant_memberships_list( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -83,23 +82,22 @@ async def tenant_memberships_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserTenantMembershipsList", - '400': "APIErrors", - '403': "APIErrors", + "200": "UserTenantMembershipsList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -107,7 +105,6 @@ async def tenant_memberships_list( response_types_map=_response_types_map, ).data - @validate_call async def tenant_memberships_list_with_http_info( self, @@ -115,9 +112,8 @@ async def tenant_memberships_list_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -148,23 +144,22 @@ async def tenant_memberships_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserTenantMembershipsList", - '400': "APIErrors", - '403': "APIErrors", + "200": "UserTenantMembershipsList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -172,7 +167,6 @@ async def tenant_memberships_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_memberships_list_without_preload_content( self, @@ -180,9 +174,8 @@ async def tenant_memberships_list_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -213,27 +206,25 @@ async def tenant_memberships_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_memberships_list_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserTenantMembershipsList", - '400': "APIErrors", - '403': "APIErrors", + "200": "UserTenantMembershipsList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_memberships_list_serialize( self, _request_auth, @@ -244,8 +235,7 @@ def _tenant_memberships_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -260,23 +250,17 @@ def _tenant_memberships_list_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/memberships', + method="GET", + resource_path="/api/v1/users/memberships", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -286,12 +270,9 @@ def _tenant_memberships_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_create( self, @@ -300,9 +281,8 @@ async def user_create( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -335,25 +315,24 @@ async def user_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -361,7 +340,6 @@ async def user_create( response_types_map=_response_types_map, ).data - @validate_call async def user_create_with_http_info( self, @@ -370,9 +348,8 @@ async def user_create_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -405,25 +382,24 @@ async def user_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -431,7 +407,6 @@ async def user_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_create_without_preload_content( self, @@ -440,9 +415,8 @@ async def user_create_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -475,29 +449,27 @@ async def user_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_create_serialize( user_register_request=user_register_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_create_serialize( self, user_register_request, @@ -509,8 +481,7 @@ def _user_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -527,35 +498,27 @@ def _user_create_serialize( if user_register_request is not None: _body_params = user_register_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/register', + method="POST", + resource_path="/api/v1/users/register", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -565,12 +528,9 @@ def _user_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_get_current( self, @@ -578,9 +538,8 @@ async def user_get_current( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -611,24 +570,23 @@ async def user_get_current( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -636,7 +594,6 @@ async def user_get_current( response_types_map=_response_types_map, ).data - @validate_call async def user_get_current_with_http_info( self, @@ -644,9 +601,8 @@ async def user_get_current_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -677,24 +633,23 @@ async def user_get_current_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -702,7 +657,6 @@ async def user_get_current_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_get_current_without_preload_content( self, @@ -710,9 +664,8 @@ async def user_get_current_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -743,28 +696,26 @@ async def user_get_current_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_get_current_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_get_current_serialize( self, _request_auth, @@ -775,8 +726,7 @@ def _user_get_current_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -791,23 +741,17 @@ def _user_get_current_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/current', + method="GET", + resource_path="/api/v1/users/current", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -817,12 +761,9 @@ def _user_get_current_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_github_oauth_callback( self, @@ -830,9 +771,8 @@ async def user_update_github_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -863,21 +803,20 @@ async def user_update_github_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -885,7 +824,6 @@ async def user_update_github_oauth_callback( response_types_map=_response_types_map, ).data - @validate_call async def user_update_github_oauth_callback_with_http_info( self, @@ -893,9 +831,8 @@ async def user_update_github_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -926,21 +863,20 @@ async def user_update_github_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -948,7 +884,6 @@ async def user_update_github_oauth_callback_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_github_oauth_callback_without_preload_content( self, @@ -956,9 +891,8 @@ async def user_update_github_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -989,25 +923,23 @@ async def user_update_github_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_github_oauth_callback_serialize( self, _request_auth, @@ -1018,8 +950,7 @@ def _user_update_github_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1034,16 +965,12 @@ def _user_update_github_oauth_callback_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/github/callback', + method="GET", + resource_path="/api/v1/users/github/callback", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1053,12 +980,9 @@ def _user_update_github_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_github_oauth_start( self, @@ -1066,9 +990,8 @@ async def user_update_github_oauth_start( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1099,21 +1022,20 @@ async def user_update_github_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1121,7 +1043,6 @@ async def user_update_github_oauth_start( response_types_map=_response_types_map, ).data - @validate_call async def user_update_github_oauth_start_with_http_info( self, @@ -1129,9 +1050,8 @@ async def user_update_github_oauth_start_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1162,21 +1082,20 @@ async def user_update_github_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1184,7 +1103,6 @@ async def user_update_github_oauth_start_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_github_oauth_start_without_preload_content( self, @@ -1192,9 +1110,8 @@ async def user_update_github_oauth_start_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1225,25 +1142,23 @@ async def user_update_github_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_github_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_github_oauth_start_serialize( self, _request_auth, @@ -1254,8 +1169,7 @@ def _user_update_github_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1270,16 +1184,12 @@ def _user_update_github_oauth_start_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/github/start', + method="GET", + resource_path="/api/v1/users/github/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1289,12 +1199,9 @@ def _user_update_github_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_google_oauth_callback( self, @@ -1302,9 +1209,8 @@ async def user_update_google_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1335,21 +1241,20 @@ async def user_update_google_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1357,7 +1262,6 @@ async def user_update_google_oauth_callback( response_types_map=_response_types_map, ).data - @validate_call async def user_update_google_oauth_callback_with_http_info( self, @@ -1365,9 +1269,8 @@ async def user_update_google_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1398,21 +1301,20 @@ async def user_update_google_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1420,7 +1322,6 @@ async def user_update_google_oauth_callback_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_google_oauth_callback_without_preload_content( self, @@ -1428,9 +1329,8 @@ async def user_update_google_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1461,25 +1361,23 @@ async def user_update_google_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_google_oauth_callback_serialize( self, _request_auth, @@ -1490,8 +1388,7 @@ def _user_update_google_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1506,16 +1403,12 @@ def _user_update_google_oauth_callback_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/google/callback', + method="GET", + resource_path="/api/v1/users/google/callback", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1525,12 +1418,9 @@ def _user_update_google_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_google_oauth_start( self, @@ -1538,9 +1428,8 @@ async def user_update_google_oauth_start( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1571,21 +1460,20 @@ async def user_update_google_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1593,7 +1481,6 @@ async def user_update_google_oauth_start( response_types_map=_response_types_map, ).data - @validate_call async def user_update_google_oauth_start_with_http_info( self, @@ -1601,9 +1488,8 @@ async def user_update_google_oauth_start_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1634,21 +1520,20 @@ async def user_update_google_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1656,7 +1541,6 @@ async def user_update_google_oauth_start_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_google_oauth_start_without_preload_content( self, @@ -1664,9 +1548,8 @@ async def user_update_google_oauth_start_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1697,25 +1580,23 @@ async def user_update_google_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_google_oauth_start_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_google_oauth_start_serialize( self, _request_auth, @@ -1726,8 +1607,7 @@ def _user_update_google_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1742,16 +1622,12 @@ def _user_update_google_oauth_start_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/google/start', + method="GET", + resource_path="/api/v1/users/google/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1761,12 +1637,9 @@ def _user_update_google_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_login( self, @@ -1775,9 +1648,8 @@ async def user_update_login( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1810,25 +1682,24 @@ async def user_update_login( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1836,7 +1707,6 @@ async def user_update_login( response_types_map=_response_types_map, ).data - @validate_call async def user_update_login_with_http_info( self, @@ -1845,9 +1715,8 @@ async def user_update_login_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1880,25 +1749,24 @@ async def user_update_login_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1906,7 +1774,6 @@ async def user_update_login_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_login_without_preload_content( self, @@ -1915,9 +1782,8 @@ async def user_update_login_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1950,29 +1816,27 @@ async def user_update_login_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_login_serialize( user_login_request=user_login_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_login_serialize( self, user_login_request, @@ -1984,8 +1848,7 @@ def _user_update_login_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2002,35 +1865,27 @@ def _user_update_login_serialize( if user_login_request is not None: _body_params = user_login_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - ] + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/login', + method="POST", + resource_path="/api/v1/users/login", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2040,12 +1895,9 @@ def _user_update_login_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_logout( self, @@ -2053,9 +1905,8 @@ async def user_update_logout( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2086,24 +1937,23 @@ async def user_update_logout( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2111,7 +1961,6 @@ async def user_update_logout( response_types_map=_response_types_map, ).data - @validate_call async def user_update_logout_with_http_info( self, @@ -2119,9 +1968,8 @@ async def user_update_logout_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2152,24 +2000,23 @@ async def user_update_logout_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2177,7 +2024,6 @@ async def user_update_logout_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_logout_without_preload_content( self, @@ -2185,9 +2031,8 @@ async def user_update_logout_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2218,28 +2063,26 @@ async def user_update_logout_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_logout_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_logout_serialize( self, _request_auth, @@ -2250,8 +2093,7 @@ def _user_update_logout_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2266,23 +2108,17 @@ def _user_update_logout_serialize( # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/logout', + method="POST", + resource_path="/api/v1/users/logout", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2292,12 +2128,9 @@ def _user_update_logout_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_password( self, @@ -2306,9 +2139,8 @@ async def user_update_password( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2341,25 +2173,24 @@ async def user_update_password( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2367,7 +2198,6 @@ async def user_update_password( response_types_map=_response_types_map, ).data - @validate_call async def user_update_password_with_http_info( self, @@ -2376,9 +2206,8 @@ async def user_update_password_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2411,25 +2240,24 @@ async def user_update_password_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2437,7 +2265,6 @@ async def user_update_password_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_password_without_preload_content( self, @@ -2446,9 +2273,8 @@ async def user_update_password_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2481,29 +2307,27 @@ async def user_update_password_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_password_serialize( user_change_password_request=user_change_password_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "User", - '400': "APIErrors", - '401': "APIErrors", - '405': "APIErrors", + "200": "User", + "400": "APIErrors", + "401": "APIErrors", + "405": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_password_serialize( self, user_change_password_request, @@ -2515,8 +2339,7 @@ def _user_update_password_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2533,36 +2356,27 @@ def _user_update_password_serialize( if user_change_password_request is not None: _body_params = user_change_password_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/users/password', + method="POST", + resource_path="/api/v1/users/password", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2572,12 +2386,9 @@ def _user_update_password_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_slack_oauth_callback( self, @@ -2585,9 +2396,8 @@ async def user_update_slack_oauth_callback( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2618,21 +2428,20 @@ async def user_update_slack_oauth_callback( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2640,7 +2449,6 @@ async def user_update_slack_oauth_callback( response_types_map=_response_types_map, ).data - @validate_call async def user_update_slack_oauth_callback_with_http_info( self, @@ -2648,9 +2456,8 @@ async def user_update_slack_oauth_callback_with_http_info( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2681,21 +2488,20 @@ async def user_update_slack_oauth_callback_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2703,7 +2509,6 @@ async def user_update_slack_oauth_callback_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_slack_oauth_callback_without_preload_content( self, @@ -2711,9 +2516,8 @@ async def user_update_slack_oauth_callback_without_preload_content( None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2744,25 +2548,23 @@ async def user_update_slack_oauth_callback_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_callback_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_slack_oauth_callback_serialize( self, _request_auth, @@ -2773,8 +2575,7 @@ def _user_update_slack_oauth_callback_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2789,17 +2590,12 @@ def _user_update_slack_oauth_callback_serialize( # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/users/slack/callback', + method="GET", + resource_path="/api/v1/users/slack/callback", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2809,23 +2605,24 @@ def _user_update_slack_oauth_callback_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def user_update_slack_oauth_start( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2858,22 +2655,21 @@ async def user_update_slack_oauth_start( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2881,18 +2677,21 @@ async def user_update_slack_oauth_start( response_types_map=_response_types_map, ).data - @validate_call async def user_update_slack_oauth_start_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2925,22 +2724,21 @@ async def user_update_slack_oauth_start_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2948,18 +2746,21 @@ async def user_update_slack_oauth_start_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def user_update_slack_oauth_start_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2992,26 +2793,24 @@ async def user_update_slack_oauth_start_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._user_update_slack_oauth_start_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '302': None, + "302": None, } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _user_update_slack_oauth_start_serialize( self, tenant, @@ -3023,8 +2822,7 @@ def _user_update_slack_oauth_start_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3035,23 +2833,18 @@ def _user_update_slack_oauth_start_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - - - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth' - ] + _auth_settings: List[str] = ["cookieAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/slack/start', + method="GET", + resource_path="/api/v1/tenants/{tenant}/slack/start", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3061,7 +2854,5 @@ def _user_update_slack_oauth_start_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/worker_api.py b/hatchet_sdk/clients/rest/api/worker_api.py index 0139fba1..e50f80b9 100644 --- a/hatchet_sdk/clients/rest/api/worker_api.py +++ b/hatchet_sdk/clients/rest/api/worker_api.py @@ -12,19 +12,16 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictBool -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest -from hatchet_sdk.clients.rest.models.worker import Worker -from hatchet_sdk.clients.rest.models.worker_list import WorkerList from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest +from hatchet_sdk.clients.rest.models.worker import Worker +from hatchet_sdk.clients.rest.models.worker_list import WorkerList from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,19 +37,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def worker_get( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -65,8 +64,6 @@ async def worker_get( :param worker: The worker id (required) :type worker: str - :param recent_failed: Filter recent by failed - :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -87,25 +84,23 @@ async def worker_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, - recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -113,19 +108,21 @@ async def worker_get( response_types_map=_response_types_map, ).data - @validate_call async def worker_get_with_http_info( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -138,8 +135,6 @@ async def worker_get_with_http_info( :param worker: The worker id (required) :type worker: str - :param recent_failed: Filter recent by failed - :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -160,25 +155,23 @@ async def worker_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, - recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -186,19 +179,21 @@ async def worker_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def worker_get_without_preload_content( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - recent_failed: Annotated[Optional[StrictBool], Field(description="Filter recent by failed")] = None, + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -211,8 +206,6 @@ async def worker_get_without_preload_content( :param worker: The worker id (required) :type worker: str - :param recent_failed: Filter recent by failed - :type recent_failed: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -233,33 +226,29 @@ async def worker_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_get_serialize( worker=worker, - recent_failed=recent_failed, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _worker_get_serialize( self, worker, - recent_failed, _request_auth, _content_type, _headers, @@ -268,8 +257,7 @@ def _worker_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -280,34 +268,23 @@ def _worker_get_serialize( # process the path parameters if worker is not None: - _path_params['worker'] = worker + _path_params["worker"] = worker # process the query parameters - if recent_failed is not None: - - _query_params.append(('recentFailed', recent_failed)) - # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workers/{worker}', + method="GET", + resource_path="/api/v1/workers/{worker}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -317,23 +294,24 @@ def _worker_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def worker_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -366,24 +344,23 @@ async def worker_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -391,18 +368,21 @@ async def worker_list( response_types_map=_response_types_map, ).data - @validate_call async def worker_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -435,24 +415,23 @@ async def worker_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -460,18 +439,21 @@ async def worker_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def worker_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -504,28 +486,26 @@ async def worker_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_list_serialize( tenant=tenant, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkerList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkerList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _worker_list_serialize( self, tenant, @@ -537,8 +517,7 @@ def _worker_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -549,30 +528,23 @@ def _worker_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/worker', + method="GET", + resource_path="/api/v1/tenants/{tenant}/worker", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -582,24 +554,27 @@ def _worker_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def worker_update( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], + update_worker_request: Annotated[ + UpdateWorkerRequest, Field(description="The worker update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -634,7 +609,7 @@ async def worker_update( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -642,17 +617,16 @@ async def worker_update( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -660,19 +634,24 @@ async def worker_update( response_types_map=_response_types_map, ).data - @validate_call async def worker_update_with_http_info( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], + update_worker_request: Annotated[ + UpdateWorkerRequest, Field(description="The worker update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -707,7 +686,7 @@ async def worker_update_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -715,17 +694,16 @@ async def worker_update_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -733,19 +711,24 @@ async def worker_update_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def worker_update_without_preload_content( self, - worker: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The worker id")], - update_worker_request: Annotated[UpdateWorkerRequest, Field(description="The worker update")], + worker: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The worker id" + ), + ], + update_worker_request: Annotated[ + UpdateWorkerRequest, Field(description="The worker update") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -780,7 +763,7 @@ async def worker_update_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._worker_update_serialize( worker=worker, @@ -788,21 +771,19 @@ async def worker_update_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Worker", - '400': "APIErrors", - '403': "APIErrors", + "200": "Worker", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _worker_update_serialize( self, worker, @@ -815,8 +796,7 @@ def _worker_update_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -827,7 +807,7 @@ def _worker_update_serialize( # process the path parameters if worker is not None: - _path_params['worker'] = worker + _path_params["worker"] = worker # process the query parameters # process the header parameters # process the form parameters @@ -835,37 +815,27 @@ def _worker_update_serialize( if update_worker_request is not None: _body_params = update_worker_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/workers/{worker}', + method="PATCH", + resource_path="/api/v1/workers/{worker}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -875,7 +845,5 @@ def _worker_update_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/workflow_api.py b/hatchet_sdk/clients/rest/api/workflow_api.py index 836ee92f..0c0beefd 100644 --- a/hatchet_sdk/clients/rest/api/workflow_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_api.py @@ -12,14 +12,14 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from datetime import datetime -from pydantic import Field, StrictInt, StrictStr -from typing import List, Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated + +from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized +from hatchet_sdk.clients.rest.api_response import ApiResponse from hatchet_sdk.clients.rest.models.tenant_queue_metrics import TenantQueueMetrics from hatchet_sdk.clients.rest.models.workflow import Workflow from hatchet_sdk.clients.rest.models.workflow_kind import WorkflowKind @@ -27,15 +27,20 @@ from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( + WorkflowRunOrderByDirection, +) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( + WorkflowRunOrderByField, +) +from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics +from hatchet_sdk.clients.rest.models.workflow_update_request import ( + WorkflowUpdateRequest, +) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition - -from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized -from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -51,20 +56,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def tenant_get_queue_metrics( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -101,7 +115,7 @@ async def tenant_get_queue_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -110,18 +124,17 @@ async def tenant_get_queue_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantQueueMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "TenantQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -129,20 +142,29 @@ async def tenant_get_queue_metrics( response_types_map=_response_types_map, ).data - @validate_call async def tenant_get_queue_metrics_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -179,7 +201,7 @@ async def tenant_get_queue_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -188,18 +210,17 @@ async def tenant_get_queue_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantQueueMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "TenantQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -207,20 +228,29 @@ async def tenant_get_queue_metrics_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def tenant_get_queue_metrics_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflows: Annotated[Optional[List[StrictStr]], Field(description="A list of workflow IDs to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflows: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of workflow IDs to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -257,7 +287,7 @@ async def tenant_get_queue_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._tenant_get_queue_metrics_serialize( tenant=tenant, @@ -266,22 +296,20 @@ async def tenant_get_queue_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TenantQueueMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "TenantQueueMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _tenant_get_queue_metrics_serialize( self, tenant, @@ -296,8 +324,8 @@ def _tenant_get_queue_metrics_serialize( _host = None _collection_formats: Dict[str, str] = { - 'workflows': 'multi', - 'additionalMetadata': 'multi', + "workflows": "multi", + "additionalMetadata": "multi", } _path_params: Dict[str, str] = {} @@ -309,38 +337,31 @@ def _tenant_get_queue_metrics_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters if workflows is not None: - - _query_params.append(('workflows', workflows)) - + + _query_params.append(("workflows", workflows)) + if additional_metadata is not None: - - _query_params.append(('additionalMetadata', additional_metadata)) - + + _query_params.append(("additionalMetadata", additional_metadata)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/queue-metrics', + method="GET", + resource_path="/api/v1/tenants/{tenant}/queue-metrics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -350,23 +371,24 @@ def _tenant_get_queue_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_delete( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -399,25 +421,24 @@ async def workflow_delete( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -425,18 +446,21 @@ async def workflow_delete( response_types_map=_response_types_map, ).data - @validate_call async def workflow_delete_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -469,25 +493,24 @@ async def workflow_delete_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -495,18 +518,21 @@ async def workflow_delete_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_delete_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -539,29 +565,27 @@ async def workflow_delete_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_delete_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "204": None, + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_delete_serialize( self, workflow, @@ -573,8 +597,7 @@ def _workflow_delete_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -585,30 +608,23 @@ def _workflow_delete_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/workflows/{workflow}', + method="DELETE", + resource_path="/api/v1/workflows/{workflow}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -618,23 +634,24 @@ def _workflow_delete_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_get( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -667,24 +684,24 @@ async def workflow_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Workflow", - '400': "APIErrors", - '403': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -692,18 +709,21 @@ async def workflow_get( response_types_map=_response_types_map, ).data - @validate_call async def workflow_get_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -736,24 +756,24 @@ async def workflow_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Workflow", - '400': "APIErrors", - '403': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -761,18 +781,21 @@ async def workflow_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_get_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -805,28 +828,27 @@ async def workflow_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_serialize( workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Workflow", - '400': "APIErrors", - '403': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_get_serialize( self, workflow, @@ -838,8 +860,7 @@ def _workflow_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -850,30 +871,23 @@ def _workflow_get_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workflows/{workflow}', + method="GET", + resource_path="/api/v1/workflows/{workflow}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -883,25 +897,31 @@ def _workflow_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_get_metrics( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, - group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + status: Annotated[ + Optional[WorkflowRunStatus], + Field(description="A status of workflow run statuses to filter by"), + ] = None, + group_key: Annotated[ + Optional[StrictStr], Field(description="A group key to filter metrics by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -938,7 +958,7 @@ async def workflow_get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -947,18 +967,17 @@ async def workflow_get_metrics( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -966,20 +985,28 @@ async def workflow_get_metrics( response_types_map=_response_types_map, ).data - @validate_call async def workflow_get_metrics_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, - group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + status: Annotated[ + Optional[WorkflowRunStatus], + Field(description="A status of workflow run statuses to filter by"), + ] = None, + group_key: Annotated[ + Optional[StrictStr], Field(description="A group key to filter metrics by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1016,7 +1043,7 @@ async def workflow_get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -1025,18 +1052,17 @@ async def workflow_get_metrics_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1044,20 +1070,28 @@ async def workflow_get_metrics_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_get_metrics_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - status: Annotated[Optional[WorkflowRunStatus], Field(description="A status of workflow run statuses to filter by")] = None, - group_key: Annotated[Optional[StrictStr], Field(description="A group key to filter metrics by")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + status: Annotated[ + Optional[WorkflowRunStatus], + Field(description="A status of workflow run statuses to filter by"), + ] = None, + group_key: Annotated[ + Optional[StrictStr], Field(description="A group key to filter metrics by") + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -1094,7 +1128,7 @@ async def workflow_get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_get_metrics_serialize( workflow=workflow, @@ -1103,22 +1137,20 @@ async def workflow_get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowMetrics", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowMetrics", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_get_metrics_serialize( self, workflow, @@ -1132,8 +1164,7 @@ def _workflow_get_metrics_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1144,38 +1175,31 @@ def _workflow_get_metrics_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters if status is not None: - - _query_params.append(('status', status.value)) - + + _query_params.append(("status", status.value)) + if group_key is not None: - - _query_params.append(('groupKey', group_key)) - + + _query_params.append(("groupKey", group_key)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workflows/{workflow}/metrics', + method="GET", + resource_path="/api/v1/workflows/{workflow}/metrics", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1185,35 +1209,44 @@ def _workflow_get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def workflow_list( + async def workflow_get_workers_count( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowList: - """Get workflows + ) -> WorkflowWorkersCount: + """Get workflow worker count - Get all workflows for a tenant + Get a count of the workers available for workflow :param tenant: The tenant id (required) :type tenant: str + :param workflow: The workflow id (required) + :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1234,24 +1267,24 @@ async def workflow_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_get_workers_count_serialize( tenant=tenant, + workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowWorkersCount", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1259,30 +1292,41 @@ async def workflow_list( response_types_map=_response_types_map, ).data - @validate_call - async def workflow_list_with_http_info( + async def workflow_get_workers_count_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowList]: - """Get workflows + ) -> ApiResponse[WorkflowWorkersCount]: + """Get workflow worker count - Get all workflows for a tenant + Get a count of the workers available for workflow :param tenant: The tenant id (required) :type tenant: str + :param workflow: The workflow id (required) + :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1303,24 +1347,24 @@ async def workflow_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_get_workers_count_serialize( tenant=tenant, + workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowWorkersCount", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1328,30 +1372,41 @@ async def workflow_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def workflow_list_without_preload_content( + async def workflow_get_workers_count_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflows + """Get workflow worker count - Get all workflows for a tenant + Get a count of the workers available for workflow :param tenant: The tenant id (required) :type tenant: str + :param workflow: The workflow id (required) + :type workflow: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1372,31 +1427,31 @@ async def workflow_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_list_serialize( + _param = self._workflow_get_workers_count_serialize( tenant=tenant, + workflow=workflow, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowWorkersCount", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _workflow_list_serialize( + def _workflow_get_workers_count_serialize( self, tenant, + workflow, _request_auth, _content_type, _headers, @@ -1405,8 +1460,7 @@ def _workflow_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1417,30 +1471,25 @@ def _workflow_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant + if workflow is not None: + _path_params["workflow"] = workflow # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/workflows', + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflows/{workflow}/worker-count", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1450,38 +1499,36 @@ def _workflow_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def workflow_run_get( + async def workflow_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRun: - """Get workflow run + ) -> WorkflowList: + """Get workflows - Get a workflow run for a tenant + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1502,25 +1549,23 @@ async def workflow_run_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1528,33 +1573,33 @@ async def workflow_run_get( response_types_map=_response_types_map, ).data - @validate_call - async def workflow_run_get_with_http_info( + async def workflow_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRun]: - """Get workflow run + ) -> ApiResponse[WorkflowList]: + """Get workflows - Get a workflow run for a tenant + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1575,25 +1620,23 @@ async def workflow_run_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1601,33 +1644,33 @@ async def workflow_run_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def workflow_run_get_without_preload_content( + async def workflow_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow run + """Get workflows - Get a workflow run for a tenant + Get all workflows for a tenant :param tenant: The tenant id (required) :type tenant: str - :param workflow_run: The workflow run id (required) - :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1648,33 +1691,29 @@ async def workflow_run_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_serialize( + _param = self._workflow_list_serialize( tenant=tenant, - workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _workflow_run_get_serialize( + def _workflow_list_serialize( self, tenant, - workflow_run, _request_auth, _content_type, _headers, @@ -1683,8 +1722,7 @@ def _workflow_run_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1695,32 +1733,23 @@ def _workflow_run_get_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant - if workflow_run is not None: - _path_params['workflow-run'] = workflow_run + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}', + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflows", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1730,56 +1759,47 @@ def _workflow_run_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def workflow_run_get_metrics( + async def workflow_run_get( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunsMetrics: - """Get workflow runs + ) -> WorkflowRun: + """Get workflow run - Get a summary of workflow run metrics for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1800,31 +1820,24 @@ async def workflow_run_get_metrics( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, - event_id=event_id, - workflow_id=workflow_id, - parent_workflow_run_id=parent_workflow_run_id, - parent_step_run_id=parent_step_run_id, - additional_metadata=additional_metadata, - created_after=created_after, - created_before=created_before, + workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunsMetrics", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1832,51 +1845,44 @@ async def workflow_run_get_metrics( response_types_map=_response_types_map, ).data - @validate_call - async def workflow_run_get_metrics_with_http_info( + async def workflow_run_get_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunsMetrics]: - """Get workflow runs + ) -> ApiResponse[WorkflowRun]: + """Get workflow run - Get a summary of workflow run metrics for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1897,31 +1903,24 @@ async def workflow_run_get_metrics_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, - event_id=event_id, - workflow_id=workflow_id, - parent_workflow_run_id=parent_workflow_run_id, - parent_step_run_id=parent_step_run_id, - additional_metadata=additional_metadata, - created_after=created_after, - created_before=created_before, + workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunsMetrics", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -1929,51 +1928,44 @@ async def workflow_run_get_metrics_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def workflow_run_get_metrics_without_preload_content( + async def workflow_run_get_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow runs + """Get workflow run - Get a summary of workflow run metrics for a tenant + Get a workflow run for a tenant :param tenant: The tenant id (required) :type tenant: str - :param event_id: The event id to get runs for. - :type event_id: str - :param workflow_id: The workflow id to get runs for. - :type workflow_id: str - :param parent_workflow_run_id: The parent workflow run id - :type parent_workflow_run_id: str - :param parent_step_run_id: The parent step run id - :type parent_step_run_id: str - :param additional_metadata: A list of metadata key value pairs to filter by - :type additional_metadata: List[str] - :param created_after: The time after the workflow run was created - :type created_after: datetime - :param created_before: The time before the workflow run was created - :type created_before: datetime + :param workflow_run: The workflow run id (required) + :type workflow_run: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1994,11 +1986,415 @@ async def workflow_run_get_metrics_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_run_get_metrics_serialize( + _param = self._workflow_run_get_serialize( tenant=tenant, - event_id=event_id, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _workflow_run_get_serialize( + self, + tenant, + workflow_run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + if workflow_run is not None: + _path_params["workflow-run"] = workflow_run + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def workflow_run_get_metrics( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkflowRunsMetrics: + """Get workflow runs + + Get a summary of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_metrics_serialize( + tenant=tenant, + event_id=event_id, + workflow_id=workflow_id, + parent_workflow_run_id=parent_workflow_run_id, + parent_step_run_id=parent_step_run_id, + additional_metadata=additional_metadata, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRunsMetrics", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def workflow_run_get_metrics_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkflowRunsMetrics]: + """Get workflow runs + + Get a summary of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_metrics_serialize( + tenant=tenant, + event_id=event_id, + workflow_id=workflow_id, + parent_workflow_run_id=parent_workflow_run_id, + parent_step_run_id=parent_step_run_id, + additional_metadata=additional_metadata, + created_after=created_after, + created_before=created_before, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRunsMetrics", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def workflow_run_get_metrics_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get workflow runs + + Get a summary of workflow run metrics for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param event_id: The event id to get runs for. + :type event_id: str + :param workflow_id: The workflow id to get runs for. + :type workflow_id: str + :param parent_workflow_run_id: The parent workflow run id + :type parent_workflow_run_id: str + :param parent_step_run_id: The parent step run id + :type parent_step_run_id: str + :param additional_metadata: A list of metadata key value pairs to filter by + :type additional_metadata: List[str] + :param created_after: The time after the workflow run was created + :type created_after: datetime + :param created_before: The time before the workflow run was created + :type created_before: datetime + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_metrics_serialize( + tenant=tenant, + event_id=event_id, workflow_id=workflow_id, parent_workflow_run_id=parent_workflow_run_id, parent_step_run_id=parent_step_run_id, @@ -2008,31 +2404,370 @@ async def workflow_run_get_metrics_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRunsMetrics", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _workflow_run_get_metrics_serialize( + self, + tenant, + event_id, + workflow_id, + parent_workflow_run_id, + parent_step_run_id, + additional_metadata, + created_after, + created_before, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "additionalMetadata": "multi", + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + # process the query parameters + if event_id is not None: + + _query_params.append(("eventId", event_id)) + + if workflow_id is not None: + + _query_params.append(("workflowId", workflow_id)) + + if parent_workflow_run_id is not None: + + _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) + + if parent_step_run_id is not None: + + _query_params.append(("parentStepRunId", parent_step_run_id)) + + if additional_metadata is not None: + + _query_params.append(("additionalMetadata", additional_metadata)) + + if created_after is not None: + if isinstance(created_after, datetime): + _query_params.append( + ( + "createdAfter", + created_after.isoformat(), + ) + ) + else: + _query_params.append(("createdAfter", created_after)) + + if created_before is not None: + if isinstance(created_before, datetime): + _query_params.append( + ( + "createdBefore", + created_before.isoformat(), + ) + ) + else: + _query_params.append(("createdBefore", created_before)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflows/runs/metrics", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def workflow_run_get_shape( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkflowRunShape: + """Get workflow run + + Get a workflow run for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_shape_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRunShape", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def workflow_run_get_shape_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkflowRunShape]: + """Get workflow run + + Get a workflow run for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_shape_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "WorkflowRunShape", + "400": "APIErrors", + "403": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def workflow_run_get_shape_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get workflow run + + Get a workflow run for a tenant + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_shape_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunsMetrics", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunShape", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _workflow_run_get_metrics_serialize( + def _workflow_run_get_shape_serialize( self, tenant, - event_id, - workflow_id, - parent_workflow_run_id, - parent_step_run_id, - additional_metadata, - created_after, - created_before, + workflow_run, _request_auth, _content_type, _headers, @@ -2041,9 +2776,7 @@ def _workflow_run_get_metrics_serialize( _host = None - _collection_formats: Dict[str, str] = { - 'additionalMetadata': 'multi', - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2054,76 +2787,25 @@ def _workflow_run_get_metrics_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant + if workflow_run is not None: + _path_params["workflow-run"] = workflow_run # process the query parameters - if event_id is not None: - - _query_params.append(('eventId', event_id)) - - if workflow_id is not None: - - _query_params.append(('workflowId', workflow_id)) - - if parent_workflow_run_id is not None: - - _query_params.append(('parentWorkflowRunId', parent_workflow_run_id)) - - if parent_step_run_id is not None: - - _query_params.append(('parentStepRunId', parent_step_run_id)) - - if additional_metadata is not None: - - _query_params.append(('additionalMetadata', additional_metadata)) - - if created_after is not None: - if isinstance(created_after, datetime): - _query_params.append( - ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdAfter', created_after)) - - if created_before is not None: - if isinstance(created_before, datetime): - _query_params.append( - ( - 'createdBefore', - created_before.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('createdBefore', created_before)) - # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/workflows/runs/metrics', + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/shape", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2133,36 +2815,81 @@ def _workflow_run_get_metrics_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_run_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, - order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, - order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + finished_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was finished"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was finished"), + ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2197,6 +2924,10 @@ async def workflow_run_list( :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param finished_after: The time after the workflow run was finished + :type finished_after: datetime + :param finished_before: The time before the workflow run was finished + :type finished_before: datetime :param order_by_field: The order by field :type order_by_field: WorkflowRunOrderByField :param order_by_direction: The order by direction @@ -2221,7 +2952,7 @@ async def workflow_run_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2236,22 +2967,23 @@ async def workflow_run_list( additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + finished_after=finished_after, + finished_before=finished_before, order_by_field=order_by_field, order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2259,31 +2991,78 @@ async def workflow_run_list( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, - order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, - order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + finished_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was finished"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was finished"), + ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2318,6 +3097,10 @@ async def workflow_run_list_with_http_info( :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param finished_after: The time after the workflow run was finished + :type finished_after: datetime + :param finished_before: The time before the workflow run was finished + :type finished_before: datetime :param order_by_field: The order by field :type order_by_field: WorkflowRunOrderByField :param order_by_direction: The order by direction @@ -2342,7 +3125,7 @@ async def workflow_run_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2357,22 +3140,23 @@ async def workflow_run_list_with_http_info( additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + finished_after=finished_after, + finished_before=finished_before, order_by_field=order_by_field, order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2380,31 +3164,78 @@ async def workflow_run_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - event_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The event id to get runs for.")] = None, - workflow_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow id to get runs for.")] = None, - parent_workflow_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent workflow run id")] = None, - parent_step_run_id: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The parent step run id")] = None, - statuses: Annotated[Optional[List[WorkflowRunStatus]], Field(description="A list of workflow run statuses to filter by")] = None, - kinds: Annotated[Optional[List[WorkflowKind]], Field(description="A list of workflow kinds to filter by")] = None, - additional_metadata: Annotated[Optional[List[StrictStr]], Field(description="A list of metadata key value pairs to filter by")] = None, - created_after: Annotated[Optional[datetime], Field(description="The time after the workflow run was created")] = None, - created_before: Annotated[Optional[datetime], Field(description="The time before the workflow run was created")] = None, - order_by_field: Annotated[Optional[WorkflowRunOrderByField], Field(description="The order by field")] = None, - order_by_direction: Annotated[Optional[WorkflowRunOrderByDirection], Field(description="The order by direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + event_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The event id to get runs for."), + ] = None, + workflow_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The workflow id to get runs for."), + ] = None, + parent_workflow_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent workflow run id"), + ] = None, + parent_step_run_id: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field(description="The parent step run id"), + ] = None, + statuses: Annotated[ + Optional[List[WorkflowRunStatus]], + Field(description="A list of workflow run statuses to filter by"), + ] = None, + kinds: Annotated[ + Optional[List[WorkflowKind]], + Field(description="A list of workflow kinds to filter by"), + ] = None, + additional_metadata: Annotated[ + Optional[List[StrictStr]], + Field(description="A list of metadata key value pairs to filter by"), + ] = None, + created_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was created"), + ] = None, + created_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was created"), + ] = None, + finished_after: Annotated[ + Optional[datetime], + Field(description="The time after the workflow run was finished"), + ] = None, + finished_before: Annotated[ + Optional[datetime], + Field(description="The time before the workflow run was finished"), + ] = None, + order_by_field: Annotated[ + Optional[WorkflowRunOrderByField], Field(description="The order by field") + ] = None, + order_by_direction: Annotated[ + Optional[WorkflowRunOrderByDirection], + Field(description="The order by direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -2439,6 +3270,10 @@ async def workflow_run_list_without_preload_content( :type created_after: datetime :param created_before: The time before the workflow run was created :type created_before: datetime + :param finished_after: The time after the workflow run was finished + :type finished_after: datetime + :param finished_before: The time before the workflow run was finished + :type finished_before: datetime :param order_by_field: The order by field :type order_by_field: WorkflowRunOrderByField :param order_by_direction: The order by direction @@ -2463,7 +3298,7 @@ async def workflow_run_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_list_serialize( tenant=tenant, @@ -2478,26 +3313,26 @@ async def workflow_run_list_without_preload_content( additional_metadata=additional_metadata, created_after=created_after, created_before=created_before, + finished_after=finished_after, + finished_before=finished_before, order_by_field=order_by_field, order_by_direction=order_by_direction, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunList", - '400': "APIErrors", - '403': "APIErrors", + "200": "WorkflowRunList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_list_serialize( self, tenant, @@ -2512,6 +3347,8 @@ def _workflow_run_list_serialize( additional_metadata, created_after, created_before, + finished_after, + finished_before, order_by_field, order_by_direction, _request_auth, @@ -2523,9 +3360,9 @@ def _workflow_run_list_serialize( _host = None _collection_formats: Dict[str, str] = { - 'statuses': 'multi', - 'kinds': 'multi', - 'additionalMetadata': 'multi', + "statuses": "multi", + "kinds": "multi", + "additionalMetadata": "multi", } _path_params: Dict[str, str] = {} @@ -2537,100 +3374,115 @@ def _workflow_run_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + if event_id is not None: - - _query_params.append(('eventId', event_id)) - + + _query_params.append(("eventId", event_id)) + if workflow_id is not None: - - _query_params.append(('workflowId', workflow_id)) - + + _query_params.append(("workflowId", workflow_id)) + if parent_workflow_run_id is not None: - - _query_params.append(('parentWorkflowRunId', parent_workflow_run_id)) - + + _query_params.append(("parentWorkflowRunId", parent_workflow_run_id)) + if parent_step_run_id is not None: - - _query_params.append(('parentStepRunId', parent_step_run_id)) - + + _query_params.append(("parentStepRunId", parent_step_run_id)) + if statuses is not None: - - _query_params.append(('statuses', statuses)) - + + _query_params.append(("statuses", statuses)) + if kinds is not None: - - _query_params.append(('kinds', kinds)) - + + _query_params.append(("kinds", kinds)) + if additional_metadata is not None: - - _query_params.append(('additionalMetadata', additional_metadata)) - + + _query_params.append(("additionalMetadata", additional_metadata)) + if created_after is not None: if isinstance(created_after, datetime): _query_params.append( ( - 'createdAfter', - created_after.strftime( - self.api_client.configuration.datetime_format - ) + "createdAfter", + created_after.isoformat(), ) ) else: - _query_params.append(('createdAfter', created_after)) - + _query_params.append(("createdAfter", created_after)) + if created_before is not None: if isinstance(created_before, datetime): _query_params.append( ( - 'createdBefore', - created_before.strftime( + "createdBefore", + created_before.isoformat(), + ) + ) + else: + _query_params.append(("createdBefore", created_before)) + + if finished_after is not None: + if isinstance(finished_after, datetime): + _query_params.append( + ( + "finishedAfter", + finished_after.strftime( + self.api_client.configuration.datetime_format + ), + ) + ) + else: + _query_params.append(("finishedAfter", finished_after)) + + if finished_before is not None: + if isinstance(finished_before, datetime): + _query_params.append( + ( + "finishedBefore", + finished_before.strftime( self.api_client.configuration.datetime_format - ) + ), ) ) else: - _query_params.append(('createdBefore', created_before)) - + _query_params.append(("finishedBefore", finished_before)) + if order_by_field is not None: - - _query_params.append(('orderByField', order_by_field.value)) - + + _query_params.append(("orderByField", order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(('orderByDirection', order_by_direction.value)) - + + _query_params.append(("orderByDirection", order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/workflows/runs', + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflows/runs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2640,38 +3492,41 @@ def _workflow_run_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def workflow_version_get( + async def workflow_update( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + workflow_update_request: Annotated[ + WorkflowUpdateRequest, Field(description="The input to update the workflow") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowVersion: - """Get workflow version + ) -> Workflow: + """Update workflow - Get a workflow version for a tenant + Update a workflow for a tenant :param workflow: The workflow id (required) :type workflow: str - :param version: The workflow version. If not supplied, the latest version is fetched. - :type version: str + :param workflow_update_request: The input to update the workflow (required) + :type workflow_update_request: WorkflowUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2692,26 +3547,24 @@ async def workflow_version_get( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_update_serialize( workflow=workflow, - version=version, + workflow_update_request=workflow_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersion", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2719,33 +3572,38 @@ async def workflow_version_get( response_types_map=_response_types_map, ).data - @validate_call - async def workflow_version_get_with_http_info( + async def workflow_update_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + workflow_update_request: Annotated[ + WorkflowUpdateRequest, Field(description="The input to update the workflow") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowVersion]: - """Get workflow version + ) -> ApiResponse[Workflow]: + """Update workflow - Get a workflow version for a tenant + Update a workflow for a tenant :param workflow: The workflow id (required) :type workflow: str - :param version: The workflow version. If not supplied, the latest version is fetched. - :type version: str + :param workflow_update_request: The input to update the workflow (required) + :type workflow_update_request: WorkflowUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2766,26 +3624,24 @@ async def workflow_version_get_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_update_serialize( workflow=workflow, - version=version, + workflow_update_request=workflow_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersion", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -2793,33 +3649,38 @@ async def workflow_version_get_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def workflow_version_get_without_preload_content( + async def workflow_update_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + workflow_update_request: Annotated[ + WorkflowUpdateRequest, Field(description="The input to update the workflow") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow version + """Update workflow - Get a workflow version for a tenant + Update a workflow for a tenant :param workflow: The workflow id (required) :type workflow: str - :param version: The workflow version. If not supplied, the latest version is fetched. - :type version: str + :param workflow_update_request: The input to update the workflow (required) + :type workflow_update_request: WorkflowUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2840,34 +3701,31 @@ async def workflow_version_get_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_serialize( + _param = self._workflow_update_serialize( workflow=workflow, - version=version, + workflow_update_request=workflow_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersion", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Workflow", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _workflow_version_get_serialize( + def _workflow_update_serialize( self, workflow, - version, + workflow_update_request, _request_auth, _content_type, _headers, @@ -2876,8 +3734,7 @@ def _workflow_version_get_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2888,34 +3745,35 @@ def _workflow_version_get_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters - if version is not None: - - _query_params.append(('version', version)) - # process the header parameters # process the form parameters # process the body parameter - + if workflow_update_request is not None: + _body_params = workflow_update_request # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workflows/{workflow}/versions', + method="PATCH", + resource_path="/api/v1/workflows/{workflow}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2925,33 +3783,39 @@ def _workflow_version_get_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call - async def workflow_version_get_definition( + async def workflow_version_get( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowVersionDefinition: - """Get workflow version definition + ) -> WorkflowVersion: + """Get workflow version - Get a workflow version definition for a tenant + Get a workflow version for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -2977,26 +3841,25 @@ async def workflow_version_get_definition( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_definition_serialize( + _param = self._workflow_version_get_serialize( workflow=workflow, version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersionDefinition", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowVersion", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3004,28 +3867,36 @@ async def workflow_version_get_definition( response_types_map=_response_types_map, ).data - @validate_call - async def workflow_version_get_definition_with_http_info( + async def workflow_version_get_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowVersionDefinition]: - """Get workflow version definition + ) -> ApiResponse[WorkflowVersion]: + """Get workflow version - Get a workflow version definition for a tenant + Get a workflow version for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -3051,26 +3922,25 @@ async def workflow_version_get_definition_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_definition_serialize( + _param = self._workflow_version_get_serialize( workflow=workflow, version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersionDefinition", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowVersion", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -3078,28 +3948,36 @@ async def workflow_version_get_definition_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def workflow_version_get_definition_without_preload_content( + async def workflow_version_get_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get workflow version definition + """Get workflow version - Get a workflow version definition for a tenant + Get a workflow version for a tenant :param workflow: The workflow id (required) :type workflow: str @@ -3125,31 +4003,29 @@ async def workflow_version_get_definition_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._workflow_version_get_definition_serialize( + _param = self._workflow_version_get_serialize( workflow=workflow, version=version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowVersionDefinition", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "WorkflowVersion", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - - def _workflow_version_get_definition_serialize( + def _workflow_version_get_serialize( self, workflow, version, @@ -3161,8 +4037,7 @@ def _workflow_version_get_definition_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3173,34 +4048,27 @@ def _workflow_version_get_definition_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters if version is not None: - - _query_params.append(('version', version)) - + + _query_params.append(("version", version)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workflows/{workflow}/versions/definition', + method="GET", + resource_path="/api/v1/workflows/{workflow}/versions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3210,7 +4078,5 @@ def _workflow_version_get_definition_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api/workflow_run_api.py b/hatchet_sdk/clients/rest/api/workflow_run_api.py index be4f769d..7a4c6c6b 100644 --- a/hatchet_sdk/clients/rest/api/workflow_run_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_run_api.py @@ -12,20 +12,29 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest -from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( + EventUpdateCancel200Response, +) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( + ReplayWorkflowRunsRequest, +) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( + ReplayWorkflowRunsResponse, +) +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( + TriggerWorkflowRunRequest, +) +from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( + WorkflowRunsCancelRequest, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -41,25 +50,31 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def workflow_run_cancel( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_runs_cancel_request: Annotated[ + WorkflowRunsCancelRequest, + Field(description="The input to cancel the workflow runs"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunCancel200Response: + ) -> EventUpdateCancel200Response: """Cancel workflow runs Cancel a batch of workflow runs @@ -88,7 +103,7 @@ async def workflow_run_cancel( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -96,17 +111,16 @@ async def workflow_run_cancel( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunCancel200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -114,25 +128,31 @@ async def workflow_run_cancel( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_cancel_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_runs_cancel_request: Annotated[ + WorkflowRunsCancelRequest, + Field(description="The input to cancel the workflow runs"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunCancel200Response]: + ) -> ApiResponse[EventUpdateCancel200Response]: """Cancel workflow runs Cancel a batch of workflow runs @@ -161,7 +181,7 @@ async def workflow_run_cancel_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -169,17 +189,16 @@ async def workflow_run_cancel_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunCancel200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -187,19 +206,25 @@ async def workflow_run_cancel_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_cancel_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - workflow_runs_cancel_request: Annotated[WorkflowRunsCancelRequest, Field(description="The input to cancel the workflow runs")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_runs_cancel_request: Annotated[ + WorkflowRunsCancelRequest, + Field(description="The input to cancel the workflow runs"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -234,7 +259,7 @@ async def workflow_run_cancel_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_cancel_serialize( tenant=tenant, @@ -242,21 +267,19 @@ async def workflow_run_cancel_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRunCancel200Response", - '400': "APIErrors", - '403': "APIErrors", + "200": "EventUpdateCancel200Response", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_cancel_serialize( self, tenant, @@ -269,8 +292,7 @@ def _workflow_run_cancel_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -281,7 +303,7 @@ def _workflow_run_cancel_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -289,37 +311,27 @@ def _workflow_run_cancel_serialize( if workflow_runs_cancel_request is not None: _body_params = workflow_runs_cancel_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/workflows/cancel', + method="POST", + resource_path="/api/v1/tenants/{tenant}/workflows/cancel", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -329,25 +341,34 @@ def _workflow_run_cancel_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_run_create( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + trigger_workflow_run_request: Annotated[ + TriggerWorkflowRunRequest, + Field(description="The input to the workflow run"), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -384,7 +405,7 @@ async def workflow_run_create( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -393,19 +414,18 @@ async def workflow_run_create( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", - '429': "APIErrors", + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -413,20 +433,31 @@ async def workflow_run_create( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_create_with_http_info( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + trigger_workflow_run_request: Annotated[ + TriggerWorkflowRunRequest, + Field(description="The input to the workflow run"), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -463,7 +494,7 @@ async def workflow_run_create_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -472,19 +503,18 @@ async def workflow_run_create_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", - '429': "APIErrors", + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -492,20 +522,31 @@ async def workflow_run_create_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_create_without_preload_content( self, - workflow: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow id")], - trigger_workflow_run_request: Annotated[TriggerWorkflowRunRequest, Field(description="The input to the workflow run")], - version: Annotated[Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], Field(description="The workflow version. If not supplied, the latest version is fetched.")] = None, + workflow: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The workflow id" + ), + ], + trigger_workflow_run_request: Annotated[ + TriggerWorkflowRunRequest, + Field(description="The input to the workflow run"), + ], + version: Annotated[ + Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]], + Field( + description="The workflow version. If not supplied, the latest version is fetched." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -542,7 +583,7 @@ async def workflow_run_create_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_create_serialize( workflow=workflow, @@ -551,23 +592,21 @@ async def workflow_run_create_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "WorkflowRun", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", - '429': "APIErrors", + "200": "WorkflowRun", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_create_serialize( self, workflow, @@ -581,8 +620,7 @@ def _workflow_run_create_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -593,49 +631,341 @@ def _workflow_run_create_serialize( # process the path parameters if workflow is not None: - _path_params['workflow'] = workflow + _path_params["workflow"] = workflow # process the query parameters if version is not None: - - _query_params.append(('version', version)) - + + _query_params.append(("version", version)) + # process the header parameters # process the form parameters # process the body parameter if trigger_workflow_run_request is not None: _body_params = trigger_workflow_run_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/v1/workflows/{workflow}/trigger", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def workflow_run_get_input( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, object]: + """Get workflow run input + + Get the input for a workflow run. + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_input_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def workflow_run_get_input_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, object]]: + """Get workflow run input + + Get the input for a workflow run. + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_input_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def workflow_run_get_input_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get workflow run input + + Get the input for a workflow run. + + :param tenant: The tenant id (required) + :type tenant: str + :param workflow_run: The workflow run id (required) + :type workflow_run: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_get_input_serialize( + tenant=tenant, + workflow_run=workflow_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _workflow_run_get_input_serialize( + self, + tenant, + workflow_run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + if workflow_run is not None: + _path_params["workflow-run"] = workflow_run + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/workflows/{workflow}/trigger', + method="GET", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/input", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -645,7 +975,302 @@ def _workflow_run_create_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, + ) + + @validate_call + async def workflow_run_update_replay( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ReplayWorkflowRunsResponse: + """Replay workflow runs + + Replays a list of workflow runs. + + :param tenant: The tenant id (required) + :type tenant: str + :param replay_workflow_runs_request: The workflow run ids to replay (required) + :type replay_workflow_runs_request: ReplayWorkflowRunsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_update_replay_serialize( + tenant=tenant, + replay_workflow_runs_request=replay_workflow_runs_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def workflow_run_update_replay_with_http_info( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ReplayWorkflowRunsResponse]: + """Replay workflow runs + + Replays a list of workflow runs. + + :param tenant: The tenant id (required) + :type tenant: str + :param replay_workflow_runs_request: The workflow run ids to replay (required) + :type replay_workflow_runs_request: ReplayWorkflowRunsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_update_replay_serialize( + tenant=tenant, + replay_workflow_runs_request=replay_workflow_runs_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) + @validate_call + async def workflow_run_update_replay_without_preload_content( + self, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Replay workflow runs + Replays a list of workflow runs. + + :param tenant: The tenant id (required) + :type tenant: str + :param replay_workflow_runs_request: The workflow run ids to replay (required) + :type replay_workflow_runs_request: ReplayWorkflowRunsRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._workflow_run_update_replay_serialize( + tenant=tenant, + replay_workflow_runs_request=replay_workflow_runs_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", + } + response_data = await self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _workflow_run_update_replay_serialize( + self, + tenant, + replay_workflow_runs_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tenant is not None: + _path_params["tenant"] = tenant + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if replay_workflow_runs_request is not None: + _body_params = replay_workflow_runs_request + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/hatchet_sdk/clients/rest/api/workflow_runs_api.py b/hatchet_sdk/clients/rest/api/workflow_runs_api.py index d2882acb..0572380b 100644 --- a/hatchet_sdk/clients/rest/api/workflow_runs_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_runs_api.py @@ -12,18 +12,19 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field -from typing import Any, Dict +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( + ReplayWorkflowRunsRequest, +) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( + ReplayWorkflowRunsResponse, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -39,18 +40,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def workflow_run_get_input( self, - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -83,25 +90,24 @@ async def workflow_run_get_input( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, object]", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -109,18 +115,24 @@ async def workflow_run_get_input( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_get_input_with_http_info( self, - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -153,25 +165,24 @@ async def workflow_run_get_input_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, object]", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -179,18 +190,24 @@ async def workflow_run_get_input_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_get_input_without_preload_content( self, - workflow_run: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The workflow run id")], + workflow_run: Annotated[ + str, + Field( + min_length=36, + strict=True, + max_length=36, + description="The workflow run id", + ), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -223,29 +240,27 @@ async def workflow_run_get_input_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_get_input_serialize( workflow_run=workflow_run, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Dict[str, object]", - '400': "APIErrors", - '403': "APIErrors", - '404': "APIErrors", + "200": "Dict[str, object]", + "400": "APIErrors", + "403": "APIErrors", + "404": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_get_input_serialize( self, workflow_run, @@ -257,8 +272,7 @@ def _workflow_run_get_input_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -269,30 +283,23 @@ def _workflow_run_get_input_serialize( # process the path parameters if workflow_run is not None: - _path_params['workflow-run'] = workflow_run + _path_params["workflow-run"] = workflow_run # process the query parameters # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/workflow-runs/{workflow-run}/input', + method="GET", + resource_path="/api/v1/workflow-runs/{workflow-run}/input", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -302,24 +309,28 @@ def _workflow_run_get_input_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - - @validate_call async def workflow_run_update_replay( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -354,7 +365,7 @@ async def workflow_run_update_replay( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -362,18 +373,17 @@ async def workflow_run_update_replay( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReplayWorkflowRunsResponse", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -381,19 +391,25 @@ async def workflow_run_update_replay( response_types_map=_response_types_map, ).data - @validate_call async def workflow_run_update_replay_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -428,7 +444,7 @@ async def workflow_run_update_replay_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -436,18 +452,17 @@ async def workflow_run_update_replay_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReplayWorkflowRunsResponse", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -455,19 +470,25 @@ async def workflow_run_update_replay_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def workflow_run_update_replay_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - replay_workflow_runs_request: Annotated[ReplayWorkflowRunsRequest, Field(description="The workflow run ids to replay")], + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + replay_workflow_runs_request: Annotated[ + ReplayWorkflowRunsRequest, + Field(description="The workflow run ids to replay"), + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -502,7 +523,7 @@ async def workflow_run_update_replay_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._workflow_run_update_replay_serialize( tenant=tenant, @@ -510,22 +531,20 @@ async def workflow_run_update_replay_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReplayWorkflowRunsResponse", - '400': "APIErrors", - '403': "APIErrors", - '429': "APIErrors", + "200": "ReplayWorkflowRunsResponse", + "400": "APIErrors", + "403": "APIErrors", + "429": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _workflow_run_update_replay_serialize( self, tenant, @@ -538,8 +557,7 @@ def _workflow_run_update_replay_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -550,7 +568,7 @@ def _workflow_run_update_replay_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters # process the header parameters # process the form parameters @@ -558,37 +576,27 @@ def _workflow_run_update_replay_serialize( if replay_workflow_runs_request is not None: _body_params = replay_workflow_runs_request - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) # set the HTTP header `Content-Type` if _content_type: - _header_params['Content-Type'] = _content_type + _header_params["Content-Type"] = _content_type else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] ) if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/tenants/{tenant}/workflow-runs/replay', + method="POST", + resource_path="/api/v1/tenants/{tenant}/workflow-runs/replay", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -598,7 +606,5 @@ def _workflow_run_update_replay_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/api_client.py b/hatchet_sdk/clients/rest/api_client.py index 98f7847d..2980d8c1 100644 --- a/hatchet_sdk/clients/rest/api_client.py +++ b/hatchet_sdk/clients/rest/api_client.py @@ -13,34 +13,36 @@ import datetime -from dateutil.parser import parse -from enum import Enum import json import mimetypes import os import re import tempfile - +from enum import Enum +from typing import Dict, List, Optional, Tuple, Union from urllib.parse import quote -from typing import Tuple, Optional, List, Dict, Union + +from dateutil.parser import parse from pydantic import SecretStr -from hatchet_sdk.clients.rest.configuration import Configuration -from hatchet_sdk.clients.rest.api_response import ApiResponse, T as ApiResponseT import hatchet_sdk.clients.rest.models from hatchet_sdk.clients.rest import rest +from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.api_response import T as ApiResponseT +from hatchet_sdk.clients.rest.configuration import Configuration from hatchet_sdk.clients.rest.exceptions import ( - ApiValueError, ApiException, + ApiValueError, BadRequestException, - UnauthorizedException, ForbiddenException, NotFoundException, - ServiceException + ServiceException, + UnauthorizedException, ) RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + class ApiClient: """Generic API client for OpenAPI client library builds. @@ -59,23 +61,19 @@ class ApiClient: PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, # TODO remove as only py3 is supported? - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, } _pool = None def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None + self, configuration=None, header_name=None, header_value=None, cookie=None ) -> None: # use default configuration if none is provided if configuration is None: @@ -88,7 +86,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.user_agent = "OpenAPI-Generator/1.0.0/python" self.client_side_validation = configuration.client_side_validation async def __aenter__(self): @@ -103,16 +101,15 @@ async def close(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers['User-Agent'] + return self.default_headers["User-Agent"] @user_agent.setter def user_agent(self, value): - self.default_headers['User-Agent'] = value + self.default_headers["User-Agent"] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - _default = None @classmethod @@ -148,12 +145,12 @@ def param_serialize( header_params=None, body=None, post_params=None, - files=None, auth_settings=None, + files=None, + auth_settings=None, collection_formats=None, _host=None, - _request_auth=None + _request_auth=None, ) -> RequestSerialized: - """Builds the HTTP request params needed by the request. :param method: Method to call. :param resource_path: Path to method endpoint. @@ -182,35 +179,28 @@ def param_serialize( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params['Cookie'] = self.cookie + header_params["Cookie"] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) header_params = dict( - self.parameters_to_tuples(header_params,collection_formats) + self.parameters_to_tuples(header_params, collection_formats) ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples( - path_params, - collection_formats - ) + path_params = self.parameters_to_tuples(path_params, collection_formats) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) ) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples( - post_params, - collection_formats - ) + post_params = self.parameters_to_tuples(post_params, collection_formats) if files: post_params.extend(self.files_parameters(files)) @@ -222,7 +212,7 @@ def param_serialize( resource_path, method, body, - request_auth=_request_auth + request_auth=_request_auth, ) # body @@ -239,15 +229,11 @@ def param_serialize( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query( - query_params, - collection_formats - ) + url_query = self.parameters_to_url_query(query_params, collection_formats) url += "?" + url_query return method, url, header_params, body, post_params - async def call_api( self, method, @@ -255,7 +241,7 @@ async def call_api( header_params=None, body=None, post_params=None, - _request_timeout=None + _request_timeout=None, ) -> rest.RESTResponse: """Makes the HTTP request (synchronous) :param method: Method to call. @@ -272,10 +258,12 @@ async def call_api( try: # perform request and return response response_data = await self.rest_client.request( - method, url, + method, + url, headers=header_params, - body=body, post_params=post_params, - _request_timeout=_request_timeout + body=body, + post_params=post_params, + _request_timeout=_request_timeout, ) except ApiException as e: @@ -286,7 +274,7 @@ async def call_api( def response_deserialize( self, response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]]=None + response_types_map: Optional[Dict[str, ApiResponseT]] = None, ) -> ApiResponse[ApiResponseT]: """Deserializes response into an object. :param response_data: RESTResponse object to be deserialized. @@ -298,9 +286,15 @@ def response_deserialize( assert response_data.data is not None, msg response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) # deserialize response data response_text = None @@ -312,13 +306,15 @@ def response_deserialize( return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader('content-type') + content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) if response_type in ["bytearray", "str"]: - return_data = self.__deserialize_primitive(response_text, response_type) + return_data = self.__deserialize_primitive( + response_text, response_type + ) else: return_data = self.deserialize(response_text, response_type) finally: @@ -330,10 +326,10 @@ def response_deserialize( ) return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, ) def sanitize_for_serialization(self, obj): @@ -360,13 +356,9 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [ - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ] + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] elif isinstance(obj, tuple): - return tuple( - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ) + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() @@ -378,14 +370,13 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): obj_dict = obj.to_dict() else: obj_dict = obj.__dict__ return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() + key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } def deserialize(self, response_text, response_type): @@ -418,19 +409,17 @@ def __deserialize(self, data, klass): return None if isinstance(klass, str): - if klass.startswith('List['): - m = re.match(r'List\[(.*)]', klass) + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) assert m is not None, "Malformed List type definition" sub_kls = m.group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] - if klass.startswith('Dict['): - m = re.match(r'Dict\[([^,]*), (.*)]', klass) + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) assert m is not None, "Malformed Dict type definition" sub_kls = m.group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -464,19 +453,18 @@ def parameters_to_tuples(self, params, collection_formats): for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, value) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -501,17 +489,17 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, str(value)) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' + delimiter = "," new_params.append( (k, delimiter.join(quote(str(value)) for value in v)) ) @@ -529,7 +517,7 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): params = [] for k, v in files.items(): if isinstance(v, str): - with open(v, 'rb') as f: + with open(v, "rb") as f: filename = os.path.basename(f.name) filedata = f.read() elif isinstance(v, bytes): @@ -537,13 +525,8 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): filedata = v else: raise ValueError("Unsupported file value") - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -556,7 +539,7 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: return None for accept in accepts: - if re.search('json', accept, re.IGNORECASE): + if re.search("json", accept, re.IGNORECASE): return accept return accepts[0] @@ -571,7 +554,7 @@ def select_header_content_type(self, content_types): return None for content_type in content_types: - if re.search('json', content_type, re.IGNORECASE): + if re.search("json", content_type, re.IGNORECASE): return content_type return content_types[0] @@ -584,7 +567,7 @@ def update_params_for_auth( resource_path, method, body, - request_auth=None + request_auth=None, ) -> None: """Updates header and query params based on authentication setting. @@ -603,34 +586,18 @@ def update_params_for_auth( if request_auth: self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - request_auth + headers, queries, resource_path, method, body, request_auth ) else: for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - auth_setting + headers, queries, resource_path, method, body, auth_setting ) def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting + self, headers, queries, resource_path, method, body, auth_setting ) -> None: """Updates the request parameters based on a single auth_setting @@ -642,17 +609,15 @@ def _apply_auth_params( The object type is the return value of sanitize_for_serialization(). :param auth_setting: auth settings for the endpoint """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + raise ApiValueError("Authentication token must be in `query` or `header`") def __deserialize_file(self, response): """Deserializes body to file @@ -672,10 +637,7 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - m = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition - ) + m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) assert m is not None, "Unexpected 'content-disposition' header value" filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) @@ -719,8 +681,7 @@ def __deserialize_date(self, string): return string except ValueError: raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) + status=0, reason="Failed to parse `{0}` as date object".format(string) ) def __deserialize_datetime(self, string): @@ -738,10 +699,7 @@ def __deserialize_datetime(self, string): except ValueError: raise rest.ApiException( status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) + reason=("Failed to parse `{0}` as datetime object".format(string)), ) def __deserialize_enum(self, data, klass): @@ -755,11 +713,7 @@ def __deserialize_enum(self, data, klass): return klass(data) except ValueError: raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as `{1}`" - .format(data, klass) - ) + status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) ) def __deserialize_model(self, data, klass): diff --git a/hatchet_sdk/clients/rest/api_response.py b/hatchet_sdk/clients/rest/api_response.py index 9bc7c11f..ca801da0 100644 --- a/hatchet_sdk/clients/rest/api_response.py +++ b/hatchet_sdk/clients/rest/api_response.py @@ -1,11 +1,14 @@ """API response object.""" from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel + +from typing import Generic, Mapping, Optional, TypeVar + +from pydantic import BaseModel, Field, StrictBytes, StrictInt T = TypeVar("T") + class ApiResponse(BaseModel, Generic[T]): """ API response object @@ -16,6 +19,4 @@ class ApiResponse(BaseModel, Generic[T]): data: T = Field(description="Deserialized data given the data type") raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - model_config = { - "arbitrary_types_allowed": True - } + model_config = {"arbitrary_types_allowed": True} diff --git a/hatchet_sdk/clients/rest/configuration.py b/hatchet_sdk/clients/rest/configuration.py index 1adb506c..e33efa68 100644 --- a/hatchet_sdk/clients/rest/configuration.py +++ b/hatchet_sdk/clients/rest/configuration.py @@ -13,81 +13,94 @@ import copy +import http.client as httplib import logging -from logging import FileHandler import sys +from logging import FileHandler from typing import Optional -import urllib3 -import http.client as httplib +import urllib3 JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", } + class Configuration: """This class contains various settings of the API client. - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = hatchet_sdk.clients.rest.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = hatchet_sdk.clients.rest.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default = None - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: - """Constructor - """ + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + username=None, + password=None, + access_token=None, + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor""" self._base_path = "http://localhost" if host is None else host """Default Base url """ @@ -130,7 +143,7 @@ def __init__(self, host=None, """ self.logger["package_logger"] = logging.getLogger("hatchet_sdk.clients.rest") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format """ self.logger_stream_handler = None @@ -179,7 +192,7 @@ def __init__(self, host=None, self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = "" """Safe chars for path_param """ self.retries = None @@ -205,7 +218,7 @@ def __deepcopy__(self, memo): result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): + if k not in ("logger", "logger_file_handler"): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -346,7 +359,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): """ if self.refresh_api_key_hook is not None: self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) if key: prefix = self.api_key_prefix.get(identifier) if prefix: @@ -365,9 +380,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) def auth_settings(self): """Gets Auth Settings dict for api client. @@ -376,19 +391,19 @@ def auth_settings(self): """ auth = {} if self.access_token is not None: - auth['bearerAuth'] = { - 'type': 'bearer', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token + auth["bearerAuth"] = { + "type": "bearer", + "in": "header", + "key": "Authorization", + "value": "Bearer " + self.access_token, } - if 'cookieAuth' in self.api_key: - auth['cookieAuth'] = { - 'type': 'api_key', - 'in': 'cookie', - 'key': 'hatchet', - 'value': self.get_api_key_with_prefix( - 'cookieAuth', + if "cookieAuth" in self.api_key: + auth["cookieAuth"] = { + "type": "api_key", + "in": "cookie", + "key": "hatchet", + "value": self.get_api_key_with_prefix( + "cookieAuth", ), } return auth @@ -398,12 +413,13 @@ def to_debug_report(self): :return: The report for debugging. """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: 1.0.0\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) def get_host_settings(self): """Gets an array of host settings @@ -412,8 +428,8 @@ def get_host_settings(self): """ return [ { - 'url': "", - 'description': "No description provided", + "url": "", + "description": "No description provided", } ] @@ -435,22 +451,22 @@ def get_host_from_settings(self, index, variables=None, servers=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) + "Must be less than {1}".format(index, len(servers)) + ) - url = server['url'] + url = server["url"] # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: + if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) + variable_name, variables[variable_name], variable["enum_values"] + ) + ) url = url.replace("{" + variable_name + "}", used_value) @@ -459,7 +475,9 @@ def get_host_from_settings(self, index, variables=None, servers=None): @property def host(self): """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) @host.setter def host(self, value): diff --git a/hatchet_sdk/clients/rest/exceptions.py b/hatchet_sdk/clients/rest/exceptions.py index 205c95b6..b41ac1d2 100644 --- a/hatchet_sdk/clients/rest/exceptions.py +++ b/hatchet_sdk/clients/rest/exceptions.py @@ -12,16 +12,19 @@ """ # noqa: E501 from typing import Any, Optional + from typing_extensions import Self + class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None) -> None: - """ Raises an exception for TypeErrors + def __init__( + self, msg, path_to_item=None, valid_classes=None, key_type=None + ) -> None: + """Raises an exception for TypeErrors Args: msg (str): the exception message @@ -104,9 +107,9 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): def __init__( - self, - status=None, - reason=None, + self, + status=None, + reason=None, http_resp=None, *, body: Optional[str] = None, @@ -125,17 +128,17 @@ def __init__( self.reason = http_resp.reason if self.body is None: try: - self.body = http_resp.data.decode('utf-8') + self.body = http_resp.data.decode("utf-8") except Exception: pass self.headers = http_resp.getheaders() @classmethod def from_response( - cls, - *, - http_resp, - body: Optional[str], + cls, + *, + http_resp, + body: Optional[str], data: Optional[Any], ) -> Self: if http_resp.status == 400: @@ -156,11 +159,9 @@ def from_response( def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) + error_message += "HTTP response headers: {0}\n".format(self.headers) if self.data or self.body: error_message += "HTTP response body: {0}\n".format(self.data or self.body) diff --git a/hatchet_sdk/clients/rest/models/__init__.py b/hatchet_sdk/clients/rest/models/__init__.py index c7f32da1..9c550c2e 100644 --- a/hatchet_sdk/clients/rest/models/__init__.py +++ b/hatchet_sdk/clients/rest/models/__init__.py @@ -13,6 +13,8 @@ """ # noqa: E501 +from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest + # import models into model package from hatchet_sdk.clients.rest.models.api_error import APIError from hatchet_sdk.clients.rest.models.api_errors import APIErrors @@ -22,48 +24,93 @@ from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.api_token import APIToken -from hatchet_sdk.clients.rest.models.accept_invite_request import AcceptInviteRequest -from hatchet_sdk.clients.rest.models.create_api_token_request import CreateAPITokenRequest -from hatchet_sdk.clients.rest.models.create_api_token_response import CreateAPITokenResponse +from hatchet_sdk.clients.rest.models.bulk_create_event_request import ( + BulkCreateEventRequest, +) +from hatchet_sdk.clients.rest.models.bulk_create_event_response import ( + BulkCreateEventResponse, +) +from hatchet_sdk.clients.rest.models.cancel_event_request import CancelEventRequest +from hatchet_sdk.clients.rest.models.create_api_token_request import ( + CreateAPITokenRequest, +) +from hatchet_sdk.clients.rest.models.create_api_token_response import ( + CreateAPITokenResponse, +) from hatchet_sdk.clients.rest.models.create_event_request import CreateEventRequest -from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import CreatePullRequestFromStepRun -from hatchet_sdk.clients.rest.models.create_sns_integration_request import CreateSNSIntegrationRequest -from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import CreateTenantAlertEmailGroupRequest -from hatchet_sdk.clients.rest.models.create_tenant_invite_request import CreateTenantInviteRequest +from hatchet_sdk.clients.rest.models.create_pull_request_from_step_run import ( + CreatePullRequestFromStepRun, +) +from hatchet_sdk.clients.rest.models.create_sns_integration_request import ( + CreateSNSIntegrationRequest, +) +from hatchet_sdk.clients.rest.models.create_tenant_alert_email_group_request import ( + CreateTenantAlertEmailGroupRequest, +) +from hatchet_sdk.clients.rest.models.create_tenant_invite_request import ( + CreateTenantInviteRequest, +) from hatchet_sdk.clients.rest.models.create_tenant_request import CreateTenantRequest from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.event_data import EventData from hatchet_sdk.clients.rest.models.event_key_list import EventKeyList from hatchet_sdk.clients.rest.models.event_list import EventList -from hatchet_sdk.clients.rest.models.event_order_by_direction import EventOrderByDirection +from hatchet_sdk.clients.rest.models.event_order_by_direction import ( + EventOrderByDirection, +) from hatchet_sdk.clients.rest.models.event_order_by_field import EventOrderByField -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary -from hatchet_sdk.clients.rest.models.get_step_run_diff_response import GetStepRunDiffResponse +from hatchet_sdk.clients.rest.models.event_update_cancel200_response import ( + EventUpdateCancel200Response, +) +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( + EventWorkflowRunSummary, +) +from hatchet_sdk.clients.rest.models.get_step_run_diff_response import ( + GetStepRunDiffResponse, +) from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run import JobRun from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus -from hatchet_sdk.clients.rest.models.list_api_tokens_response import ListAPITokensResponse -from hatchet_sdk.clients.rest.models.list_pull_requests_response import ListPullRequestsResponse -from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations +from hatchet_sdk.clients.rest.models.list_api_tokens_response import ( + ListAPITokensResponse, +) +from hatchet_sdk.clients.rest.models.list_pull_requests_response import ( + ListPullRequestsResponse, +) from hatchet_sdk.clients.rest.models.list_slack_webhooks import ListSlackWebhooks +from hatchet_sdk.clients.rest.models.list_sns_integrations import ListSNSIntegrations from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.log_line_level import LogLineLevel from hatchet_sdk.clients.rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.rest.models.log_line_order_by_direction import LogLineOrderByDirection +from hatchet_sdk.clients.rest.models.log_line_order_by_direction import ( + LogLineOrderByDirection, +) from hatchet_sdk.clients.rest.models.log_line_order_by_field import LogLineOrderByField from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.pull_request import PullRequest from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics +from hatchet_sdk.clients.rest.models.rate_limit import RateLimit +from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList +from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import ( + RateLimitOrderByDirection, +) +from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import ( + RateLimitOrderByField, +) from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.reject_invite_request import RejectInviteRequest from hatchet_sdk.clients.rest.models.replay_event_request import ReplayEventRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ReplayWorkflowRunsRequest -from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ReplayWorkflowRunsResponse +from hatchet_sdk.clients.rest.models.replay_workflow_runs_request import ( + ReplayWorkflowRunsRequest, +) +from hatchet_sdk.clients.rest.models.replay_workflow_runs_response import ( + ReplayWorkflowRunsResponse, +) from hatchet_sdk.clients.rest.models.rerun_step_run_request import RerunStepRunRequest -from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook +from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive @@ -75,9 +122,15 @@ from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus from hatchet_sdk.clients.rest.models.tenant import Tenant -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup -from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import TenantAlertEmailGroupList -from hatchet_sdk.clients.rest.models.tenant_alerting_settings import TenantAlertingSettings +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( + TenantAlertEmailGroup, +) +from hatchet_sdk.clients.rest.models.tenant_alert_email_group_list import ( + TenantAlertEmailGroupList, +) +from hatchet_sdk.clients.rest.models.tenant_alerting_settings import ( + TenantAlertingSettings, +) from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite from hatchet_sdk.clients.rest.models.tenant_invite_list import TenantInviteList from hatchet_sdk.clients.rest.models.tenant_list import TenantList @@ -88,25 +141,48 @@ from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit from hatchet_sdk.clients.rest.models.tenant_resource_policy import TenantResourcePolicy -from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import TriggerWorkflowRunRequest -from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import UpdateTenantAlertEmailGroupRequest -from hatchet_sdk.clients.rest.models.update_tenant_invite_request import UpdateTenantInviteRequest +from hatchet_sdk.clients.rest.models.tenant_step_run_queue_metrics import ( + TenantStepRunQueueMetrics, +) +from hatchet_sdk.clients.rest.models.trigger_workflow_run_request import ( + TriggerWorkflowRunRequest, +) +from hatchet_sdk.clients.rest.models.update_tenant_alert_email_group_request import ( + UpdateTenantAlertEmailGroupRequest, +) +from hatchet_sdk.clients.rest.models.update_tenant_invite_request import ( + UpdateTenantInviteRequest, +) from hatchet_sdk.clients.rest.models.update_tenant_request import UpdateTenantRequest from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest from hatchet_sdk.clients.rest.models.user import User -from hatchet_sdk.clients.rest.models.user_change_password_request import UserChangePasswordRequest +from hatchet_sdk.clients.rest.models.user_change_password_request import ( + UserChangePasswordRequest, +) from hatchet_sdk.clients.rest.models.user_login_request import UserLoginRequest from hatchet_sdk.clients.rest.models.user_register_request import UserRegisterRequest -from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import UserTenantMembershipsList +from hatchet_sdk.clients.rest.models.user_tenant_memberships_list import ( + UserTenantMembershipsList, +) from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker -from hatchet_sdk.clients.rest.models.webhook_worker_create_request import WebhookWorkerCreateRequest -from hatchet_sdk.clients.rest.models.webhook_worker_create_response import WebhookWorkerCreateResponse +from hatchet_sdk.clients.rest.models.webhook_worker_create_request import ( + WebhookWorkerCreateRequest, +) +from hatchet_sdk.clients.rest.models.webhook_worker_create_response import ( + WebhookWorkerCreateResponse, +) from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from hatchet_sdk.clients.rest.models.webhook_worker_list_response import WebhookWorkerListResponse +from hatchet_sdk.clients.rest.models.webhook_worker_list_response import ( + WebhookWorkerListResponse, +) from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest -from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import WebhookWorkerRequestListResponse -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod +from hatchet_sdk.clients.rest.models.webhook_worker_request_list_response import ( + WebhookWorkerRequestListResponse, +) +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( + WebhookWorkerRequestMethod, +) from hatchet_sdk.clients.rest.models.worker import Worker from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel from hatchet_sdk.clients.rest.models.worker_list import WorkerList @@ -116,19 +192,39 @@ from hatchet_sdk.clients.rest.models.workflow_list import WorkflowList from hatchet_sdk.clients.rest.models.workflow_metrics import WorkflowMetrics from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from hatchet_sdk.clients.rest.models.workflow_run_cancel200_response import WorkflowRunCancel200Response from hatchet_sdk.clients.rest.models.workflow_run_list import WorkflowRunList -from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import WorkflowRunOrderByDirection -from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import WorkflowRunOrderByField +from hatchet_sdk.clients.rest.models.workflow_run_order_by_direction import ( + WorkflowRunOrderByDirection, +) +from hatchet_sdk.clients.rest.models.workflow_run_order_by_field import ( + WorkflowRunOrderByField, +) +from hatchet_sdk.clients.rest.models.workflow_run_shape import WorkflowRunShape from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy -from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import WorkflowRunsCancelRequest +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( + WorkflowRunTriggeredBy, +) +from hatchet_sdk.clients.rest.models.workflow_runs_cancel_request import ( + WorkflowRunsCancelRequest, +) from hatchet_sdk.clients.rest.models.workflow_runs_metrics import WorkflowRunsMetrics -from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import WorkflowRunsMetricsCounts +from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( + WorkflowRunsMetricsCounts, +) from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( + WorkflowTriggerCronRef, +) +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( + WorkflowTriggerEventRef, +) from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers +from hatchet_sdk.clients.rest.models.workflow_update_request import ( + WorkflowUpdateRequest, +) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.rest.models.workflow_version_definition import WorkflowVersionDefinition +from hatchet_sdk.clients.rest.models.workflow_version_definition import ( + WorkflowVersionDefinition, +) from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta +from hatchet_sdk.clients.rest.models.workflow_workers_count import WorkflowWorkersCount diff --git a/hatchet_sdk/clients/rest/models/accept_invite_request.py b/hatchet_sdk/clients/rest/models/accept_invite_request.py index 160dd123..241bff8a 100644 --- a/hatchet_sdk/clients/rest/models/accept_invite_request.py +++ b/hatchet_sdk/clients/rest/models/accept_invite_request.py @@ -13,20 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class AcceptInviteRequest(BaseModel): """ AcceptInviteRequest - """ # noqa: E501 + """ # noqa: E501 + invite: Annotated[str, Field(min_length=36, strict=True, max_length=36)] __properties: ClassVar[List[str]] = ["invite"] @@ -36,7 +37,6 @@ class AcceptInviteRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "invite": obj.get("invite") - }) + _obj = cls.model_validate({"invite": obj.get("invite")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_error.py b/hatchet_sdk/clients/rest/models/api_error.py index bb448b2d..64edc80f 100644 --- a/hatchet_sdk/clients/rest/models/api_error.py +++ b/hatchet_sdk/clients/rest/models/api_error.py @@ -13,23 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class APIError(BaseModel): """ APIError - """ # noqa: E501 - code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") - var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") + """ # noqa: E501 + + code: Optional[StrictInt] = Field( + default=None, description="a custom Hatchet error code" + ) + var_field: Optional[StrictStr] = Field( + default=None, + description="the field that this error is associated with, if applicable", + alias="field", + ) description: StrictStr = Field(description="a description for this error") - docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") + docs_link: Optional[StrictStr] = Field( + default=None, + description="a link to the documentation for this error, if it exists", + ) __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] model_config = ConfigDict( @@ -38,7 +49,6 @@ class APIError(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "code": obj.get("code"), - "field": obj.get("field"), - "description": obj.get("description"), - "docs_link": obj.get("docs_link") - }) + _obj = cls.model_validate( + { + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_errors.py b/hatchet_sdk/clients/rest/models/api_errors.py index 9a8e58c2..e41cf5fc 100644 --- a/hatchet_sdk/clients/rest/models/api_errors.py +++ b/hatchet_sdk/clients/rest/models/api_errors.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.api_error import APIError -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_error import APIError + + class APIErrors(BaseModel): """ APIErrors - """ # noqa: E501 + """ # noqa: E501 + errors: List[APIError] __properties: ClassVar[List[str]] = ["errors"] @@ -36,7 +39,6 @@ class APIErrors(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.errors: if _item: _items.append(_item.to_dict()) - _dict['errors'] = _items + _dict["errors"] = _items return _dict @classmethod @@ -87,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "errors": [APIError.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None - }) + _obj = cls.model_validate( + { + "errors": ( + [APIError.from_dict(_item) for _item in obj["errors"]] + if obj.get("errors") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_meta.py b/hatchet_sdk/clients/rest/models/api_meta.py index c1b2d427..93c17f05 100644 --- a/hatchet_sdk/clients/rest/models/api_meta.py +++ b/hatchet_sdk/clients/rest/models/api_meta.py @@ -13,29 +13,60 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_meta_auth import APIMetaAuth from hatchet_sdk.clients.rest.models.api_meta_posthog import APIMetaPosthog -from typing import Optional, Set -from typing_extensions import Self + class APIMeta(BaseModel): """ APIMeta - """ # noqa: E501 + """ # noqa: E501 + auth: Optional[APIMetaAuth] = None - pylon_app_id: Optional[StrictStr] = Field(default=None, description="the Pylon app ID for usepylon.com chat support", alias="pylonAppId") + pylon_app_id: Optional[StrictStr] = Field( + default=None, + description="the Pylon app ID for usepylon.com chat support", + alias="pylonAppId", + ) posthog: Optional[APIMetaPosthog] = None - allow_signup: Optional[StrictBool] = Field(default=None, description="whether or not users can sign up for this instance", alias="allowSignup") - allow_invites: Optional[StrictBool] = Field(default=None, description="whether or not users can invite other users to this instance", alias="allowInvites") - allow_create_tenant: Optional[StrictBool] = Field(default=None, description="whether or not users can create new tenants", alias="allowCreateTenant") - allow_change_password: Optional[StrictBool] = Field(default=None, description="whether or not users can change their password", alias="allowChangePassword") - __properties: ClassVar[List[str]] = ["auth", "pylonAppId", "posthog", "allowSignup", "allowInvites", "allowCreateTenant", "allowChangePassword"] + allow_signup: Optional[StrictBool] = Field( + default=None, + description="whether or not users can sign up for this instance", + alias="allowSignup", + ) + allow_invites: Optional[StrictBool] = Field( + default=None, + description="whether or not users can invite other users to this instance", + alias="allowInvites", + ) + allow_create_tenant: Optional[StrictBool] = Field( + default=None, + description="whether or not users can create new tenants", + alias="allowCreateTenant", + ) + allow_change_password: Optional[StrictBool] = Field( + default=None, + description="whether or not users can change their password", + alias="allowChangePassword", + ) + __properties: ClassVar[List[str]] = [ + "auth", + "pylonAppId", + "posthog", + "allowSignup", + "allowInvites", + "allowCreateTenant", + "allowChangePassword", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +74,6 @@ class APIMeta(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +98,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,10 +107,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of auth if self.auth: - _dict['auth'] = self.auth.to_dict() + _dict["auth"] = self.auth.to_dict() # override the default output from pydantic by calling `to_dict()` of posthog if self.posthog: - _dict['posthog'] = self.posthog.to_dict() + _dict["posthog"] = self.posthog.to_dict() return _dict @classmethod @@ -93,15 +122,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "auth": APIMetaAuth.from_dict(obj["auth"]) if obj.get("auth") is not None else None, - "pylonAppId": obj.get("pylonAppId"), - "posthog": APIMetaPosthog.from_dict(obj["posthog"]) if obj.get("posthog") is not None else None, - "allowSignup": obj.get("allowSignup"), - "allowInvites": obj.get("allowInvites"), - "allowCreateTenant": obj.get("allowCreateTenant"), - "allowChangePassword": obj.get("allowChangePassword") - }) + _obj = cls.model_validate( + { + "auth": ( + APIMetaAuth.from_dict(obj["auth"]) + if obj.get("auth") is not None + else None + ), + "pylonAppId": obj.get("pylonAppId"), + "posthog": ( + APIMetaPosthog.from_dict(obj["posthog"]) + if obj.get("posthog") is not None + else None + ), + "allowSignup": obj.get("allowSignup"), + "allowInvites": obj.get("allowInvites"), + "allowCreateTenant": obj.get("allowCreateTenant"), + "allowChangePassword": obj.get("allowChangePassword"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_meta_auth.py b/hatchet_sdk/clients/rest/models/api_meta_auth.py index b2c2d6dc..5ca29092 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_auth.py +++ b/hatchet_sdk/clients/rest/models/api_meta_auth.py @@ -13,20 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class APIMetaAuth(BaseModel): """ APIMetaAuth - """ # noqa: E501 - schemes: Optional[List[StrictStr]] = Field(default=None, description="the supported types of authentication") + """ # noqa: E501 + + schemes: Optional[List[StrictStr]] = Field( + default=None, description="the supported types of authentication" + ) __properties: ClassVar[List[str]] = ["schemes"] model_config = ConfigDict( @@ -35,7 +39,6 @@ class APIMetaAuth(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "schemes": obj.get("schemes") - }) + _obj = cls.model_validate({"schemes": obj.get("schemes")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_meta_integration.py b/hatchet_sdk/clients/rest/models/api_meta_integration.py index 136c4dd9..f4f361c9 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_integration.py +++ b/hatchet_sdk/clients/rest/models/api_meta_integration.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class APIMetaIntegration(BaseModel): """ APIMetaIntegration - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="the name of the integration") - enabled: StrictBool = Field(description="whether this integration is enabled on the instance") + enabled: StrictBool = Field( + description="whether this integration is enabled on the instance" + ) __properties: ClassVar[List[str]] = ["name", "enabled"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class APIMetaIntegration(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "enabled": obj.get("enabled") - }) + _obj = cls.model_validate( + {"name": obj.get("name"), "enabled": obj.get("enabled")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_meta_posthog.py b/hatchet_sdk/clients/rest/models/api_meta_posthog.py index 2fadf327..da6052c2 100644 --- a/hatchet_sdk/clients/rest/models/api_meta_posthog.py +++ b/hatchet_sdk/clients/rest/models/api_meta_posthog.py @@ -13,21 +13,27 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class APIMetaPosthog(BaseModel): """ APIMetaPosthog - """ # noqa: E501 - api_key: Optional[StrictStr] = Field(default=None, description="the PostHog API key", alias="apiKey") - api_host: Optional[StrictStr] = Field(default=None, description="the PostHog API host", alias="apiHost") + """ # noqa: E501 + + api_key: Optional[StrictStr] = Field( + default=None, description="the PostHog API key", alias="apiKey" + ) + api_host: Optional[StrictStr] = Field( + default=None, description="the PostHog API host", alias="apiHost" + ) __properties: ClassVar[List[str]] = ["apiKey", "apiHost"] model_config = ConfigDict( @@ -36,7 +42,6 @@ class APIMetaPosthog(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +84,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "apiKey": obj.get("apiKey"), - "apiHost": obj.get("apiHost") - }) + _obj = cls.model_validate( + {"apiKey": obj.get("apiKey"), "apiHost": obj.get("apiHost")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_resource_meta.py b/hatchet_sdk/clients/rest/models/api_resource_meta.py index 28dd305a..8c353248 100644 --- a/hatchet_sdk/clients/rest/models/api_resource_meta.py +++ b/hatchet_sdk/clients/rest/models/api_resource_meta.py @@ -13,24 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class APIResourceMeta(BaseModel): """ APIResourceMeta - """ # noqa: E501 - id: Annotated[str, Field(min_length=0, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") - created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") - updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") + """ # noqa: E501 + + id: Annotated[str, Field(min_length=0, strict=True, max_length=36)] = Field( + description="the id of this resource, in UUID format" + ) + created_at: datetime = Field( + description="the time that this resource was created", alias="createdAt" + ) + updated_at: datetime = Field( + description="the time that this resource was last updated", alias="updatedAt" + ) __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] model_config = ConfigDict( @@ -39,7 +46,6 @@ class APIResourceMeta(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,11 +88,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "createdAt": obj.get("createdAt"), - "updatedAt": obj.get("updatedAt") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/api_token.py b/hatchet_sdk/clients/rest/models/api_token.py index 906666f4..e469e3af 100644 --- a/hatchet_sdk/clients/rest/models/api_token.py +++ b/hatchet_sdk/clients/rest/models/api_token.py @@ -13,25 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated +from typing_extensions import Annotated, Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set -from typing_extensions import Self + class APIToken(BaseModel): """ APIToken - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The name of the API token.") - expires_at: datetime = Field(description="When the API token expires.", alias="expiresAt") + name: Annotated[str, Field(strict=True, max_length=255)] = Field( + description="The name of the API token." + ) + expires_at: datetime = Field( + description="When the API token expires.", alias="expiresAt" + ) __properties: ClassVar[List[str]] = ["metadata", "name", "expiresAt"] model_config = ConfigDict( @@ -40,7 +46,6 @@ class APIToken(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +79,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -87,11 +91,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "expiresAt": obj.get("expiresAt") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "expiresAt": obj.get("expiresAt"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/bulk_create_event_request.py b/hatchet_sdk/clients/rest/models/bulk_create_event_request.py index 8d08d394..2c053ee1 100644 --- a/hatchet_sdk/clients/rest/models/bulk_create_event_request.py +++ b/hatchet_sdk/clients/rest/models/bulk_create_event_request.py @@ -73,9 +73,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: - for _item_events in self.events: - if _item_events: - _items.append(_item_events.to_dict()) + for _item in self.events: + if _item: + _items.append(_item.to_dict()) _dict["events"] = _items return _dict diff --git a/hatchet_sdk/clients/rest/models/bulk_create_event_response.py b/hatchet_sdk/clients/rest/models/bulk_create_event_response.py index fd084252..5fd1f3a1 100644 --- a/hatchet_sdk/clients/rest/models/bulk_create_event_response.py +++ b/hatchet_sdk/clients/rest/models/bulk_create_event_response.py @@ -24,7 +24,6 @@ from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.event import Event -from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse class BulkCreateEventResponse(BaseModel): @@ -34,8 +33,7 @@ class BulkCreateEventResponse(BaseModel): metadata: APIResourceMeta events: List[Event] = Field(description="The events.") - pagination: PaginationResponse = Field(description="The pagination information.") - __properties: ClassVar[List[str]] = ["metadata", "events", "pagination"] + __properties: ClassVar[List[str]] = ["metadata", "events"] model_config = ConfigDict( populate_by_name=True, @@ -80,13 +78,10 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: - for _item_events in self.events: - if _item_events: - _items.append(_item_events.to_dict()) + for _item in self.events: + if _item: + _items.append(_item.to_dict()) _dict["events"] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -110,11 +105,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("events") is not None else None ), - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), } ) return _obj diff --git a/hatchet_sdk/clients/rest/models/create_api_token_request.py b/hatchet_sdk/clients/rest/models/create_api_token_request.py index 0abb7afa..5614ef0a 100644 --- a/hatchet_sdk/clients/rest/models/create_api_token_request.py +++ b/hatchet_sdk/clients/rest/models/create_api_token_request.py @@ -13,22 +13,29 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class CreateAPITokenRequest(BaseModel): """ CreateAPITokenRequest - """ # noqa: E501 - name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="A name for the API token.") - expires_in: Optional[StrictStr] = Field(default=None, description="The duration for which the token is valid.", alias="expiresIn") + """ # noqa: E501 + + name: Annotated[str, Field(strict=True, max_length=255)] = Field( + description="A name for the API token." + ) + expires_in: Optional[StrictStr] = Field( + default=None, + description="The duration for which the token is valid.", + alias="expiresIn", + ) __properties: ClassVar[List[str]] = ["name", "expiresIn"] model_config = ConfigDict( @@ -37,7 +44,6 @@ class CreateAPITokenRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +68,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,10 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "expiresIn": obj.get("expiresIn") - }) + _obj = cls.model_validate( + {"name": obj.get("name"), "expiresIn": obj.get("expiresIn")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_api_token_response.py b/hatchet_sdk/clients/rest/models/create_api_token_response.py index c854d88a..2fb1e62d 100644 --- a/hatchet_sdk/clients/rest/models/create_api_token_response.py +++ b/hatchet_sdk/clients/rest/models/create_api_token_response.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreateAPITokenResponse(BaseModel): """ CreateAPITokenResponse - """ # noqa: E501 + """ # noqa: E501 + token: StrictStr = Field(description="The API token.") __properties: ClassVar[List[str]] = ["token"] @@ -35,7 +37,6 @@ class CreateAPITokenResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "token": obj.get("token") - }) + _obj = cls.model_validate({"token": obj.get("token")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_event_request.py b/hatchet_sdk/clients/rest/models/create_event_request.py index 48e3f5be..adc37ce6 100644 --- a/hatchet_sdk/clients/rest/models/create_event_request.py +++ b/hatchet_sdk/clients/rest/models/create_event_request.py @@ -13,22 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class CreateEventRequest(BaseModel): """ CreateEventRequest - """ # noqa: E501 + """ # noqa: E501 + key: StrictStr = Field(description="The key for the event.") data: Dict[str, Any] = Field(description="The data for the event.") - additional_metadata: Optional[Dict[str, Any]] = Field(default=None, description="Additional metadata for the event.", alias="additionalMetadata") + additional_metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Additional metadata for the event.", + alias="additionalMetadata", + ) __properties: ClassVar[List[str]] = ["key", "data", "additionalMetadata"] model_config = ConfigDict( @@ -37,7 +43,6 @@ class CreateEventRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "key": obj.get("key"), - "data": obj.get("data"), - "additionalMetadata": obj.get("additionalMetadata") - }) + _obj = cls.model_validate( + { + "key": obj.get("key"), + "data": obj.get("data"), + "additionalMetadata": obj.get("additionalMetadata"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py b/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py index 83bdd86b..0984ff06 100644 --- a/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py +++ b/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreatePullRequestFromStepRun(BaseModel): """ CreatePullRequestFromStepRun - """ # noqa: E501 + """ # noqa: E501 + branch_name: StrictStr = Field(alias="branchName") __properties: ClassVar[List[str]] = ["branchName"] @@ -35,7 +37,6 @@ class CreatePullRequestFromStepRun(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "branchName": obj.get("branchName") - }) + _obj = cls.model_validate({"branchName": obj.get("branchName")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_sns_integration_request.py b/hatchet_sdk/clients/rest/models/create_sns_integration_request.py index 6493f16f..ddb76cd1 100644 --- a/hatchet_sdk/clients/rest/models/create_sns_integration_request.py +++ b/hatchet_sdk/clients/rest/models/create_sns_integration_request.py @@ -13,20 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreateSNSIntegrationRequest(BaseModel): """ CreateSNSIntegrationRequest - """ # noqa: E501 - topic_arn: StrictStr = Field(description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn") + """ # noqa: E501 + + topic_arn: StrictStr = Field( + description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn" + ) __properties: ClassVar[List[str]] = ["topicArn"] model_config = ConfigDict( @@ -35,7 +39,6 @@ class CreateSNSIntegrationRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "topicArn": obj.get("topicArn") - }) + _obj = cls.model_validate({"topicArn": obj.get("topicArn")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py b/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py index e13ac4e7..bc3a6953 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreateTenantAlertEmailGroupRequest(BaseModel): """ CreateTenantAlertEmailGroupRequest - """ # noqa: E501 + """ # noqa: E501 + emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["emails"] @@ -35,7 +37,6 @@ class CreateTenantAlertEmailGroupRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "emails": obj.get("emails") - }) + _obj = cls.model_validate({"emails": obj.get("emails")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py b/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py index 58951fd3..83450b48 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole + + class CreateTenantInviteRequest(BaseModel): """ CreateTenantInviteRequest - """ # noqa: E501 + """ # noqa: E501 + email: StrictStr = Field(description="The email of the user to invite.") role: TenantMemberRole = Field(description="The role of the user in the tenant.") __properties: ClassVar[List[str]] = ["email", "role"] @@ -37,7 +40,6 @@ class CreateTenantInviteRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,10 +82,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "email": obj.get("email"), - "role": obj.get("role") - }) + _obj = cls.model_validate({"email": obj.get("email"), "role": obj.get("role")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/create_tenant_request.py b/hatchet_sdk/clients/rest/models/create_tenant_request.py index ec15b058..84946f57 100644 --- a/hatchet_sdk/clients/rest/models/create_tenant_request.py +++ b/hatchet_sdk/clients/rest/models/create_tenant_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class CreateTenantRequest(BaseModel): """ CreateTenantRequest - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the tenant.") slug: StrictStr = Field(description="The slug of the tenant.") __properties: ClassVar[List[str]] = ["name", "slug"] @@ -36,7 +38,6 @@ class CreateTenantRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "slug": obj.get("slug") - }) + _obj = cls.model_validate({"name": obj.get("name"), "slug": obj.get("slug")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/event.py b/hatchet_sdk/clients/rest/models/event.py index 60887c34..4838a3ec 100644 --- a/hatchet_sdk/clients/rest/models/event.py +++ b/hatchet_sdk/clients/rest/models/event.py @@ -13,29 +13,53 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.rest.models.event_workflow_run_summary import EventWorkflowRunSummary +from hatchet_sdk.clients.rest.models.event_workflow_run_summary import ( + EventWorkflowRunSummary, +) from hatchet_sdk.clients.rest.models.tenant import Tenant -from typing import Optional, Set -from typing_extensions import Self + class Event(BaseModel): """ Event - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta key: StrictStr = Field(description="The key for the event.") - tenant: Optional[Tenant] = Field(default=None, description="The tenant associated with this event.") - tenant_id: StrictStr = Field(description="The ID of the tenant associated with this event.", alias="tenantId") - workflow_run_summary: Optional[EventWorkflowRunSummary] = Field(default=None, description="The workflow run summary for this event.", alias="workflowRunSummary") - additional_metadata: Optional[Dict[str, Any]] = Field(default=None, description="Additional metadata for the event.", alias="additionalMetadata") - __properties: ClassVar[List[str]] = ["metadata", "key", "tenant", "tenantId", "workflowRunSummary", "additionalMetadata"] + tenant: Optional[Tenant] = Field( + default=None, description="The tenant associated with this event." + ) + tenant_id: StrictStr = Field( + description="The ID of the tenant associated with this event.", alias="tenantId" + ) + workflow_run_summary: Optional[EventWorkflowRunSummary] = Field( + default=None, + description="The workflow run summary for this event.", + alias="workflowRunSummary", + ) + additional_metadata: Optional[Dict[str, Any]] = Field( + default=None, + description="Additional metadata for the event.", + alias="additionalMetadata", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "key", + "tenant", + "tenantId", + "workflowRunSummary", + "additionalMetadata", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +67,6 @@ class Event(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +91,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,13 +100,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of tenant if self.tenant: - _dict['tenant'] = self.tenant.to_dict() + _dict["tenant"] = self.tenant.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_run_summary if self.workflow_run_summary: - _dict['workflowRunSummary'] = self.workflow_run_summary.to_dict() + _dict["workflowRunSummary"] = self.workflow_run_summary.to_dict() return _dict @classmethod @@ -96,14 +118,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "key": obj.get("key"), - "tenant": Tenant.from_dict(obj["tenant"]) if obj.get("tenant") is not None else None, - "tenantId": obj.get("tenantId"), - "workflowRunSummary": EventWorkflowRunSummary.from_dict(obj["workflowRunSummary"]) if obj.get("workflowRunSummary") is not None else None, - "additionalMetadata": obj.get("additionalMetadata") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "key": obj.get("key"), + "tenant": ( + Tenant.from_dict(obj["tenant"]) + if obj.get("tenant") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "workflowRunSummary": ( + EventWorkflowRunSummary.from_dict(obj["workflowRunSummary"]) + if obj.get("workflowRunSummary") is not None + else None + ), + "additionalMetadata": obj.get("additionalMetadata"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/event_data.py b/hatchet_sdk/clients/rest/models/event_data.py index 46b47c1e..eb0d6128 100644 --- a/hatchet_sdk/clients/rest/models/event_data.py +++ b/hatchet_sdk/clients/rest/models/event_data.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class EventData(BaseModel): """ EventData - """ # noqa: E501 + """ # noqa: E501 + data: StrictStr = Field(description="The data for the event (JSON bytes).") __properties: ClassVar[List[str]] = ["data"] @@ -35,7 +37,6 @@ class EventData(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "data": obj.get("data") - }) + _obj = cls.model_validate({"data": obj.get("data")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/event_key_list.py b/hatchet_sdk/clients/rest/models/event_key_list.py index f51733d9..c56595ae 100644 --- a/hatchet_sdk/clients/rest/models/event_key_list.py +++ b/hatchet_sdk/clients/rest/models/event_key_list.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse + + class EventKeyList(BaseModel): """ EventKeyList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[StrictStr]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -37,7 +40,6 @@ class EventKeyList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -84,10 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": obj.get("rows") - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": obj.get("rows"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/event_list.py b/hatchet_sdk/clients/rest/models/event_list.py index 6855428c..e12aa656 100644 --- a/hatchet_sdk/clients/rest/models/event_list.py +++ b/hatchet_sdk/clients/rest/models/event_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.event import Event from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class EventList(BaseModel): """ EventList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[Event]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class EventList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [Event.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [Event.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/event_order_by_direction.py b/hatchet_sdk/clients/rest/models/event_order_by_direction.py index 6af67b0f..24255e0d 100644 --- a/hatchet_sdk/clients/rest/models/event_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/event_order_by_direction.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class EventOrderByDirection(str, Enum): """ allowed enum values """ - ASC = 'asc' - DESC = 'desc' + ASC = "asc" + DESC = "desc" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of EventOrderByDirection from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/event_order_by_field.py b/hatchet_sdk/clients/rest/models/event_order_by_field.py index a053f559..da2193c3 100644 --- a/hatchet_sdk/clients/rest/models/event_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/event_order_by_field.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,11 +28,9 @@ class EventOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = 'createdAt' + CREATEDAT = "createdAt" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of EventOrderByField from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py b/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py index 1b9aaeee..83fb38d7 100644 --- a/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py +++ b/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py @@ -13,25 +13,43 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class EventWorkflowRunSummary(BaseModel): """ EventWorkflowRunSummary - """ # noqa: E501 - pending: Optional[StrictInt] = Field(default=None, description="The number of pending runs.") - running: Optional[StrictInt] = Field(default=None, description="The number of running runs.") - queued: Optional[StrictInt] = Field(default=None, description="The number of queued runs.") - succeeded: Optional[StrictInt] = Field(default=None, description="The number of succeeded runs.") - failed: Optional[StrictInt] = Field(default=None, description="The number of failed runs.") - __properties: ClassVar[List[str]] = ["pending", "running", "queued", "succeeded", "failed"] + """ # noqa: E501 + + pending: Optional[StrictInt] = Field( + default=None, description="The number of pending runs." + ) + running: Optional[StrictInt] = Field( + default=None, description="The number of running runs." + ) + queued: Optional[StrictInt] = Field( + default=None, description="The number of queued runs." + ) + succeeded: Optional[StrictInt] = Field( + default=None, description="The number of succeeded runs." + ) + failed: Optional[StrictInt] = Field( + default=None, description="The number of failed runs." + ) + __properties: ClassVar[List[str]] = [ + "pending", + "running", + "queued", + "succeeded", + "failed", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +57,6 @@ class EventWorkflowRunSummary(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +81,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,13 +99,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pending": obj.get("pending"), - "running": obj.get("running"), - "queued": obj.get("queued"), - "succeeded": obj.get("succeeded"), - "failed": obj.get("failed") - }) + _obj = cls.model_validate( + { + "pending": obj.get("pending"), + "running": obj.get("running"), + "queued": obj.get("queued"), + "succeeded": obj.get("succeeded"), + "failed": obj.get("failed"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py index 70666204..c01018b6 100644 --- a/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +++ b/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.step_run_diff import StepRunDiff -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.step_run_diff import StepRunDiff + + class GetStepRunDiffResponse(BaseModel): """ GetStepRunDiffResponse - """ # noqa: E501 + """ # noqa: E501 + diffs: List[StepRunDiff] __properties: ClassVar[List[str]] = ["diffs"] @@ -36,7 +39,6 @@ class GetStepRunDiffResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.diffs: if _item: _items.append(_item.to_dict()) - _dict['diffs'] = _items + _dict["diffs"] = _items return _dict @classmethod @@ -87,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "diffs": [StepRunDiff.from_dict(_item) for _item in obj["diffs"]] if obj.get("diffs") is not None else None - }) + _obj = cls.model_validate( + { + "diffs": ( + [StepRunDiff.from_dict(_item) for _item in obj["diffs"]] + if obj.get("diffs") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/job.py b/hatchet_sdk/clients/rest/models/job.py index 94f897ad..aceaf6f4 100644 --- a/hatchet_sdk/clients/rest/models/job.py +++ b/hatchet_sdk/clients/rest/models/job.py @@ -13,29 +13,44 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step import Step -from typing import Optional, Set -from typing_extensions import Self + class Job(BaseModel): """ Job - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") version_id: StrictStr = Field(alias="versionId") name: StrictStr - description: Optional[StrictStr] = Field(default=None, description="The description of the job.") + description: Optional[StrictStr] = Field( + default=None, description="The description of the job." + ) steps: List[Step] - timeout: Optional[StrictStr] = Field(default=None, description="The timeout of the job.") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "versionId", "name", "description", "steps", "timeout"] + timeout: Optional[StrictStr] = Field( + default=None, description="The timeout of the job." + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "versionId", + "name", + "description", + "steps", + "timeout", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +58,6 @@ class Job(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +82,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,14 +91,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict['steps'] = _items + _dict["steps"] = _items return _dict @classmethod @@ -97,15 +110,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "versionId": obj.get("versionId"), - "name": obj.get("name"), - "description": obj.get("description"), - "steps": [Step.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None, - "timeout": obj.get("timeout") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "versionId": obj.get("versionId"), + "name": obj.get("name"), + "description": obj.get("description"), + "steps": ( + [Step.from_dict(_item) for _item in obj["steps"]] + if obj.get("steps") is not None + else None + ), + "timeout": obj.get("timeout"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/job_run.py b/hatchet_sdk/clients/rest/models/job_run.py index a3afd3b0..a9b0da3b 100644 --- a/hatchet_sdk/clients/rest/models/job_run.py +++ b/hatchet_sdk/clients/rest/models/job_run.py @@ -13,23 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.job_run_status import JobRunStatus -from typing import Optional, Set -from typing_extensions import Self + class JobRun(BaseModel): """ JobRun - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") workflow_run_id: StrictStr = Field(alias="workflowRunId") @@ -46,7 +49,24 @@ class JobRun(BaseModel): cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "workflowRunId", "workflowRun", "jobId", "job", "tickerId", "stepRuns", "status", "result", "startedAt", "finishedAt", "timeoutAt", "cancelledAt", "cancelledReason", "cancelledError"] + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "workflowRunId", + "workflowRun", + "jobId", + "job", + "tickerId", + "stepRuns", + "status", + "result", + "startedAt", + "finishedAt", + "timeoutAt", + "cancelledAt", + "cancelledReason", + "cancelledError", + ] model_config = ConfigDict( populate_by_name=True, @@ -54,7 +74,6 @@ class JobRun(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -79,8 +98,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -89,20 +107,20 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_run if self.workflow_run: - _dict['workflowRun'] = self.workflow_run.to_dict() + _dict["workflowRun"] = self.workflow_run.to_dict() # override the default output from pydantic by calling `to_dict()` of job if self.job: - _dict['job'] = self.job.to_dict() + _dict["job"] = self.job.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in step_runs (list) _items = [] if self.step_runs: for _item in self.step_runs: if _item: _items.append(_item.to_dict()) - _dict['stepRuns'] = _items + _dict["stepRuns"] = _items return _dict @classmethod @@ -114,28 +132,45 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "workflowRunId": obj.get("workflowRunId"), - "workflowRun": WorkflowRun.from_dict(obj["workflowRun"]) if obj.get("workflowRun") is not None else None, - "jobId": obj.get("jobId"), - "job": Job.from_dict(obj["job"]) if obj.get("job") is not None else None, - "tickerId": obj.get("tickerId"), - "stepRuns": [StepRun.from_dict(_item) for _item in obj["stepRuns"]] if obj.get("stepRuns") is not None else None, - "status": obj.get("status"), - "result": obj.get("result"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "timeoutAt": obj.get("timeoutAt"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "workflowRunId": obj.get("workflowRunId"), + "workflowRun": ( + WorkflowRun.from_dict(obj["workflowRun"]) + if obj.get("workflowRun") is not None + else None + ), + "jobId": obj.get("jobId"), + "job": ( + Job.from_dict(obj["job"]) if obj.get("job") is not None else None + ), + "tickerId": obj.get("tickerId"), + "stepRuns": ( + [StepRun.from_dict(_item) for _item in obj["stepRuns"]] + if obj.get("stepRuns") is not None + else None + ), + "status": obj.get("status"), + "result": obj.get("result"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "timeoutAt": obj.get("timeoutAt"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError"), + } + ) return _obj + from hatchet_sdk.clients.rest.models.step_run import StepRun from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun + # TODO: Rewrite to not use raise_errors JobRun.model_rebuild(raise_errors=False) - diff --git a/hatchet_sdk/clients/rest/models/job_run_status.py b/hatchet_sdk/clients/rest/models/job_run_status.py index 4036f345..3952edf0 100644 --- a/hatchet_sdk/clients/rest/models/job_run_status.py +++ b/hatchet_sdk/clients/rest/models/job_run_status.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,15 +28,13 @@ class JobRunStatus(str, Enum): """ allowed enum values """ - PENDING = 'PENDING' - RUNNING = 'RUNNING' - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - CANCELLED = 'CANCELLED' + PENDING = "PENDING" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of JobRunStatus from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py index fe7cbc5c..df9b60ac 100644 --- a/hatchet_sdk/clients/rest/models/list_api_tokens_response.py +++ b/hatchet_sdk/clients/rest/models/list_api_tokens_response.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_token import APIToken from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class ListAPITokensResponse(BaseModel): """ ListAPITokensResponse - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[APIToken]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class ListAPITokensResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [APIToken.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [APIToken.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py index cf7188e0..6cfd61bb 100644 --- a/hatchet_sdk/clients/rest/models/list_pull_requests_response.py +++ b/hatchet_sdk/clients/rest/models/list_pull_requests_response.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.pull_request import PullRequest -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.pull_request import PullRequest + + class ListPullRequestsResponse(BaseModel): """ ListPullRequestsResponse - """ # noqa: E501 + """ # noqa: E501 + pull_requests: List[PullRequest] = Field(alias="pullRequests") __properties: ClassVar[List[str]] = ["pullRequests"] @@ -36,7 +39,6 @@ class ListPullRequestsResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.pull_requests: if _item: _items.append(_item.to_dict()) - _dict['pullRequests'] = _items + _dict["pullRequests"] = _items return _dict @classmethod @@ -87,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pullRequests": [PullRequest.from_dict(_item) for _item in obj["pullRequests"]] if obj.get("pullRequests") is not None else None - }) + _obj = cls.model_validate( + { + "pullRequests": ( + [PullRequest.from_dict(_item) for _item in obj["pullRequests"]] + if obj.get("pullRequests") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py index 3c448183..647bc276 100644 --- a/hatchet_sdk/clients/rest/models/list_slack_webhooks.py +++ b/hatchet_sdk/clients/rest/models/list_slack_webhooks.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.slack_webhook import SlackWebhook -from typing import Optional, Set -from typing_extensions import Self + class ListSlackWebhooks(BaseModel): """ ListSlackWebhooks - """ # noqa: E501 + """ # noqa: E501 + pagination: PaginationResponse rows: List[SlackWebhook] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class ListSlackWebhooks(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [SlackWebhook.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [SlackWebhook.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/list_sns_integrations.py b/hatchet_sdk/clients/rest/models/list_sns_integrations.py index 28602f47..ecf67484 100644 --- a/hatchet_sdk/clients/rest/models/list_sns_integrations.py +++ b/hatchet_sdk/clients/rest/models/list_sns_integrations.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.sns_integration import SNSIntegration -from typing import Optional, Set -from typing_extensions import Self + class ListSNSIntegrations(BaseModel): """ ListSNSIntegrations - """ # noqa: E501 + """ # noqa: E501 + pagination: PaginationResponse rows: List[SNSIntegration] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class ListSNSIntegrations(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [SNSIntegration.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [SNSIntegration.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/log_line.py b/hatchet_sdk/clients/rest/models/log_line.py index 21c8b4be..ee4299cf 100644 --- a/hatchet_sdk/clients/rest/models/log_line.py +++ b/hatchet_sdk/clients/rest/models/log_line.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class LogLine(BaseModel): """ LogLine - """ # noqa: E501 - created_at: datetime = Field(description="The creation date of the log line.", alias="createdAt") + """ # noqa: E501 + + created_at: datetime = Field( + description="The creation date of the log line.", alias="createdAt" + ) message: StrictStr = Field(description="The log message.") metadata: Dict[str, Any] = Field(description="The log metadata.") __properties: ClassVar[List[str]] = ["createdAt", "message", "metadata"] @@ -38,7 +42,6 @@ class LogLine(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,11 +84,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "createdAt": obj.get("createdAt"), - "message": obj.get("message"), - "metadata": obj.get("metadata") - }) + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "message": obj.get("message"), + "metadata": obj.get("metadata"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/log_line_level.py b/hatchet_sdk/clients/rest/models/log_line_level.py index daba89ed..63fbec41 100644 --- a/hatchet_sdk/clients/rest/models/log_line_level.py +++ b/hatchet_sdk/clients/rest/models/log_line_level.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,14 +28,12 @@ class LogLineLevel(str, Enum): """ allowed enum values """ - DEBUG = 'DEBUG' - INFO = 'INFO' - WARN = 'WARN' - ERROR = 'ERROR' + DEBUG = "DEBUG" + INFO = "INFO" + WARN = "WARN" + ERROR = "ERROR" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineLevel from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/log_line_list.py b/hatchet_sdk/clients/rest/models/log_line_list.py index 2d93d5a9..306ee2c7 100644 --- a/hatchet_sdk/clients/rest/models/log_line_list.py +++ b/hatchet_sdk/clients/rest/models/log_line_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.log_line import LogLine from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from typing import Optional, Set -from typing_extensions import Self + class LogLineList(BaseModel): """ LogLineList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[LogLine]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class LogLineList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [LogLine.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [LogLine.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py b/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py index 6c25dae7..5f66f59b 100644 --- a/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class LogLineOrderByDirection(str, Enum): """ allowed enum values """ - ASC = 'asc' - DESC = 'desc' + ASC = "asc" + DESC = "desc" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineOrderByDirection from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/log_line_order_by_field.py b/hatchet_sdk/clients/rest/models/log_line_order_by_field.py index f0cb01d3..93b92526 100644 --- a/hatchet_sdk/clients/rest/models/log_line_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/log_line_order_by_field.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,11 +28,9 @@ class LogLineOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = 'createdAt' + CREATEDAT = "createdAt" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of LogLineOrderByField from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/pagination_response.py b/hatchet_sdk/clients/rest/models/pagination_response.py index 8d1ebd1e..2994dee9 100644 --- a/hatchet_sdk/clients/rest/models/pagination_response.py +++ b/hatchet_sdk/clients/rest/models/pagination_response.py @@ -13,22 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class PaginationResponse(BaseModel): """ PaginationResponse - """ # noqa: E501 - current_page: Optional[StrictInt] = Field(default=None, description="the current page") + """ # noqa: E501 + + current_page: Optional[StrictInt] = Field( + default=None, description="the current page" + ) next_page: Optional[StrictInt] = Field(default=None, description="the next page") - num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") + num_pages: Optional[StrictInt] = Field( + default=None, description="the total number of pages for listing" + ) __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] model_config = ConfigDict( @@ -37,7 +43,6 @@ class PaginationResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "current_page": obj.get("current_page"), - "next_page": obj.get("next_page"), - "num_pages": obj.get("num_pages") - }) + _obj = cls.model_validate( + { + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/pull_request.py b/hatchet_sdk/clients/rest/models/pull_request.py index a9c91220..c1462591 100644 --- a/hatchet_sdk/clients/rest/models/pull_request.py +++ b/hatchet_sdk/clients/rest/models/pull_request.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.pull_request_state import PullRequestState + + class PullRequest(BaseModel): """ PullRequest - """ # noqa: E501 + """ # noqa: E501 + repository_owner: StrictStr = Field(alias="repositoryOwner") repository_name: StrictStr = Field(alias="repositoryName") pull_request_id: StrictInt = Field(alias="pullRequestID") @@ -35,7 +38,16 @@ class PullRequest(BaseModel): pull_request_head_branch: StrictStr = Field(alias="pullRequestHeadBranch") pull_request_base_branch: StrictStr = Field(alias="pullRequestBaseBranch") pull_request_state: PullRequestState = Field(alias="pullRequestState") - __properties: ClassVar[List[str]] = ["repositoryOwner", "repositoryName", "pullRequestID", "pullRequestTitle", "pullRequestNumber", "pullRequestHeadBranch", "pullRequestBaseBranch", "pullRequestState"] + __properties: ClassVar[List[str]] = [ + "repositoryOwner", + "repositoryName", + "pullRequestID", + "pullRequestTitle", + "pullRequestNumber", + "pullRequestHeadBranch", + "pullRequestBaseBranch", + "pullRequestState", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +55,6 @@ class PullRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +79,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "repositoryOwner": obj.get("repositoryOwner"), - "repositoryName": obj.get("repositoryName"), - "pullRequestID": obj.get("pullRequestID"), - "pullRequestTitle": obj.get("pullRequestTitle"), - "pullRequestNumber": obj.get("pullRequestNumber"), - "pullRequestHeadBranch": obj.get("pullRequestHeadBranch"), - "pullRequestBaseBranch": obj.get("pullRequestBaseBranch"), - "pullRequestState": obj.get("pullRequestState") - }) + _obj = cls.model_validate( + { + "repositoryOwner": obj.get("repositoryOwner"), + "repositoryName": obj.get("repositoryName"), + "pullRequestID": obj.get("pullRequestID"), + "pullRequestTitle": obj.get("pullRequestTitle"), + "pullRequestNumber": obj.get("pullRequestNumber"), + "pullRequestHeadBranch": obj.get("pullRequestHeadBranch"), + "pullRequestBaseBranch": obj.get("pullRequestBaseBranch"), + "pullRequestState": obj.get("pullRequestState"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/pull_request_state.py b/hatchet_sdk/clients/rest/models/pull_request_state.py index 9cd42f0c..a44d06cc 100644 --- a/hatchet_sdk/clients/rest/models/pull_request_state.py +++ b/hatchet_sdk/clients/rest/models/pull_request_state.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class PullRequestState(str, Enum): """ allowed enum values """ - OPEN = 'open' - CLOSED = 'closed' + OPEN = "open" + CLOSED = "closed" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of PullRequestState from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/queue_metrics.py b/hatchet_sdk/clients/rest/models/queue_metrics.py index fe45d680..d19066dd 100644 --- a/hatchet_sdk/clients/rest/models/queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/queue_metrics.py @@ -13,22 +13,30 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class QueueMetrics(BaseModel): """ QueueMetrics - """ # noqa: E501 - num_queued: StrictInt = Field(description="The number of items in the queue.", alias="numQueued") - num_running: StrictInt = Field(description="The number of items running.", alias="numRunning") - num_pending: StrictInt = Field(description="The number of items pending.", alias="numPending") + """ # noqa: E501 + + num_queued: StrictInt = Field( + description="The number of items in the queue.", alias="numQueued" + ) + num_running: StrictInt = Field( + description="The number of items running.", alias="numRunning" + ) + num_pending: StrictInt = Field( + description="The number of items pending.", alias="numPending" + ) __properties: ClassVar[List[str]] = ["numQueued", "numRunning", "numPending"] model_config = ConfigDict( @@ -37,7 +45,6 @@ class QueueMetrics(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +87,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "numQueued": obj.get("numQueued"), - "numRunning": obj.get("numRunning"), - "numPending": obj.get("numPending") - }) + _obj = cls.model_validate( + { + "numQueued": obj.get("numQueued"), + "numRunning": obj.get("numRunning"), + "numPending": obj.get("numPending"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/rate_limit.py b/hatchet_sdk/clients/rest/models/rate_limit.py new file mode 100644 index 00000000..7ecd674f --- /dev/null +++ b/hatchet_sdk/clients/rest/models/rate_limit.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RateLimit(BaseModel): + """ + RateLimit + """ # noqa: E501 + key: StrictStr = Field(description="The key for the rate limit.") + tenant_id: StrictStr = Field(description="The ID of the tenant associated with this rate limit.", alias="tenantId") + limit_value: StrictInt = Field(description="The maximum number of requests allowed within the window.", alias="limitValue") + value: StrictInt = Field(description="The current number of requests made within the window.") + window: StrictStr = Field(description="The window of time in which the limitValue is enforced.") + last_refill: datetime = Field(description="The last time the rate limit was refilled.", alias="lastRefill") + __properties: ClassVar[List[str]] = ["key", "tenantId", "limitValue", "value", "window", "lastRefill"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RateLimit from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RateLimit from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "key": obj.get("key"), + "tenantId": obj.get("tenantId"), + "limitValue": obj.get("limitValue"), + "value": obj.get("value"), + "window": obj.get("window"), + "lastRefill": obj.get("lastRefill") + }) + return _obj + + diff --git a/hatchet_sdk/clients/rest/models/rate_limit_list.py b/hatchet_sdk/clients/rest/models/rate_limit_list.py new file mode 100644 index 00000000..d7cd3ce5 --- /dev/null +++ b/hatchet_sdk/clients/rest/models/rate_limit_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse +from hatchet_sdk.clients.rest.models.rate_limit import RateLimit +from typing import Optional, Set +from typing_extensions import Self + +class RateLimitList(BaseModel): + """ + RateLimitList + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None + rows: Optional[List[RateLimit]] = None + __properties: ClassVar[List[str]] = ["pagination", "rows"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RateLimitList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in rows (list) + _items = [] + if self.rows: + for _item in self.rows: + if _item: + _items.append(_item.to_dict()) + _dict['rows'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RateLimitList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [RateLimit.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) + return _obj + + diff --git a/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py b/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py new file mode 100644 index 00000000..13e249a6 --- /dev/null +++ b/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class RateLimitOrderByDirection(str, Enum): + """ + RateLimitOrderByDirection + """ + + """ + allowed enum values + """ + ASC = 'asc' + DESC = 'desc' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RateLimitOrderByDirection from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py b/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py new file mode 100644 index 00000000..1eed535c --- /dev/null +++ b/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class RateLimitOrderByField(str, Enum): + """ + RateLimitOrderByField + """ + + """ + allowed enum values + """ + KEY = 'key' + VALUE = 'value' + LIMITVALUE = 'limitValue' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RateLimitOrderByField from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/hatchet_sdk/clients/rest/models/recent_step_runs.py b/hatchet_sdk/clients/rest/models/recent_step_runs.py index c9354e92..9b8a8249 100644 --- a/hatchet_sdk/clients/rest/models/recent_step_runs.py +++ b/hatchet_sdk/clients/rest/models/recent_step_runs.py @@ -13,22 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus -from typing import Optional, Set -from typing_extensions import Self + class RecentStepRuns(BaseModel): """ RecentStepRuns - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta action_id: StrictStr = Field(description="The action id.", alias="actionId") status: StepRunStatus @@ -36,7 +39,15 @@ class RecentStepRuns(BaseModel): finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") workflow_run_id: StrictStr = Field(alias="workflowRunId") - __properties: ClassVar[List[str]] = ["metadata", "actionId", "status", "startedAt", "finishedAt", "cancelledAt", "workflowRunId"] + __properties: ClassVar[List[str]] = [ + "metadata", + "actionId", + "status", + "startedAt", + "finishedAt", + "cancelledAt", + "workflowRunId", + ] model_config = ConfigDict( populate_by_name=True, @@ -44,7 +55,6 @@ class RecentStepRuns(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,8 +79,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -91,15 +100,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "actionId": obj.get("actionId"), - "status": obj.get("status"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "cancelledAt": obj.get("cancelledAt"), - "workflowRunId": obj.get("workflowRunId") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "actionId": obj.get("actionId"), + "status": obj.get("status"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "cancelledAt": obj.get("cancelledAt"), + "workflowRunId": obj.get("workflowRunId"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/reject_invite_request.py b/hatchet_sdk/clients/rest/models/reject_invite_request.py index e863e602..13399345 100644 --- a/hatchet_sdk/clients/rest/models/reject_invite_request.py +++ b/hatchet_sdk/clients/rest/models/reject_invite_request.py @@ -13,20 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class RejectInviteRequest(BaseModel): """ RejectInviteRequest - """ # noqa: E501 + """ # noqa: E501 + invite: Annotated[str, Field(min_length=36, strict=True, max_length=36)] __properties: ClassVar[List[str]] = ["invite"] @@ -36,7 +37,6 @@ class RejectInviteRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "invite": obj.get("invite") - }) + _obj = cls.model_validate({"invite": obj.get("invite")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/replay_event_request.py b/hatchet_sdk/clients/rest/models/replay_event_request.py index 9f91abf8..0a5ef723 100644 --- a/hatchet_sdk/clients/rest/models/replay_event_request.py +++ b/hatchet_sdk/clients/rest/models/replay_event_request.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class ReplayEventRequest(BaseModel): """ ReplayEventRequest - """ # noqa: E501 - event_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="eventIds") + """ # noqa: E501 + + event_ids: List[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field(alias="eventIds") __properties: ClassVar[List[str]] = ["eventIds"] model_config = ConfigDict( @@ -36,7 +39,6 @@ class ReplayEventRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "eventIds": obj.get("eventIds") - }) + _obj = cls.model_validate({"eventIds": obj.get("eventIds")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py b/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py index f30b784c..de5b2797 100644 --- a/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py +++ b/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class ReplayWorkflowRunsRequest(BaseModel): """ ReplayWorkflowRunsRequest - """ # noqa: E501 - workflow_run_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="workflowRunIds") + """ # noqa: E501 + + workflow_run_ids: List[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field(alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -36,7 +39,6 @@ class ReplayWorkflowRunsRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "workflowRunIds": obj.get("workflowRunIds") - }) + _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py index 1b84adcc..6f0f780f 100644 --- a/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +++ b/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun + + class ReplayWorkflowRunsResponse(BaseModel): """ ReplayWorkflowRunsResponse - """ # noqa: E501 + """ # noqa: E501 + workflow_runs: List[WorkflowRun] = Field(alias="workflowRuns") __properties: ClassVar[List[str]] = ["workflowRuns"] @@ -36,7 +39,6 @@ class ReplayWorkflowRunsResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.workflow_runs: if _item: _items.append(_item.to_dict()) - _dict['workflowRuns'] = _items + _dict["workflowRuns"] = _items return _dict @classmethod @@ -87,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "workflowRuns": [WorkflowRun.from_dict(_item) for _item in obj["workflowRuns"]] if obj.get("workflowRuns") is not None else None - }) + _obj = cls.model_validate( + { + "workflowRuns": ( + [WorkflowRun.from_dict(_item) for _item in obj["workflowRuns"]] + if obj.get("workflowRuns") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/rerun_step_run_request.py b/hatchet_sdk/clients/rest/models/rerun_step_run_request.py index 2dab0f68..f8b28066 100644 --- a/hatchet_sdk/clients/rest/models/rerun_step_run_request.py +++ b/hatchet_sdk/clients/rest/models/rerun_step_run_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class RerunStepRunRequest(BaseModel): """ RerunStepRunRequest - """ # noqa: E501 + """ # noqa: E501 + input: Dict[str, Any] __properties: ClassVar[List[str]] = ["input"] @@ -35,7 +37,6 @@ class RerunStepRunRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "input": obj.get("input") - }) + _obj = cls.model_validate({"input": obj.get("input")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/semaphore_slots.py b/hatchet_sdk/clients/rest/models/semaphore_slots.py index 65ea8e7f..1e7c6242 100644 --- a/hatchet_sdk/clients/rest/models/semaphore_slots.py +++ b/hatchet_sdk/clients/rest/models/semaphore_slots.py @@ -13,29 +13,44 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus + + class SemaphoreSlots(BaseModel): """ SemaphoreSlots - """ # noqa: E501 - slot: StrictStr = Field(description="The slot name.") - step_run_id: Optional[StrictStr] = Field(default=None, description="The step run id.", alias="stepRunId") - action_id: Optional[StrictStr] = Field(default=None, description="The action id.", alias="actionId") - started_at: Optional[datetime] = Field(default=None, description="The time this slot was started.", alias="startedAt") - timeout_at: Optional[datetime] = Field(default=None, description="The time this slot will timeout.", alias="timeoutAt") - workflow_run_id: Optional[StrictStr] = Field(default=None, description="The workflow run id.", alias="workflowRunId") - status: Optional[StepRunStatus] = None - __properties: ClassVar[List[str]] = ["slot", "stepRunId", "actionId", "startedAt", "timeoutAt", "workflowRunId", "status"] + """ # noqa: E501 + + step_run_id: StrictStr = Field(description="The step run id.", alias="stepRunId") + action_id: StrictStr = Field(description="The action id.", alias="actionId") + started_at: Optional[datetime] = Field( + default=None, description="The time this slot was started.", alias="startedAt" + ) + timeout_at: Optional[datetime] = Field( + default=None, description="The time this slot will timeout.", alias="timeoutAt" + ) + workflow_run_id: StrictStr = Field( + description="The workflow run id.", alias="workflowRunId" + ) + status: StepRunStatus + __properties: ClassVar[List[str]] = [ + "stepRunId", + "actionId", + "startedAt", + "timeoutAt", + "workflowRunId", + "status", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +58,6 @@ class SemaphoreSlots(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +82,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,15 +100,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "slot": obj.get("slot"), - "stepRunId": obj.get("stepRunId"), - "actionId": obj.get("actionId"), - "startedAt": obj.get("startedAt"), - "timeoutAt": obj.get("timeoutAt"), - "workflowRunId": obj.get("workflowRunId"), - "status": obj.get("status") - }) + _obj = cls.model_validate( + { + "stepRunId": obj.get("stepRunId"), + "actionId": obj.get("actionId"), + "startedAt": obj.get("startedAt"), + "timeoutAt": obj.get("timeoutAt"), + "workflowRunId": obj.get("workflowRunId"), + "status": obj.get("status"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/slack_webhook.py b/hatchet_sdk/clients/rest/models/slack_webhook.py index a793410a..6cc3f4c8 100644 --- a/hatchet_sdk/clients/rest/models/slack_webhook.py +++ b/hatchet_sdk/clients/rest/models/slack_webhook.py @@ -13,27 +13,51 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class SlackWebhook(BaseModel): """ SlackWebhook - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - tenant_id: StrictStr = Field(description="The unique identifier for the tenant that the SNS integration belongs to.", alias="tenantId") - team_name: StrictStr = Field(description="The team name associated with this slack webhook.", alias="teamName") - team_id: StrictStr = Field(description="The team id associated with this slack webhook.", alias="teamId") - channel_name: StrictStr = Field(description="The channel name associated with this slack webhook.", alias="channelName") - channel_id: StrictStr = Field(description="The channel id associated with this slack webhook.", alias="channelId") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "teamName", "teamId", "channelName", "channelId"] + tenant_id: StrictStr = Field( + description="The unique identifier for the tenant that the SNS integration belongs to.", + alias="tenantId", + ) + team_name: StrictStr = Field( + description="The team name associated with this slack webhook.", + alias="teamName", + ) + team_id: StrictStr = Field( + description="The team id associated with this slack webhook.", alias="teamId" + ) + channel_name: StrictStr = Field( + description="The channel name associated with this slack webhook.", + alias="channelName", + ) + channel_id: StrictStr = Field( + description="The channel id associated with this slack webhook.", + alias="channelId", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "teamName", + "teamId", + "channelName", + "channelId", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +65,6 @@ class SlackWebhook(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +89,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,7 +98,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -88,14 +110,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "teamName": obj.get("teamName"), - "teamId": obj.get("teamId"), - "channelName": obj.get("channelName"), - "channelId": obj.get("channelId") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "teamName": obj.get("teamName"), + "teamId": obj.get("teamId"), + "channelName": obj.get("channelName"), + "channelId": obj.get("channelId"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/sns_integration.py b/hatchet_sdk/clients/rest/models/sns_integration.py index e6f53045..7fcda4aa 100644 --- a/hatchet_sdk/clients/rest/models/sns_integration.py +++ b/hatchet_sdk/clients/rest/models/sns_integration.py @@ -13,25 +13,40 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class SNSIntegration(BaseModel): """ SNSIntegration - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - tenant_id: StrictStr = Field(description="The unique identifier for the tenant that the SNS integration belongs to.", alias="tenantId") - topic_arn: StrictStr = Field(description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn") - ingest_url: Optional[StrictStr] = Field(default=None, description="The URL to send SNS messages to.", alias="ingestUrl") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "topicArn", "ingestUrl"] + tenant_id: StrictStr = Field( + description="The unique identifier for the tenant that the SNS integration belongs to.", + alias="tenantId", + ) + topic_arn: StrictStr = Field( + description="The Amazon Resource Name (ARN) of the SNS topic.", alias="topicArn" + ) + ingest_url: Optional[StrictStr] = Field( + default=None, description="The URL to send SNS messages to.", alias="ingestUrl" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "topicArn", + "ingestUrl", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +54,6 @@ class SNSIntegration(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +78,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -74,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -86,12 +99,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "topicArn": obj.get("topicArn"), - "ingestUrl": obj.get("ingestUrl") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "topicArn": obj.get("topicArn"), + "ingestUrl": obj.get("ingestUrl"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step.py b/hatchet_sdk/clients/rest/models/step.py index ca22dee0..2014b7e9 100644 --- a/hatchet_sdk/clients/rest/models/step.py +++ b/hatchet_sdk/clients/rest/models/step.py @@ -13,29 +13,45 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class Step(BaseModel): """ Step - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - readable_id: StrictStr = Field(description="The readable id of the step.", alias="readableId") + readable_id: StrictStr = Field( + description="The readable id of the step.", alias="readableId" + ) tenant_id: StrictStr = Field(alias="tenantId") job_id: StrictStr = Field(alias="jobId") action: StrictStr - timeout: Optional[StrictStr] = Field(default=None, description="The timeout of the step.") + timeout: Optional[StrictStr] = Field( + default=None, description="The timeout of the step." + ) children: Optional[List[StrictStr]] = None parents: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["metadata", "readableId", "tenantId", "jobId", "action", "timeout", "children", "parents"] + __properties: ClassVar[List[str]] = [ + "metadata", + "readableId", + "tenantId", + "jobId", + "action", + "timeout", + "children", + "parents", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +59,6 @@ class Step(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +83,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,16 +104,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "readableId": obj.get("readableId"), - "tenantId": obj.get("tenantId"), - "jobId": obj.get("jobId"), - "action": obj.get("action"), - "timeout": obj.get("timeout"), - "children": obj.get("children"), - "parents": obj.get("parents") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "readableId": obj.get("readableId"), + "tenantId": obj.get("tenantId"), + "jobId": obj.get("jobId"), + "action": obj.get("action"), + "timeout": obj.get("timeout"), + "children": obj.get("children"), + "parents": obj.get("parents"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run.py b/hatchet_sdk/clients/rest/models/step_run.py index 5de2a87d..7e6b4b22 100644 --- a/hatchet_sdk/clients/rest/models/step_run.py +++ b/hatchet_sdk/clients/rest/models/step_run.py @@ -13,32 +13,39 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.step import Step from hatchet_sdk.clients.rest.models.step_run_status import StepRunStatus -from typing import Optional, Set -from typing_extensions import Self + class StepRun(BaseModel): """ StepRun - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") job_run_id: StrictStr = Field(alias="jobRunId") job_run: Optional[JobRun] = Field(default=None, alias="jobRun") step_id: StrictStr = Field(alias="stepId") step: Optional[Step] = None - children: Optional[List[StrictStr]] = None + child_workflows_count: Optional[StrictInt] = Field( + default=None, alias="childWorkflowsCount" + ) parents: Optional[List[StrictStr]] = None - child_workflow_runs: Optional[List[StrictStr]] = Field(default=None, alias="childWorkflowRuns") + child_workflow_runs: Optional[List[StrictStr]] = Field( + default=None, alias="childWorkflowRuns" + ) worker_id: Optional[StrictStr] = Field(default=None, alias="workerId") input: Optional[StrictStr] = None output: Optional[StrictStr] = None @@ -49,14 +56,45 @@ class StepRun(BaseModel): started_at: Optional[datetime] = Field(default=None, alias="startedAt") started_at_epoch: Optional[StrictInt] = Field(default=None, alias="startedAtEpoch") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") - finished_at_epoch: Optional[StrictInt] = Field(default=None, alias="finishedAtEpoch") + finished_at_epoch: Optional[StrictInt] = Field( + default=None, alias="finishedAtEpoch" + ) timeout_at: Optional[datetime] = Field(default=None, alias="timeoutAt") timeout_at_epoch: Optional[StrictInt] = Field(default=None, alias="timeoutAtEpoch") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") - cancelled_at_epoch: Optional[StrictInt] = Field(default=None, alias="cancelledAtEpoch") + cancelled_at_epoch: Optional[StrictInt] = Field( + default=None, alias="cancelledAtEpoch" + ) cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "jobRunId", "jobRun", "stepId", "step", "children", "parents", "childWorkflowRuns", "workerId", "input", "output", "status", "requeueAfter", "result", "error", "startedAt", "startedAtEpoch", "finishedAt", "finishedAtEpoch", "timeoutAt", "timeoutAtEpoch", "cancelledAt", "cancelledAtEpoch", "cancelledReason", "cancelledError"] + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "jobRunId", + "jobRun", + "stepId", + "step", + "childWorkflowsCount", + "parents", + "childWorkflowRuns", + "workerId", + "input", + "output", + "status", + "requeueAfter", + "result", + "error", + "startedAt", + "startedAtEpoch", + "finishedAt", + "finishedAtEpoch", + "timeoutAt", + "timeoutAtEpoch", + "cancelledAt", + "cancelledAtEpoch", + "cancelledReason", + "cancelledError", + ] model_config = ConfigDict( populate_by_name=True, @@ -64,7 +102,6 @@ class StepRun(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -89,8 +126,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -99,13 +135,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of job_run if self.job_run: - _dict['jobRun'] = self.job_run.to_dict() + _dict["jobRun"] = self.job_run.to_dict() # override the default output from pydantic by calling `to_dict()` of step if self.step: - _dict['step'] = self.step.to_dict() + _dict["step"] = self.step.to_dict() return _dict @classmethod @@ -117,37 +153,50 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "jobRunId": obj.get("jobRunId"), - "jobRun": JobRun.from_dict(obj["jobRun"]) if obj.get("jobRun") is not None else None, - "stepId": obj.get("stepId"), - "step": Step.from_dict(obj["step"]) if obj.get("step") is not None else None, - "children": obj.get("children"), - "parents": obj.get("parents"), - "childWorkflowRuns": obj.get("childWorkflowRuns"), - "workerId": obj.get("workerId"), - "input": obj.get("input"), - "output": obj.get("output"), - "status": obj.get("status"), - "requeueAfter": obj.get("requeueAfter"), - "result": obj.get("result"), - "error": obj.get("error"), - "startedAt": obj.get("startedAt"), - "startedAtEpoch": obj.get("startedAtEpoch"), - "finishedAt": obj.get("finishedAt"), - "finishedAtEpoch": obj.get("finishedAtEpoch"), - "timeoutAt": obj.get("timeoutAt"), - "timeoutAtEpoch": obj.get("timeoutAtEpoch"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledAtEpoch": obj.get("cancelledAtEpoch"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "jobRunId": obj.get("jobRunId"), + "jobRun": ( + JobRun.from_dict(obj["jobRun"]) + if obj.get("jobRun") is not None + else None + ), + "stepId": obj.get("stepId"), + "step": ( + Step.from_dict(obj["step"]) if obj.get("step") is not None else None + ), + "childWorkflowsCount": obj.get("childWorkflowsCount"), + "parents": obj.get("parents"), + "childWorkflowRuns": obj.get("childWorkflowRuns"), + "workerId": obj.get("workerId"), + "input": obj.get("input"), + "output": obj.get("output"), + "status": obj.get("status"), + "requeueAfter": obj.get("requeueAfter"), + "result": obj.get("result"), + "error": obj.get("error"), + "startedAt": obj.get("startedAt"), + "startedAtEpoch": obj.get("startedAtEpoch"), + "finishedAt": obj.get("finishedAt"), + "finishedAtEpoch": obj.get("finishedAtEpoch"), + "timeoutAt": obj.get("timeoutAt"), + "timeoutAtEpoch": obj.get("timeoutAtEpoch"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledAtEpoch": obj.get("cancelledAtEpoch"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError"), + } + ) return _obj + from hatchet_sdk.clients.rest.models.job_run import JobRun + # TODO: Rewrite to not use raise_errors StepRun.model_rebuild(raise_errors=False) - diff --git a/hatchet_sdk/clients/rest/models/step_run_archive.py b/hatchet_sdk/clients/rest/models/step_run_archive.py index 8797734d..7476174d 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive.py @@ -13,37 +13,62 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class StepRunArchive(BaseModel): """ StepRunArchive - """ # noqa: E501 + """ # noqa: E501 + step_run_id: StrictStr = Field(alias="stepRunId") order: StrictInt input: Optional[StrictStr] = None output: Optional[StrictStr] = None started_at: Optional[datetime] = Field(default=None, alias="startedAt") error: Optional[StrictStr] = None + retry_count: StrictInt = Field(alias="retryCount") created_at: datetime = Field(alias="createdAt") started_at_epoch: Optional[StrictInt] = Field(default=None, alias="startedAtEpoch") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") - finished_at_epoch: Optional[StrictInt] = Field(default=None, alias="finishedAtEpoch") + finished_at_epoch: Optional[StrictInt] = Field( + default=None, alias="finishedAtEpoch" + ) timeout_at: Optional[datetime] = Field(default=None, alias="timeoutAt") timeout_at_epoch: Optional[StrictInt] = Field(default=None, alias="timeoutAtEpoch") cancelled_at: Optional[datetime] = Field(default=None, alias="cancelledAt") - cancelled_at_epoch: Optional[StrictInt] = Field(default=None, alias="cancelledAtEpoch") + cancelled_at_epoch: Optional[StrictInt] = Field( + default=None, alias="cancelledAtEpoch" + ) cancelled_reason: Optional[StrictStr] = Field(default=None, alias="cancelledReason") cancelled_error: Optional[StrictStr] = Field(default=None, alias="cancelledError") - __properties: ClassVar[List[str]] = ["stepRunId", "order", "input", "output", "startedAt", "error", "createdAt", "startedAtEpoch", "finishedAt", "finishedAtEpoch", "timeoutAt", "timeoutAtEpoch", "cancelledAt", "cancelledAtEpoch", "cancelledReason", "cancelledError"] + __properties: ClassVar[List[str]] = [ + "stepRunId", + "order", + "input", + "output", + "startedAt", + "error", + "retryCount", + "createdAt", + "startedAtEpoch", + "finishedAt", + "finishedAtEpoch", + "timeoutAt", + "timeoutAtEpoch", + "cancelledAt", + "cancelledAtEpoch", + "cancelledReason", + "cancelledError", + ] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +76,6 @@ class StepRunArchive(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -76,8 +100,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -95,24 +118,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "stepRunId": obj.get("stepRunId"), - "order": obj.get("order"), - "input": obj.get("input"), - "output": obj.get("output"), - "startedAt": obj.get("startedAt"), - "error": obj.get("error"), - "createdAt": obj.get("createdAt"), - "startedAtEpoch": obj.get("startedAtEpoch"), - "finishedAt": obj.get("finishedAt"), - "finishedAtEpoch": obj.get("finishedAtEpoch"), - "timeoutAt": obj.get("timeoutAt"), - "timeoutAtEpoch": obj.get("timeoutAtEpoch"), - "cancelledAt": obj.get("cancelledAt"), - "cancelledAtEpoch": obj.get("cancelledAtEpoch"), - "cancelledReason": obj.get("cancelledReason"), - "cancelledError": obj.get("cancelledError") - }) + _obj = cls.model_validate( + { + "stepRunId": obj.get("stepRunId"), + "order": obj.get("order"), + "input": obj.get("input"), + "output": obj.get("output"), + "startedAt": obj.get("startedAt"), + "error": obj.get("error"), + "retryCount": obj.get("retryCount"), + "createdAt": obj.get("createdAt"), + "startedAtEpoch": obj.get("startedAtEpoch"), + "finishedAt": obj.get("finishedAt"), + "finishedAtEpoch": obj.get("finishedAtEpoch"), + "timeoutAt": obj.get("timeoutAt"), + "timeoutAtEpoch": obj.get("timeoutAtEpoch"), + "cancelledAt": obj.get("cancelledAt"), + "cancelledAtEpoch": obj.get("cancelledAtEpoch"), + "cancelledReason": obj.get("cancelledReason"), + "cancelledError": obj.get("cancelledError"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run_archive_list.py b/hatchet_sdk/clients/rest/models/step_run_archive_list.py index ada96e17..fcc1419c 100644 --- a/hatchet_sdk/clients/rest/models/step_run_archive_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_archive_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.step_run_archive import StepRunArchive -from typing import Optional, Set -from typing_extensions import Self + class StepRunArchiveList(BaseModel): """ StepRunArchiveList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[StepRunArchive]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class StepRunArchiveList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [StepRunArchive.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [StepRunArchive.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run_diff.py b/hatchet_sdk/clients/rest/models/step_run_diff.py index ada29156..78848dd7 100644 --- a/hatchet_sdk/clients/rest/models/step_run_diff.py +++ b/hatchet_sdk/clients/rest/models/step_run_diff.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class StepRunDiff(BaseModel): """ StepRunDiff - """ # noqa: E501 + """ # noqa: E501 + key: StrictStr original: StrictStr modified: StrictStr @@ -37,7 +39,6 @@ class StepRunDiff(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "key": obj.get("key"), - "original": obj.get("original"), - "modified": obj.get("modified") - }) + _obj = cls.model_validate( + { + "key": obj.get("key"), + "original": obj.get("original"), + "modified": obj.get("modified"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run_event.py b/hatchet_sdk/clients/rest/models/step_run_event.py index 52004558..c5909d24 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event.py +++ b/hatchet_sdk/clients/rest/models/step_run_event.py @@ -13,32 +13,47 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.step_run_event_reason import StepRunEventReason from hatchet_sdk.clients.rest.models.step_run_event_severity import StepRunEventSeverity -from typing import Optional, Set -from typing_extensions import Self + class StepRunEvent(BaseModel): """ StepRunEvent - """ # noqa: E501 + """ # noqa: E501 + id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") - step_run_id: StrictStr = Field(alias="stepRunId") + step_run_id: Optional[StrictStr] = Field(default=None, alias="stepRunId") + workflow_run_id: Optional[StrictStr] = Field(default=None, alias="workflowRunId") reason: StepRunEventReason severity: StepRunEventSeverity message: StrictStr count: StrictInt data: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "stepRunId", "reason", "severity", "message", "count", "data"] + __properties: ClassVar[List[str]] = [ + "id", + "timeFirstSeen", + "timeLastSeen", + "stepRunId", + "workflowRunId", + "reason", + "severity", + "message", + "count", + "data", + ] model_config = ConfigDict( populate_by_name=True, @@ -46,7 +61,6 @@ class StepRunEvent(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -71,8 +85,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -90,17 +103,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "timeFirstSeen": obj.get("timeFirstSeen"), - "timeLastSeen": obj.get("timeLastSeen"), - "stepRunId": obj.get("stepRunId"), - "reason": obj.get("reason"), - "severity": obj.get("severity"), - "message": obj.get("message"), - "count": obj.get("count"), - "data": obj.get("data") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "stepRunId": obj.get("stepRunId"), + "workflowRunId": obj.get("workflowRunId"), + "reason": obj.get("reason"), + "severity": obj.get("severity"), + "message": obj.get("message"), + "count": obj.get("count"), + "data": obj.get("data"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run_event_list.py b/hatchet_sdk/clients/rest/models/step_run_event_list.py index ba23c5ad..a46f2089 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_list.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.step_run_event import StepRunEvent -from typing import Optional, Set -from typing_extensions import Self + class StepRunEventList(BaseModel): """ StepRunEventList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[StepRunEvent]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class StepRunEventList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [StepRunEvent.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [StepRunEvent.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/step_run_event_reason.py b/hatchet_sdk/clients/rest/models/step_run_event_reason.py index 0c9f545e..487fde06 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_reason.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_reason.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,24 +28,25 @@ class StepRunEventReason(str, Enum): """ allowed enum values """ - REQUEUED_NO_WORKER = 'REQUEUED_NO_WORKER' - REQUEUED_RATE_LIMIT = 'REQUEUED_RATE_LIMIT' - SCHEDULING_TIMED_OUT = 'SCHEDULING_TIMED_OUT' - ASSIGNED = 'ASSIGNED' - STARTED = 'STARTED' - FINISHED = 'FINISHED' - FAILED = 'FAILED' - RETRYING = 'RETRYING' - CANCELLED = 'CANCELLED' - TIMEOUT_REFRESHED = 'TIMEOUT_REFRESHED' - REASSIGNED = 'REASSIGNED' - TIMED_OUT = 'TIMED_OUT' - SLOT_RELEASED = 'SLOT_RELEASED' - RETRIED_BY_USER = 'RETRIED_BY_USER' + REQUEUED_NO_WORKER = "REQUEUED_NO_WORKER" + REQUEUED_RATE_LIMIT = "REQUEUED_RATE_LIMIT" + SCHEDULING_TIMED_OUT = "SCHEDULING_TIMED_OUT" + ASSIGNED = "ASSIGNED" + STARTED = "STARTED" + ACKNOWLEDGED = "ACKNOWLEDGED" + FINISHED = "FINISHED" + FAILED = "FAILED" + RETRYING = "RETRYING" + CANCELLED = "CANCELLED" + TIMEOUT_REFRESHED = "TIMEOUT_REFRESHED" + REASSIGNED = "REASSIGNED" + TIMED_OUT = "TIMED_OUT" + SLOT_RELEASED = "SLOT_RELEASED" + RETRIED_BY_USER = "RETRIED_BY_USER" + WORKFLOW_RUN_GROUP_KEY_SUCCEEDED = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED" + WORKFLOW_RUN_GROUP_KEY_FAILED = "WORKFLOW_RUN_GROUP_KEY_FAILED" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunEventReason from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/step_run_event_severity.py b/hatchet_sdk/clients/rest/models/step_run_event_severity.py index 47e44d96..a8a39912 100644 --- a/hatchet_sdk/clients/rest/models/step_run_event_severity.py +++ b/hatchet_sdk/clients/rest/models/step_run_event_severity.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,13 +28,11 @@ class StepRunEventSeverity(str, Enum): """ allowed enum values """ - INFO = 'INFO' - WARNING = 'WARNING' - CRITICAL = 'CRITICAL' + INFO = "INFO" + WARNING = "WARNING" + CRITICAL = "CRITICAL" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunEventSeverity from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/step_run_status.py b/hatchet_sdk/clients/rest/models/step_run_status.py index fbfe1dc0..8380b1b9 100644 --- a/hatchet_sdk/clients/rest/models/step_run_status.py +++ b/hatchet_sdk/clients/rest/models/step_run_status.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,18 +28,16 @@ class StepRunStatus(str, Enum): """ allowed enum values """ - PENDING = 'PENDING' - PENDING_ASSIGNMENT = 'PENDING_ASSIGNMENT' - ASSIGNED = 'ASSIGNED' - RUNNING = 'RUNNING' - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - CANCELLED = 'CANCELLED' - CANCELLING = 'CANCELLING' + PENDING = "PENDING" + PENDING_ASSIGNMENT = "PENDING_ASSIGNMENT" + ASSIGNED = "ASSIGNED" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" + CANCELLING = "CANCELLING" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of StepRunStatus from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/tenant.py b/hatchet_sdk/clients/rest/models/tenant.py index bdd79161..97a5863e 100644 --- a/hatchet_sdk/clients/rest/models/tenant.py +++ b/hatchet_sdk/clients/rest/models/tenant.py @@ -13,26 +13,43 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class Tenant(BaseModel): """ Tenant - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr = Field(description="The name of the tenant.") slug: StrictStr = Field(description="The slug of the tenant.") - analytics_opt_out: Optional[StrictBool] = Field(default=None, description="Whether the tenant has opted out of analytics.", alias="analyticsOptOut") - alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") - __properties: ClassVar[List[str]] = ["metadata", "name", "slug", "analyticsOptOut", "alertMemberEmails"] + analytics_opt_out: Optional[StrictBool] = Field( + default=None, + description="Whether the tenant has opted out of analytics.", + alias="analyticsOptOut", + ) + alert_member_emails: Optional[StrictBool] = Field( + default=None, + description="Whether to alert tenant members.", + alias="alertMemberEmails", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "slug", + "analyticsOptOut", + "alertMemberEmails", + ] model_config = ConfigDict( populate_by_name=True, @@ -40,7 +57,6 @@ class Tenant(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,8 +81,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -87,13 +102,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "slug": obj.get("slug"), - "analyticsOptOut": obj.get("analyticsOptOut"), - "alertMemberEmails": obj.get("alertMemberEmails") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "slug": obj.get("slug"), + "analyticsOptOut": obj.get("analyticsOptOut"), + "alertMemberEmails": obj.get("alertMemberEmails"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py b/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py index 30df003f..2b0586ed 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py +++ b/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class TenantAlertEmailGroup(BaseModel): """ TenantAlertEmailGroup - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["metadata", "emails"] @@ -37,7 +40,6 @@ class TenantAlertEmailGroup(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -84,10 +85,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "emails": obj.get("emails") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "emails": obj.get("emails"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py index aeeac36e..9e1a4fc1 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.rest.models.tenant_alert_email_group import TenantAlertEmailGroup -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse +from hatchet_sdk.clients.rest.models.tenant_alert_email_group import ( + TenantAlertEmailGroup, +) + + class TenantAlertEmailGroupList(BaseModel): """ TenantAlertEmailGroupList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantAlertEmailGroup]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +43,6 @@ class TenantAlertEmailGroupList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +76,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +95,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [TenantAlertEmailGroup.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [TenantAlertEmailGroup.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py b/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py index 5c79ef24..e2502486 100644 --- a/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py +++ b/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py @@ -13,29 +13,62 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class TenantAlertingSettings(BaseModel): """ TenantAlertingSettings - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") - enable_workflow_run_failure_alerts: Optional[StrictBool] = Field(default=None, description="Whether to send alerts when workflow runs fail.", alias="enableWorkflowRunFailureAlerts") - enable_expiring_token_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tokens are approaching expiration.", alias="enableExpiringTokenAlerts") - enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tenant resources are approaching limits.", alias="enableTenantResourceLimitAlerts") - max_alerting_frequency: StrictStr = Field(description="The max frequency at which to alert.", alias="maxAlertingFrequency") - last_alerted_at: Optional[datetime] = Field(default=None, description="The last time an alert was sent.", alias="lastAlertedAt") - __properties: ClassVar[List[str]] = ["metadata", "alertMemberEmails", "enableWorkflowRunFailureAlerts", "enableExpiringTokenAlerts", "enableTenantResourceLimitAlerts", "maxAlertingFrequency", "lastAlertedAt"] + alert_member_emails: Optional[StrictBool] = Field( + default=None, + description="Whether to alert tenant members.", + alias="alertMemberEmails", + ) + enable_workflow_run_failure_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to send alerts when workflow runs fail.", + alias="enableWorkflowRunFailureAlerts", + ) + enable_expiring_token_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to enable alerts when tokens are approaching expiration.", + alias="enableExpiringTokenAlerts", + ) + enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to enable alerts when tenant resources are approaching limits.", + alias="enableTenantResourceLimitAlerts", + ) + max_alerting_frequency: StrictStr = Field( + description="The max frequency at which to alert.", alias="maxAlertingFrequency" + ) + last_alerted_at: Optional[datetime] = Field( + default=None, + description="The last time an alert was sent.", + alias="lastAlertedAt", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "alertMemberEmails", + "enableWorkflowRunFailureAlerts", + "enableExpiringTokenAlerts", + "enableTenantResourceLimitAlerts", + "maxAlertingFrequency", + "lastAlertedAt", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +76,6 @@ class TenantAlertingSettings(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +100,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +109,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,15 +121,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "alertMemberEmails": obj.get("alertMemberEmails"), - "enableWorkflowRunFailureAlerts": obj.get("enableWorkflowRunFailureAlerts"), - "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), - "enableTenantResourceLimitAlerts": obj.get("enableTenantResourceLimitAlerts"), - "maxAlertingFrequency": obj.get("maxAlertingFrequency"), - "lastAlertedAt": obj.get("lastAlertedAt") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "alertMemberEmails": obj.get("alertMemberEmails"), + "enableWorkflowRunFailureAlerts": obj.get( + "enableWorkflowRunFailureAlerts" + ), + "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), + "enableTenantResourceLimitAlerts": obj.get( + "enableTenantResourceLimitAlerts" + ), + "maxAlertingFrequency": obj.get("maxAlertingFrequency"), + "lastAlertedAt": obj.get("lastAlertedAt"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_invite.py b/hatchet_sdk/clients/rest/models/tenant_invite.py index 2e1f9722..168bfa3c 100644 --- a/hatchet_sdk/clients/rest/models/tenant_invite.py +++ b/hatchet_sdk/clients/rest/models/tenant_invite.py @@ -13,29 +13,44 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole -from typing import Optional, Set -from typing_extensions import Self + class TenantInvite(BaseModel): """ TenantInvite - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta email: StrictStr = Field(description="The email of the user to invite.") role: TenantMemberRole = Field(description="The role of the user in the tenant.") - tenant_id: StrictStr = Field(description="The tenant id associated with this tenant invite.", alias="tenantId") - tenant_name: Optional[StrictStr] = Field(default=None, description="The tenant name for the tenant.", alias="tenantName") + tenant_id: StrictStr = Field( + description="The tenant id associated with this tenant invite.", + alias="tenantId", + ) + tenant_name: Optional[StrictStr] = Field( + default=None, description="The tenant name for the tenant.", alias="tenantName" + ) expires: datetime = Field(description="The time that this invite expires.") - __properties: ClassVar[List[str]] = ["metadata", "email", "role", "tenantId", "tenantName", "expires"] + __properties: ClassVar[List[str]] = [ + "metadata", + "email", + "role", + "tenantId", + "tenantName", + "expires", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +58,6 @@ class TenantInvite(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +82,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,14 +103,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "email": obj.get("email"), - "role": obj.get("role"), - "tenantId": obj.get("tenantId"), - "tenantName": obj.get("tenantName"), - "expires": obj.get("expires") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "email": obj.get("email"), + "role": obj.get("role"), + "tenantId": obj.get("tenantId"), + "tenantName": obj.get("tenantName"), + "expires": obj.get("expires"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_invite_list.py b/hatchet_sdk/clients/rest/models/tenant_invite_list.py index f098a073..95e4ba4d 100644 --- a/hatchet_sdk/clients/rest/models/tenant_invite_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_invite_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_invite import TenantInvite -from typing import Optional, Set -from typing_extensions import Self + class TenantInviteList(BaseModel): """ TenantInviteList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantInvite]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class TenantInviteList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [TenantInvite.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [TenantInvite.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_list.py b/hatchet_sdk/clients/rest/models/tenant_list.py index 9399154d..623d6206 100644 --- a/hatchet_sdk/clients/rest/models/tenant_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant import Tenant -from typing import Optional, Set -from typing_extensions import Self + class TenantList(BaseModel): """ TenantList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[Tenant]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class TenantList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [Tenant.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [Tenant.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_member.py b/hatchet_sdk/clients/rest/models/tenant_member.py index 98460fed..540230c0 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member.py +++ b/hatchet_sdk/clients/rest/models/tenant_member.py @@ -13,27 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant import Tenant from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole from hatchet_sdk.clients.rest.models.user_tenant_public import UserTenantPublic -from typing import Optional, Set -from typing_extensions import Self + class TenantMember(BaseModel): """ TenantMember - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - user: UserTenantPublic = Field(description="The user associated with this tenant member.") + user: UserTenantPublic = Field( + description="The user associated with this tenant member." + ) role: TenantMemberRole = Field(description="The role of the user in the tenant.") - tenant: Optional[Tenant] = Field(default=None, description="The tenant associated with this tenant member.") + tenant: Optional[Tenant] = Field( + default=None, description="The tenant associated with this tenant member." + ) __properties: ClassVar[List[str]] = ["metadata", "user", "role", "tenant"] model_config = ConfigDict( @@ -42,7 +49,6 @@ class TenantMember(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,13 +82,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of user if self.user: - _dict['user'] = self.user.to_dict() + _dict["user"] = self.user.to_dict() # override the default output from pydantic by calling `to_dict()` of tenant if self.tenant: - _dict['tenant'] = self.tenant.to_dict() + _dict["tenant"] = self.tenant.to_dict() return _dict @classmethod @@ -95,12 +100,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "user": UserTenantPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, - "role": obj.get("role"), - "tenant": Tenant.from_dict(obj["tenant"]) if obj.get("tenant") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "user": ( + UserTenantPublic.from_dict(obj["user"]) + if obj.get("user") is not None + else None + ), + "role": obj.get("role"), + "tenant": ( + Tenant.from_dict(obj["tenant"]) + if obj.get("tenant") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_member_list.py b/hatchet_sdk/clients/rest/models/tenant_member_list.py index f2506a9b..6627c281 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member_list.py +++ b/hatchet_sdk/clients/rest/models/tenant_member_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_member import TenantMember -from typing import Optional, Set -from typing_extensions import Self + class TenantMemberList(BaseModel): """ TenantMemberList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantMember]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class TenantMemberList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [TenantMember.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [TenantMember.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_member_role.py b/hatchet_sdk/clients/rest/models/tenant_member_role.py index fd89bb33..446c7044 100644 --- a/hatchet_sdk/clients/rest/models/tenant_member_role.py +++ b/hatchet_sdk/clients/rest/models/tenant_member_role.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,13 +28,11 @@ class TenantMemberRole(str, Enum): """ allowed enum values """ - OWNER = 'OWNER' - ADMIN = 'ADMIN' - MEMBER = 'MEMBER' + OWNER = "OWNER" + ADMIN = "ADMIN" + MEMBER = "MEMBER" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TenantMemberRole from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py index e29f8f3f..02807090 100644 --- a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py @@ -13,23 +13,29 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics -from typing import Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing_extensions import Self +from hatchet_sdk.clients.rest.models.queue_metrics import QueueMetrics + + class TenantQueueMetrics(BaseModel): """ TenantQueueMetrics - """ # noqa: E501 - total: Optional[QueueMetrics] = Field(default=None, description="The total queue metrics.") + """ # noqa: E501 + + total: Optional[QueueMetrics] = Field( + default=None, description="The total queue metrics." + ) workflow: Optional[Dict[str, QueueMetrics]] = None - __properties: ClassVar[List[str]] = ["total", "workflow"] + queues: Optional[Dict[str, StrictInt]] = None + __properties: ClassVar[List[str]] = ["total", "workflow", "queues"] model_config = ConfigDict( populate_by_name=True, @@ -37,7 +43,6 @@ class TenantQueueMetrics(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of total if self.total: - _dict['total'] = self.total.to_dict() + _dict["total"] = self.total.to_dict() return _dict @classmethod @@ -84,9 +88,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "total": QueueMetrics.from_dict(obj["total"]) if obj.get("total") is not None else None, - }) + _obj = cls.model_validate( + { + "total": ( + QueueMetrics.from_dict(obj["total"]) + if obj.get("total") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_resource.py b/hatchet_sdk/clients/rest/models/tenant_resource.py index c66e4997..0dbdbf60 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,15 +28,13 @@ class TenantResource(str, Enum): """ allowed enum values """ - WORKER = 'WORKER' - EVENT = 'EVENT' - WORKFLOW_RUN = 'WORKFLOW_RUN' - CRON = 'CRON' - SCHEDULE = 'SCHEDULE' + WORKER = "WORKER" + EVENT = "EVENT" + WORKFLOW_RUN = "WORKFLOW_RUN" + CRON = "CRON" + SCHEDULE = "SCHEDULE" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of TenantResource from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/tenant_resource_limit.py b/hatchet_sdk/clients/rest/models/tenant_resource_limit.py index 572fa8c5..722b7854 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource_limit.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource_limit.py @@ -13,30 +13,58 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.tenant_resource import TenantResource -from typing import Optional, Set -from typing_extensions import Self + class TenantResourceLimit(BaseModel): """ TenantResourceLimit - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - resource: TenantResource = Field(description="The resource associated with this limit.") - limit_value: StrictInt = Field(description="The limit associated with this limit.", alias="limitValue") - alarm_value: Optional[StrictInt] = Field(default=None, description="The alarm value associated with this limit to warn of approaching limit value.", alias="alarmValue") - value: StrictInt = Field(description="The current value associated with this limit.") - window: Optional[StrictStr] = Field(default=None, description="The meter window for the limit. (i.e. 1 day, 1 week, 1 month)") - last_refill: Optional[datetime] = Field(default=None, description="The last time the limit was refilled.", alias="lastRefill") - __properties: ClassVar[List[str]] = ["metadata", "resource", "limitValue", "alarmValue", "value", "window", "lastRefill"] + resource: TenantResource = Field( + description="The resource associated with this limit." + ) + limit_value: StrictInt = Field( + description="The limit associated with this limit.", alias="limitValue" + ) + alarm_value: Optional[StrictInt] = Field( + default=None, + description="The alarm value associated with this limit to warn of approaching limit value.", + alias="alarmValue", + ) + value: StrictInt = Field( + description="The current value associated with this limit." + ) + window: Optional[StrictStr] = Field( + default=None, + description="The meter window for the limit. (i.e. 1 day, 1 week, 1 month)", + ) + last_refill: Optional[datetime] = Field( + default=None, + description="The last time the limit was refilled.", + alias="lastRefill", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "resource", + "limitValue", + "alarmValue", + "value", + "window", + "lastRefill", + ] model_config = ConfigDict( populate_by_name=True, @@ -44,7 +72,6 @@ class TenantResourceLimit(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,8 +96,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,7 +105,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -91,15 +117,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "resource": obj.get("resource"), - "limitValue": obj.get("limitValue"), - "alarmValue": obj.get("alarmValue"), - "value": obj.get("value"), - "window": obj.get("window"), - "lastRefill": obj.get("lastRefill") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "resource": obj.get("resource"), + "limitValue": obj.get("limitValue"), + "alarmValue": obj.get("alarmValue"), + "value": obj.get("value"), + "window": obj.get("window"), + "lastRefill": obj.get("lastRefill"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py index c2975264..c8f10af0 100644 --- a/hatchet_sdk/clients/rest/models/tenant_resource_policy.py +++ b/hatchet_sdk/clients/rest/models/tenant_resource_policy.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.tenant_resource_limit import TenantResourceLimit + + class TenantResourcePolicy(BaseModel): """ TenantResourcePolicy - """ # noqa: E501 - limits: List[TenantResourceLimit] = Field(description="A list of resource limits for the tenant.") + """ # noqa: E501 + + limits: List[TenantResourceLimit] = Field( + description="A list of resource limits for the tenant." + ) __properties: ClassVar[List[str]] = ["limits"] model_config = ConfigDict( @@ -36,7 +41,6 @@ class TenantResourcePolicy(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.limits: if _item: _items.append(_item.to_dict()) - _dict['limits'] = _items + _dict["limits"] = _items return _dict @classmethod @@ -87,9 +90,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "limits": [TenantResourceLimit.from_dict(_item) for _item in obj["limits"]] if obj.get("limits") is not None else None - }) + _obj = cls.model_validate( + { + "limits": ( + [TenantResourceLimit.from_dict(_item) for _item in obj["limits"]] + if obj.get("limits") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py new file mode 100644 index 00000000..045fa467 --- /dev/null +++ b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TenantStepRunQueueMetrics(BaseModel): + """ + TenantStepRunQueueMetrics + """ # noqa: E501 + queues: Optional[Dict[str, StrictInt]] = None + __properties: ClassVar[List[str]] = ["queues"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantStepRunQueueMetrics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantStepRunQueueMetrics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + return _obj + + diff --git a/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py b/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py index 1502f08d..5600c6a0 100644 --- a/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py +++ b/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TriggerWorkflowRunRequest(BaseModel): """ TriggerWorkflowRunRequest - """ # noqa: E501 + """ # noqa: E501 + input: Dict[str, Any] - additional_metadata: Optional[Dict[str, Any]] = Field(default=None, alias="additionalMetadata") + additional_metadata: Optional[Dict[str, Any]] = Field( + default=None, alias="additionalMetadata" + ) __properties: ClassVar[List[str]] = ["input", "additionalMetadata"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class TriggerWorkflowRunRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "input": obj.get("input"), - "additionalMetadata": obj.get("additionalMetadata") - }) + _obj = cls.model_validate( + { + "input": obj.get("input"), + "additionalMetadata": obj.get("additionalMetadata"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py b/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py index 02d048be..d4dec094 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class UpdateTenantAlertEmailGroupRequest(BaseModel): """ UpdateTenantAlertEmailGroupRequest - """ # noqa: E501 + """ # noqa: E501 + emails: List[StrictStr] = Field(description="A list of emails for users") __properties: ClassVar[List[str]] = ["emails"] @@ -35,7 +37,6 @@ class UpdateTenantAlertEmailGroupRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "emails": obj.get("emails") - }) + _obj = cls.model_validate({"emails": obj.get("emails")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py b/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py index 36fedeab..86c36a9b 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.tenant_member_role import TenantMemberRole + + class UpdateTenantInviteRequest(BaseModel): """ UpdateTenantInviteRequest - """ # noqa: E501 + """ # noqa: E501 + role: TenantMemberRole = Field(description="The role of the user in the tenant.") __properties: ClassVar[List[str]] = ["role"] @@ -36,7 +39,6 @@ class UpdateTenantInviteRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "role": obj.get("role") - }) + _obj = cls.model_validate({"role": obj.get("role")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/update_tenant_request.py b/hatchet_sdk/clients/rest/models/update_tenant_request.py index 2a7cb417..431efe00 100644 --- a/hatchet_sdk/clients/rest/models/update_tenant_request.py +++ b/hatchet_sdk/clients/rest/models/update_tenant_request.py @@ -13,27 +13,63 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class UpdateTenantRequest(BaseModel): """ UpdateTenantRequest - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The name of the tenant.") - analytics_opt_out: Optional[StrictBool] = Field(default=None, description="Whether the tenant has opted out of analytics.", alias="analyticsOptOut") - alert_member_emails: Optional[StrictBool] = Field(default=None, description="Whether to alert tenant members.", alias="alertMemberEmails") - enable_workflow_run_failure_alerts: Optional[StrictBool] = Field(default=None, description="Whether to send alerts when workflow runs fail.", alias="enableWorkflowRunFailureAlerts") - enable_expiring_token_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tokens are approaching expiration.", alias="enableExpiringTokenAlerts") - enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field(default=None, description="Whether to enable alerts when tenant resources are approaching limits.", alias="enableTenantResourceLimitAlerts") - max_alerting_frequency: Optional[StrictStr] = Field(default=None, description="The max frequency at which to alert.", alias="maxAlertingFrequency") - __properties: ClassVar[List[str]] = ["name", "analyticsOptOut", "alertMemberEmails", "enableWorkflowRunFailureAlerts", "enableExpiringTokenAlerts", "enableTenantResourceLimitAlerts", "maxAlertingFrequency"] + """ # noqa: E501 + + name: Optional[StrictStr] = Field( + default=None, description="The name of the tenant." + ) + analytics_opt_out: Optional[StrictBool] = Field( + default=None, + description="Whether the tenant has opted out of analytics.", + alias="analyticsOptOut", + ) + alert_member_emails: Optional[StrictBool] = Field( + default=None, + description="Whether to alert tenant members.", + alias="alertMemberEmails", + ) + enable_workflow_run_failure_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to send alerts when workflow runs fail.", + alias="enableWorkflowRunFailureAlerts", + ) + enable_expiring_token_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to enable alerts when tokens are approaching expiration.", + alias="enableExpiringTokenAlerts", + ) + enable_tenant_resource_limit_alerts: Optional[StrictBool] = Field( + default=None, + description="Whether to enable alerts when tenant resources are approaching limits.", + alias="enableTenantResourceLimitAlerts", + ) + max_alerting_frequency: Optional[StrictStr] = Field( + default=None, + description="The max frequency at which to alert.", + alias="maxAlertingFrequency", + ) + __properties: ClassVar[List[str]] = [ + "name", + "analyticsOptOut", + "alertMemberEmails", + "enableWorkflowRunFailureAlerts", + "enableExpiringTokenAlerts", + "enableTenantResourceLimitAlerts", + "maxAlertingFrequency", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +77,6 @@ class UpdateTenantRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +101,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -85,15 +119,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "analyticsOptOut": obj.get("analyticsOptOut"), - "alertMemberEmails": obj.get("alertMemberEmails"), - "enableWorkflowRunFailureAlerts": obj.get("enableWorkflowRunFailureAlerts"), - "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), - "enableTenantResourceLimitAlerts": obj.get("enableTenantResourceLimitAlerts"), - "maxAlertingFrequency": obj.get("maxAlertingFrequency") - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "analyticsOptOut": obj.get("analyticsOptOut"), + "alertMemberEmails": obj.get("alertMemberEmails"), + "enableWorkflowRunFailureAlerts": obj.get( + "enableWorkflowRunFailureAlerts" + ), + "enableExpiringTokenAlerts": obj.get("enableExpiringTokenAlerts"), + "enableTenantResourceLimitAlerts": obj.get( + "enableTenantResourceLimitAlerts" + ), + "maxAlertingFrequency": obj.get("maxAlertingFrequency"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/update_worker_request.py b/hatchet_sdk/clients/rest/models/update_worker_request.py index ca5a0c33..73904979 100644 --- a/hatchet_sdk/clients/rest/models/update_worker_request.py +++ b/hatchet_sdk/clients/rest/models/update_worker_request.py @@ -13,20 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class UpdateWorkerRequest(BaseModel): """ UpdateWorkerRequest - """ # noqa: E501 - is_paused: Optional[StrictBool] = Field(default=None, description="Whether the worker is paused and cannot accept new runs.", alias="isPaused") + """ # noqa: E501 + + is_paused: Optional[StrictBool] = Field( + default=None, + description="Whether the worker is paused and cannot accept new runs.", + alias="isPaused", + ) __properties: ClassVar[List[str]] = ["isPaused"] model_config = ConfigDict( @@ -35,7 +41,6 @@ class UpdateWorkerRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +83,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "isPaused": obj.get("isPaused") - }) + _obj = cls.model_validate({"isPaused": obj.get("isPaused")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user.py b/hatchet_sdk/clients/rest/models/user.py index fa2162b2..a806062a 100644 --- a/hatchet_sdk/clients/rest/models/user.py +++ b/hatchet_sdk/clients/rest/models/user.py @@ -13,27 +13,50 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class User(BaseModel): """ User - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - name: Optional[StrictStr] = Field(default=None, description="The display name of the user.") + name: Optional[StrictStr] = Field( + default=None, description="The display name of the user." + ) email: StrictStr = Field(description="The email address of the user.") - email_verified: StrictBool = Field(description="Whether the user has verified their email address.", alias="emailVerified") - has_password: Optional[StrictBool] = Field(default=None, description="Whether the user has a password set.", alias="hasPassword") - email_hash: Optional[StrictStr] = Field(default=None, description="A hash of the user's email address for use with Pylon Support Chat", alias="emailHash") - __properties: ClassVar[List[str]] = ["metadata", "name", "email", "emailVerified", "hasPassword", "emailHash"] + email_verified: StrictBool = Field( + description="Whether the user has verified their email address.", + alias="emailVerified", + ) + has_password: Optional[StrictBool] = Field( + default=None, + description="Whether the user has a password set.", + alias="hasPassword", + ) + email_hash: Optional[StrictStr] = Field( + default=None, + description="A hash of the user's email address for use with Pylon Support Chat", + alias="emailHash", + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "email", + "emailVerified", + "hasPassword", + "emailHash", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +64,6 @@ class User(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +88,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,7 +97,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -88,14 +109,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "email": obj.get("email"), - "emailVerified": obj.get("emailVerified"), - "hasPassword": obj.get("hasPassword"), - "emailHash": obj.get("emailHash") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "email": obj.get("email"), + "emailVerified": obj.get("emailVerified"), + "hasPassword": obj.get("hasPassword"), + "emailHash": obj.get("emailHash"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user_change_password_request.py b/hatchet_sdk/clients/rest/models/user_change_password_request.py index d31a8429..b0b87ac4 100644 --- a/hatchet_sdk/clients/rest/models/user_change_password_request.py +++ b/hatchet_sdk/clients/rest/models/user_change_password_request.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class UserChangePasswordRequest(BaseModel): """ UserChangePasswordRequest - """ # noqa: E501 + """ # noqa: E501 + password: StrictStr = Field(description="The password of the user.") - new_password: StrictStr = Field(description="The new password for the user.", alias="newPassword") + new_password: StrictStr = Field( + description="The new password for the user.", alias="newPassword" + ) __properties: ClassVar[List[str]] = ["password", "newPassword"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class UserChangePasswordRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "password": obj.get("password"), - "newPassword": obj.get("newPassword") - }) + _obj = cls.model_validate( + {"password": obj.get("password"), "newPassword": obj.get("newPassword")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user_login_request.py b/hatchet_sdk/clients/rest/models/user_login_request.py index c35aad8c..a9ab5a8d 100644 --- a/hatchet_sdk/clients/rest/models/user_login_request.py +++ b/hatchet_sdk/clients/rest/models/user_login_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class UserLoginRequest(BaseModel): """ UserLoginRequest - """ # noqa: E501 + """ # noqa: E501 + email: StrictStr = Field(description="The email address of the user.") password: StrictStr = Field(description="The password of the user.") __properties: ClassVar[List[str]] = ["email", "password"] @@ -36,7 +38,6 @@ class UserLoginRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "email": obj.get("email"), - "password": obj.get("password") - }) + _obj = cls.model_validate( + {"email": obj.get("email"), "password": obj.get("password")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user_register_request.py b/hatchet_sdk/clients/rest/models/user_register_request.py index d2abd574..bf0c1dfa 100644 --- a/hatchet_sdk/clients/rest/models/user_register_request.py +++ b/hatchet_sdk/clients/rest/models/user_register_request.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class UserRegisterRequest(BaseModel): """ UserRegisterRequest - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the user.") email: StrictStr = Field(description="The email address of the user.") password: StrictStr = Field(description="The password of the user.") @@ -37,7 +39,6 @@ class UserRegisterRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +81,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "email": obj.get("email"), - "password": obj.get("password") - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "email": obj.get("email"), + "password": obj.get("password"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py index 49546a0b..1f45b260 100644 --- a/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +++ b/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.tenant_member import TenantMember -from typing import Optional, Set -from typing_extensions import Self + class UserTenantMembershipsList(BaseModel): """ UserTenantMembershipsList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[TenantMember]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class UserTenantMembershipsList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [TenantMember.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [TenantMember.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/user_tenant_public.py b/hatchet_sdk/clients/rest/models/user_tenant_public.py index b597ea29..42e4fe0c 100644 --- a/hatchet_sdk/clients/rest/models/user_tenant_public.py +++ b/hatchet_sdk/clients/rest/models/user_tenant_public.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class UserTenantPublic(BaseModel): """ UserTenantPublic - """ # noqa: E501 + """ # noqa: E501 + email: StrictStr = Field(description="The email address of the user.") - name: Optional[StrictStr] = Field(default=None, description="The display name of the user.") + name: Optional[StrictStr] = Field( + default=None, description="The display name of the user." + ) __properties: ClassVar[List[str]] = ["email", "name"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class UserTenantPublic(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "email": obj.get("email"), - "name": obj.get("name") - }) + _obj = cls.model_validate({"email": obj.get("email"), "name": obj.get("name")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker.py b/hatchet_sdk/clients/rest/models/webhook_worker.py index 1a4eb985..28b5731d 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class WebhookWorker(BaseModel): """ WebhookWorker - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") @@ -38,7 +41,6 @@ class WebhookWorker(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -85,11 +86,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "url": obj.get("url") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "url": obj.get("url"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py b/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py index f7b6a32f..616277e1 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py @@ -13,23 +13,27 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class WebhookWorkerCreateRequest(BaseModel): """ WebhookWorkerCreateRequest - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") - secret: Optional[Annotated[str, Field(min_length=32, strict=True)]] = Field(default=None, description="The secret key for validation. If not provided, a random secret will be generated.") + secret: Optional[Annotated[str, Field(min_length=32, strict=True)]] = Field( + default=None, + description="The secret key for validation. If not provided, a random secret will be generated.", + ) __properties: ClassVar[List[str]] = ["name", "url", "secret"] model_config = ConfigDict( @@ -38,7 +42,6 @@ class WebhookWorkerCreateRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,11 +84,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "url": obj.get("url"), - "secret": obj.get("secret") - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "url": obj.get("url"), + "secret": obj.get("secret"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py index 435c04e8..819edec0 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.webhook_worker_created import WebhookWorkerCreated + + class WebhookWorkerCreateResponse(BaseModel): """ WebhookWorkerCreateResponse - """ # noqa: E501 + """ # noqa: E501 + worker: Optional[WebhookWorkerCreated] = None __properties: ClassVar[List[str]] = ["worker"] @@ -36,7 +39,6 @@ class WebhookWorkerCreateResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -71,7 +72,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of worker if self.worker: - _dict['worker'] = self.worker.to_dict() + _dict["worker"] = self.worker.to_dict() return _dict @classmethod @@ -83,9 +84,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "worker": WebhookWorkerCreated.from_dict(obj["worker"]) if obj.get("worker") is not None else None - }) + _obj = cls.model_validate( + { + "worker": ( + WebhookWorkerCreated.from_dict(obj["worker"]) + if obj.get("worker") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_created.py b/hatchet_sdk/clients/rest/models/webhook_worker_created.py index 4167ba79..26a409ee 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_created.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_created.py @@ -13,20 +13,23 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class WebhookWorkerCreated(BaseModel): """ WebhookWorkerCreated - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr = Field(description="The name of the webhook worker.") url: StrictStr = Field(description="The webhook url.") @@ -39,7 +42,6 @@ class WebhookWorkerCreated(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -74,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -86,12 +87,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "url": obj.get("url"), - "secret": obj.get("secret") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "url": obj.get("url"), + "secret": obj.get("secret"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py index 06bc8deb..2d9e08c7 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.webhook_worker import WebhookWorker -from typing import Optional, Set -from typing_extensions import Self + class WebhookWorkerListResponse(BaseModel): """ WebhookWorkerListResponse - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[WebhookWorker]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class WebhookWorkerListResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [WebhookWorker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [WebhookWorker.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request.py b/hatchet_sdk/clients/rest/models/webhook_worker_request.py index e7779a36..07adaa3d 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request.py @@ -13,24 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.rest.models.webhook_worker_request_method import WebhookWorkerRequestMethod -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.webhook_worker_request_method import ( + WebhookWorkerRequestMethod, +) + + class WebhookWorkerRequest(BaseModel): """ WebhookWorkerRequest - """ # noqa: E501 - created_at: datetime = Field(description="The date and time the request was created.") - method: WebhookWorkerRequestMethod = Field(description="The HTTP method used for the request.") - status_code: StrictInt = Field(description="The HTTP status code of the response.", alias="statusCode") + """ # noqa: E501 + + created_at: datetime = Field( + description="The date and time the request was created." + ) + method: WebhookWorkerRequestMethod = Field( + description="The HTTP method used for the request." + ) + status_code: StrictInt = Field( + description="The HTTP status code of the response.", alias="statusCode" + ) __properties: ClassVar[List[str]] = ["created_at", "method", "statusCode"] model_config = ConfigDict( @@ -39,7 +50,6 @@ class WebhookWorkerRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,11 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "created_at": obj.get("created_at"), - "method": obj.get("method"), - "statusCode": obj.get("statusCode") - }) + _obj = cls.model_validate( + { + "created_at": obj.get("created_at"), + "method": obj.get("method"), + "statusCode": obj.get("statusCode"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py index 40dc6a89..30915cd0 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.webhook_worker_request import WebhookWorkerRequest + + class WebhookWorkerRequestListResponse(BaseModel): """ WebhookWorkerRequestListResponse - """ # noqa: E501 - requests: Optional[List[WebhookWorkerRequest]] = Field(default=None, description="The list of webhook requests.") + """ # noqa: E501 + + requests: Optional[List[WebhookWorkerRequest]] = Field( + default=None, description="The list of webhook requests." + ) __properties: ClassVar[List[str]] = ["requests"] model_config = ConfigDict( @@ -36,7 +41,6 @@ class WebhookWorkerRequestListResponse(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.requests: if _item: _items.append(_item.to_dict()) - _dict['requests'] = _items + _dict["requests"] = _items return _dict @classmethod @@ -87,9 +90,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "requests": [WebhookWorkerRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None - }) + _obj = cls.model_validate( + { + "requests": ( + [WebhookWorkerRequest.from_dict(_item) for _item in obj["requests"]] + if obj.get("requests") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py b/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py index d2963be8..14cb059f 100644 --- a/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py +++ b/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,13 +28,11 @@ class WebhookWorkerRequestMethod(str, Enum): """ allowed enum values """ - GET = 'GET' - POST = 'POST' - PUT = 'PUT' + GET = "GET" + POST = "POST" + PUT = "PUT" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WebhookWorkerRequestMethod from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/worker.py b/hatchet_sdk/clients/rest/models/worker.py index a09af9c3..48e6eda8 100644 --- a/hatchet_sdk/clients/rest/models/worker.py +++ b/hatchet_sdk/clients/rest/models/worker.py @@ -13,57 +13,117 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated +from typing_extensions import Annotated, Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.recent_step_runs import RecentStepRuns from hatchet_sdk.clients.rest.models.semaphore_slots import SemaphoreSlots from hatchet_sdk.clients.rest.models.worker_label import WorkerLabel -from typing import Optional, Set -from typing_extensions import Self + class Worker(BaseModel): """ Worker - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr = Field(description="The name of the worker.") type: StrictStr - last_heartbeat_at: Optional[datetime] = Field(default=None, description="The time this worker last sent a heartbeat.", alias="lastHeartbeatAt") - last_listener_established: Optional[datetime] = Field(default=None, description="The time this worker last sent a heartbeat.", alias="lastListenerEstablished") - actions: Optional[List[StrictStr]] = Field(default=None, description="The actions this worker can perform.") - slots: Optional[List[SemaphoreSlots]] = Field(default=None, description="The semaphore slot state for the worker.") - recent_step_runs: Optional[List[RecentStepRuns]] = Field(default=None, description="The recent step runs for the worker.", alias="recentStepRuns") - status: Optional[StrictStr] = Field(default=None, description="The status of the worker.") - max_runs: Optional[StrictInt] = Field(default=None, description="The maximum number of runs this worker can execute concurrently.", alias="maxRuns") - available_runs: Optional[StrictInt] = Field(default=None, description="The number of runs this worker can execute concurrently.", alias="availableRuns") - dispatcher_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, description="the id of the assigned dispatcher, in UUID format", alias="dispatcherId") - labels: Optional[List[WorkerLabel]] = Field(default=None, description="The current label state of the worker.") - webhook_url: Optional[StrictStr] = Field(default=None, description="The webhook URL for the worker.", alias="webhookUrl") - webhook_id: Optional[StrictStr] = Field(default=None, description="The webhook ID for the worker.", alias="webhookId") - __properties: ClassVar[List[str]] = ["metadata", "name", "type", "lastHeartbeatAt", "lastListenerEstablished", "actions", "slots", "recentStepRuns", "status", "maxRuns", "availableRuns", "dispatcherId", "labels", "webhookUrl", "webhookId"] - - @field_validator('type') + last_heartbeat_at: Optional[datetime] = Field( + default=None, + description="The time this worker last sent a heartbeat.", + alias="lastHeartbeatAt", + ) + last_listener_established: Optional[datetime] = Field( + default=None, + description="The time this worker last sent a heartbeat.", + alias="lastListenerEstablished", + ) + actions: Optional[List[StrictStr]] = Field( + default=None, description="The actions this worker can perform." + ) + slots: Optional[List[SemaphoreSlots]] = Field( + default=None, description="The semaphore slot state for the worker." + ) + recent_step_runs: Optional[List[RecentStepRuns]] = Field( + default=None, + description="The recent step runs for the worker.", + alias="recentStepRuns", + ) + status: Optional[StrictStr] = Field( + default=None, description="The status of the worker." + ) + max_runs: Optional[StrictInt] = Field( + default=None, + description="The maximum number of runs this worker can execute concurrently.", + alias="maxRuns", + ) + available_runs: Optional[StrictInt] = Field( + default=None, + description="The number of runs this worker can execute concurrently.", + alias="availableRuns", + ) + dispatcher_id: Optional[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field( + default=None, + description="the id of the assigned dispatcher, in UUID format", + alias="dispatcherId", + ) + labels: Optional[List[WorkerLabel]] = Field( + default=None, description="The current label state of the worker." + ) + webhook_url: Optional[StrictStr] = Field( + default=None, description="The webhook URL for the worker.", alias="webhookUrl" + ) + webhook_id: Optional[StrictStr] = Field( + default=None, description="The webhook ID for the worker.", alias="webhookId" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "type", + "lastHeartbeatAt", + "lastListenerEstablished", + "actions", + "slots", + "recentStepRuns", + "status", + "maxRuns", + "availableRuns", + "dispatcherId", + "labels", + "webhookUrl", + "webhookId", + ] + + @field_validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['SELFHOSTED', 'MANAGED', 'WEBHOOK']): - raise ValueError("must be one of enum values ('SELFHOSTED', 'MANAGED', 'WEBHOOK')") + if value not in set(["SELFHOSTED", "MANAGED", "WEBHOOK"]): + raise ValueError( + "must be one of enum values ('SELFHOSTED', 'MANAGED', 'WEBHOOK')" + ) return value - @field_validator('status') + @field_validator("status") def status_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['ACTIVE', 'INACTIVE', 'PAUSED']): - raise ValueError("must be one of enum values ('ACTIVE', 'INACTIVE', 'PAUSED')") + if value not in set(["ACTIVE", "INACTIVE", "PAUSED"]): + raise ValueError( + "must be one of enum values ('ACTIVE', 'INACTIVE', 'PAUSED')" + ) return value model_config = ConfigDict( @@ -72,7 +132,6 @@ def status_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -97,8 +156,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -107,28 +165,28 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in slots (list) _items = [] if self.slots: for _item in self.slots: if _item: _items.append(_item.to_dict()) - _dict['slots'] = _items + _dict["slots"] = _items # override the default output from pydantic by calling `to_dict()` of each item in recent_step_runs (list) _items = [] if self.recent_step_runs: for _item in self.recent_step_runs: if _item: _items.append(_item.to_dict()) - _dict['recentStepRuns'] = _items + _dict["recentStepRuns"] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: for _item in self.labels: if _item: _items.append(_item.to_dict()) - _dict['labels'] = _items + _dict["labels"] = _items return _dict @classmethod @@ -140,23 +198,39 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "type": obj.get("type"), - "lastHeartbeatAt": obj.get("lastHeartbeatAt"), - "lastListenerEstablished": obj.get("lastListenerEstablished"), - "actions": obj.get("actions"), - "slots": [SemaphoreSlots.from_dict(_item) for _item in obj["slots"]] if obj.get("slots") is not None else None, - "recentStepRuns": [RecentStepRuns.from_dict(_item) for _item in obj["recentStepRuns"]] if obj.get("recentStepRuns") is not None else None, - "status": obj.get("status"), - "maxRuns": obj.get("maxRuns"), - "availableRuns": obj.get("availableRuns"), - "dispatcherId": obj.get("dispatcherId"), - "labels": [WorkerLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, - "webhookUrl": obj.get("webhookUrl"), - "webhookId": obj.get("webhookId") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "type": obj.get("type"), + "lastHeartbeatAt": obj.get("lastHeartbeatAt"), + "lastListenerEstablished": obj.get("lastListenerEstablished"), + "actions": obj.get("actions"), + "slots": ( + [SemaphoreSlots.from_dict(_item) for _item in obj["slots"]] + if obj.get("slots") is not None + else None + ), + "recentStepRuns": ( + [RecentStepRuns.from_dict(_item) for _item in obj["recentStepRuns"]] + if obj.get("recentStepRuns") is not None + else None + ), + "status": obj.get("status"), + "maxRuns": obj.get("maxRuns"), + "availableRuns": obj.get("availableRuns"), + "dispatcherId": obj.get("dispatcherId"), + "labels": ( + [WorkerLabel.from_dict(_item) for _item in obj["labels"]] + if obj.get("labels") is not None + else None + ), + "webhookUrl": obj.get("webhookUrl"), + "webhookId": obj.get("webhookId"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/worker_label.py b/hatchet_sdk/clients/rest/models/worker_label.py index 75f6b49b..151febce 100644 --- a/hatchet_sdk/clients/rest/models/worker_label.py +++ b/hatchet_sdk/clients/rest/models/worker_label.py @@ -13,23 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class WorkerLabel(BaseModel): """ WorkerLabel - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta key: StrictStr = Field(description="The key of the label.") - value: Optional[StrictStr] = Field(default=None, description="The value of the label.") + value: Optional[StrictStr] = Field( + default=None, description="The value of the label." + ) __properties: ClassVar[List[str]] = ["metadata", "key", "value"] model_config = ConfigDict( @@ -38,7 +43,6 @@ class WorkerLabel(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -85,11 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "key": obj.get("key"), - "value": obj.get("value") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "key": obj.get("key"), + "value": obj.get("value"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/worker_list.py b/hatchet_sdk/clients/rest/models/worker_list.py index 99c46339..3ffa4349 100644 --- a/hatchet_sdk/clients/rest/models/worker_list.py +++ b/hatchet_sdk/clients/rest/models/worker_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.worker import Worker -from typing import Optional, Set -from typing_extensions import Self + class WorkerList(BaseModel): """ WorkerList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[Worker]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class WorkerList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [Worker.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [Worker.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow.py b/hatchet_sdk/clients/rest/models/workflow.py index b547619a..42fd94dd 100644 --- a/hatchet_sdk/clients/rest/models/workflow.py +++ b/hatchet_sdk/clients/rest/models/workflow.py @@ -13,29 +13,49 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing_extensions import Self -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.workflow_tag import WorkflowTag -from typing import Optional, Set -from typing_extensions import Self + class Workflow(BaseModel): """ Workflow - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta name: StrictStr = Field(description="The name of the workflow.") - description: Optional[StrictStr] = Field(default=None, description="The description of the workflow.") + description: Optional[StrictStr] = Field( + default=None, description="The description of the workflow." + ) + is_paused: Optional[StrictBool] = Field( + default=None, description="Whether the workflow is paused.", alias="isPaused" + ) versions: Optional[List[WorkflowVersionMeta]] = None - tags: Optional[List[WorkflowTag]] = Field(default=None, description="The tags of the workflow.") - jobs: Optional[List[Job]] = Field(default=None, description="The jobs of the workflow.") - __properties: ClassVar[List[str]] = ["metadata", "name", "description", "versions", "tags", "jobs"] + tags: Optional[List[WorkflowTag]] = Field( + default=None, description="The tags of the workflow." + ) + jobs: Optional[List[Job]] = Field( + default=None, description="The jobs of the workflow." + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "description", + "isPaused", + "versions", + "tags", + "jobs", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +63,6 @@ class Workflow(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +87,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,28 +96,28 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in versions (list) _items = [] if self.versions: for _item in self.versions: if _item: _items.append(_item.to_dict()) - _dict['versions'] = _items + _dict["versions"] = _items # override the default output from pydantic by calling `to_dict()` of each item in tags (list) _items = [] if self.tags: for _item in self.tags: if _item: _items.append(_item.to_dict()) - _dict['tags'] = _items + _dict["tags"] = _items # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: for _item in self.jobs: if _item: _items.append(_item.to_dict()) - _dict['jobs'] = _items + _dict["jobs"] = _items return _dict @classmethod @@ -111,17 +129,37 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "description": obj.get("description"), - "versions": [WorkflowVersionMeta.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None, - "tags": [WorkflowTag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None, - "jobs": [Job.from_dict(_item) for _item in obj["jobs"]] if obj.get("jobs") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "description": obj.get("description"), + "isPaused": obj.get("isPaused"), + "versions": ( + [WorkflowVersionMeta.from_dict(_item) for _item in obj["versions"]] + if obj.get("versions") is not None + else None + ), + "tags": ( + [WorkflowTag.from_dict(_item) for _item in obj["tags"]] + if obj.get("tags") is not None + else None + ), + "jobs": ( + [Job.from_dict(_item) for _item in obj["jobs"]] + if obj.get("jobs") is not None + else None + ), + } + ) return _obj + from hatchet_sdk.clients.rest.models.workflow_version_meta import WorkflowVersionMeta + # TODO: Rewrite to not use raise_errors Workflow.model_rebuild(raise_errors=False) - diff --git a/hatchet_sdk/clients/rest/models/workflow_concurrency.py b/hatchet_sdk/clients/rest/models/workflow_concurrency.py index 44a8340c..db3bf854 100644 --- a/hatchet_sdk/clients/rest/models/workflow_concurrency.py +++ b/hatchet_sdk/clients/rest/models/workflow_concurrency.py @@ -13,29 +13,47 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class WorkflowConcurrency(BaseModel): """ WorkflowConcurrency - """ # noqa: E501 - max_runs: StrictInt = Field(description="The maximum number of concurrent workflow runs.", alias="maxRuns") - limit_strategy: StrictStr = Field(description="The strategy to use when the concurrency limit is reached.", alias="limitStrategy") - get_concurrency_group: StrictStr = Field(description="An action which gets the concurrency group for the WorkflowRun.", alias="getConcurrencyGroup") - __properties: ClassVar[List[str]] = ["maxRuns", "limitStrategy", "getConcurrencyGroup"] + """ # noqa: E501 + + max_runs: StrictInt = Field( + description="The maximum number of concurrent workflow runs.", alias="maxRuns" + ) + limit_strategy: StrictStr = Field( + description="The strategy to use when the concurrency limit is reached.", + alias="limitStrategy", + ) + get_concurrency_group: StrictStr = Field( + description="An action which gets the concurrency group for the WorkflowRun.", + alias="getConcurrencyGroup", + ) + __properties: ClassVar[List[str]] = [ + "maxRuns", + "limitStrategy", + "getConcurrencyGroup", + ] - @field_validator('limit_strategy') + @field_validator("limit_strategy") def limit_strategy_validate_enum(cls, value): """Validates the enum""" - if value not in set(['CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN']): - raise ValueError("must be one of enum values ('CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN')") + if value not in set( + ["CANCEL_IN_PROGRESS", "DROP_NEWEST", "QUEUE_NEWEST", "GROUP_ROUND_ROBIN"] + ): + raise ValueError( + "must be one of enum values ('CANCEL_IN_PROGRESS', 'DROP_NEWEST', 'QUEUE_NEWEST', 'GROUP_ROUND_ROBIN')" + ) return value model_config = ConfigDict( @@ -44,7 +62,6 @@ def limit_strategy_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -88,11 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "maxRuns": obj.get("maxRuns"), - "limitStrategy": obj.get("limitStrategy"), - "getConcurrencyGroup": obj.get("getConcurrencyGroup") - }) + _obj = cls.model_validate( + { + "maxRuns": obj.get("maxRuns"), + "limitStrategy": obj.get("limitStrategy"), + "getConcurrencyGroup": obj.get("getConcurrencyGroup"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_kind.py b/hatchet_sdk/clients/rest/models/workflow_kind.py index d91ef68a..e258a048 100644 --- a/hatchet_sdk/clients/rest/models/workflow_kind.py +++ b/hatchet_sdk/clients/rest/models/workflow_kind.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,13 +28,11 @@ class WorkflowKind(str, Enum): """ allowed enum values """ - FUNCTION = 'FUNCTION' - DURABLE = 'DURABLE' - DAG = 'DAG' + FUNCTION = "FUNCTION" + DURABLE = "DURABLE" + DAG = "DAG" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowKind from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/workflow_list.py b/hatchet_sdk/clients/rest/models/workflow_list.py index 3f6ba942..72f9fb90 100644 --- a/hatchet_sdk/clients/rest/models/workflow_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_list.py @@ -13,22 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.workflow import Workflow -from typing import Optional, Set -from typing_extensions import Self + class WorkflowList(BaseModel): """ WorkflowList - """ # noqa: E501 + """ # noqa: E501 + metadata: Optional[APIResourceMeta] = None rows: Optional[List[Workflow]] = None pagination: Optional[PaginationResponse] = None @@ -40,7 +43,6 @@ class WorkflowList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,17 +76,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -97,11 +98,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "rows": [Workflow.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "rows": ( + [Workflow.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_metrics.py b/hatchet_sdk/clients/rest/models/workflow_metrics.py index 5b0dccc8..8158e732 100644 --- a/hatchet_sdk/clients/rest/models/workflow_metrics.py +++ b/hatchet_sdk/clients/rest/models/workflow_metrics.py @@ -13,21 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class WorkflowMetrics(BaseModel): """ WorkflowMetrics - """ # noqa: E501 - group_key_runs_count: Optional[StrictInt] = Field(default=None, description="The number of runs for a specific group key (passed via filter)", alias="groupKeyRunsCount") - group_key_count: Optional[StrictInt] = Field(default=None, description="The total number of concurrency group keys.", alias="groupKeyCount") + """ # noqa: E501 + + group_key_runs_count: Optional[StrictInt] = Field( + default=None, + description="The number of runs for a specific group key (passed via filter)", + alias="groupKeyRunsCount", + ) + group_key_count: Optional[StrictInt] = Field( + default=None, + description="The total number of concurrency group keys.", + alias="groupKeyCount", + ) __properties: ClassVar[List[str]] = ["groupKeyRunsCount", "groupKeyCount"] model_config = ConfigDict( @@ -36,7 +46,6 @@ class WorkflowMetrics(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +88,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "groupKeyRunsCount": obj.get("groupKeyRunsCount"), - "groupKeyCount": obj.get("groupKeyCount") - }) + _obj = cls.model_validate( + { + "groupKeyRunsCount": obj.get("groupKeyRunsCount"), + "groupKeyCount": obj.get("groupKeyCount"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run.py b/hatchet_sdk/clients/rest/models/workflow_run.py index cffcdf30..3362b830 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run.py +++ b/hatchet_sdk/clients/rest/models/workflow_run.py @@ -13,29 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated +from typing_extensions import Annotated, Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.workflow_run_status import WorkflowRunStatus -from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import WorkflowRunTriggeredBy +from hatchet_sdk.clients.rest.models.workflow_run_triggered_by import ( + WorkflowRunTriggeredBy, +) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from typing import Optional, Set -from typing_extensions import Self + class WorkflowRun(BaseModel): """ WorkflowRun - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta tenant_id: StrictStr = Field(alias="tenantId") workflow_version_id: StrictStr = Field(alias="workflowVersionId") - workflow_version: Optional[WorkflowVersion] = Field(default=None, alias="workflowVersion") + workflow_version: Optional[WorkflowVersion] = Field( + default=None, alias="workflowVersion" + ) status: WorkflowRunStatus display_name: Optional[StrictStr] = Field(default=None, alias="displayName") job_runs: Optional[List[JobRun]] = Field(default=None, alias="jobRuns") @@ -45,10 +51,33 @@ class WorkflowRun(BaseModel): started_at: Optional[datetime] = Field(default=None, alias="startedAt") finished_at: Optional[datetime] = Field(default=None, alias="finishedAt") duration: Optional[StrictInt] = None - parent_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, alias="parentId") - parent_step_run_id: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(default=None, alias="parentStepRunId") - additional_metadata: Optional[Dict[str, Any]] = Field(default=None, alias="additionalMetadata") - __properties: ClassVar[List[str]] = ["metadata", "tenantId", "workflowVersionId", "workflowVersion", "status", "displayName", "jobRuns", "triggeredBy", "input", "error", "startedAt", "finishedAt", "duration", "parentId", "parentStepRunId", "additionalMetadata"] + parent_id: Optional[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field(default=None, alias="parentId") + parent_step_run_id: Optional[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field(default=None, alias="parentStepRunId") + additional_metadata: Optional[Dict[str, Any]] = Field( + default=None, alias="additionalMetadata" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "tenantId", + "workflowVersionId", + "workflowVersion", + "status", + "displayName", + "jobRuns", + "triggeredBy", + "input", + "error", + "startedAt", + "finishedAt", + "duration", + "parentId", + "parentStepRunId", + "additionalMetadata", + ] model_config = ConfigDict( populate_by_name=True, @@ -56,7 +85,6 @@ class WorkflowRun(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -81,8 +109,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -91,20 +118,20 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow_version if self.workflow_version: - _dict['workflowVersion'] = self.workflow_version.to_dict() + _dict["workflowVersion"] = self.workflow_version.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in job_runs (list) _items = [] if self.job_runs: for _item in self.job_runs: if _item: _items.append(_item.to_dict()) - _dict['jobRuns'] = _items + _dict["jobRuns"] = _items # override the default output from pydantic by calling `to_dict()` of triggered_by if self.triggered_by: - _dict['triggeredBy'] = self.triggered_by.to_dict() + _dict["triggeredBy"] = self.triggered_by.to_dict() return _dict @classmethod @@ -116,27 +143,46 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "tenantId": obj.get("tenantId"), - "workflowVersionId": obj.get("workflowVersionId"), - "workflowVersion": WorkflowVersion.from_dict(obj["workflowVersion"]) if obj.get("workflowVersion") is not None else None, - "status": obj.get("status"), - "displayName": obj.get("displayName"), - "jobRuns": [JobRun.from_dict(_item) for _item in obj["jobRuns"]] if obj.get("jobRuns") is not None else None, - "triggeredBy": WorkflowRunTriggeredBy.from_dict(obj["triggeredBy"]) if obj.get("triggeredBy") is not None else None, - "input": obj.get("input"), - "error": obj.get("error"), - "startedAt": obj.get("startedAt"), - "finishedAt": obj.get("finishedAt"), - "duration": obj.get("duration"), - "parentId": obj.get("parentId"), - "parentStepRunId": obj.get("parentStepRunId"), - "additionalMetadata": obj.get("additionalMetadata") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "tenantId": obj.get("tenantId"), + "workflowVersionId": obj.get("workflowVersionId"), + "workflowVersion": ( + WorkflowVersion.from_dict(obj["workflowVersion"]) + if obj.get("workflowVersion") is not None + else None + ), + "status": obj.get("status"), + "displayName": obj.get("displayName"), + "jobRuns": ( + [JobRun.from_dict(_item) for _item in obj["jobRuns"]] + if obj.get("jobRuns") is not None + else None + ), + "triggeredBy": ( + WorkflowRunTriggeredBy.from_dict(obj["triggeredBy"]) + if obj.get("triggeredBy") is not None + else None + ), + "input": obj.get("input"), + "error": obj.get("error"), + "startedAt": obj.get("startedAt"), + "finishedAt": obj.get("finishedAt"), + "duration": obj.get("duration"), + "parentId": obj.get("parentId"), + "parentStepRunId": obj.get("parentStepRunId"), + "additionalMetadata": obj.get("additionalMetadata"), + } + ) return _obj + from hatchet_sdk.clients.rest.models.job_run import JobRun + # TODO: Rewrite to not use raise_errors WorkflowRun.model_rebuild(raise_errors=False) - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py b/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py index 6e82154b..fbf545be 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class WorkflowRunCancel200Response(BaseModel): """ WorkflowRunCancel200Response - """ # noqa: E501 - workflow_run_ids: Optional[List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]]] = Field(default=None, alias="workflowRunIds") + """ # noqa: E501 + + workflow_run_ids: Optional[ + List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] + ] = Field(default=None, alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -36,7 +39,6 @@ class WorkflowRunCancel200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "workflowRunIds": obj.get("workflowRunIds") - }) + _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_list.py b/hatchet_sdk/clients/rest/models/workflow_run_list.py index 36b3b9f5..e57a14f4 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_list.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun -from typing import Optional, Set -from typing_extensions import Self + class WorkflowRunList(BaseModel): """ WorkflowRunList - """ # noqa: E501 + """ # noqa: E501 + rows: Optional[List[WorkflowRun]] = None pagination: Optional[PaginationResponse] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -38,7 +41,6 @@ class WorkflowRunList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +78,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rows": [WorkflowRun.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "rows": ( + [WorkflowRun.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py b/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py index 4bc03671..4b499699 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class WorkflowRunOrderByDirection(str, Enum): """ allowed enum values """ - ASC = 'ASC' - DESC = 'DESC' + ASC = "ASC" + DESC = "DESC" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunOrderByDirection from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py b/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py index 3d47ecc8..bad42454 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,14 +28,12 @@ class WorkflowRunOrderByField(str, Enum): """ allowed enum values """ - CREATEDAT = 'createdAt' - STARTEDAT = 'startedAt' - FINISHEDAT = 'finishedAt' - DURATION = 'duration' + CREATEDAT = "createdAt" + STARTEDAT = "startedAt" + FINISHEDAT = "finishedAt" + DURATION = "duration" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunOrderByField from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_shape.py b/hatchet_sdk/clients/rest/models/workflow_run_shape.py index 426e7ef9..dec6a4fd 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_shape.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_shape.py @@ -128,9 +128,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in job_runs (list) _items = [] if self.job_runs: - for _item_job_runs in self.job_runs: - if _item_job_runs: - _items.append(_item_job_runs.to_dict()) + for _item in self.job_runs: + if _item: + _items.append(_item.to_dict()) _dict["jobRuns"] = _items # override the default output from pydantic by calling `to_dict()` of triggered_by if self.triggered_by: diff --git a/hatchet_sdk/clients/rest/models/workflow_run_status.py b/hatchet_sdk/clients/rest/models/workflow_run_status.py index 68fb4154..a7931216 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_status.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_status.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,16 +28,14 @@ class WorkflowRunStatus(str, Enum): """ allowed enum values """ - PENDING = 'PENDING' - RUNNING = 'RUNNING' - SUCCEEDED = 'SUCCEEDED' - FAILED = 'FAILED' - CANCELLED = 'CANCELLED' - QUEUED = 'QUEUED' + PENDING = "PENDING" + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" + QUEUED = "QUEUED" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of WorkflowRunStatus from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py index 07dbebcd..8cbe1c11 100644 --- a/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py +++ b/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py @@ -13,28 +13,37 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.rest.models.event import Event -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class WorkflowRunTriggeredBy(BaseModel): """ WorkflowRunTriggeredBy - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta - parent_id: StrictStr = Field(alias="parentId") + parent_workflow_run_id: Optional[StrictStr] = Field( + default=None, alias="parentWorkflowRunId" + ) event_id: Optional[StrictStr] = Field(default=None, alias="eventId") - event: Optional[Event] = None cron_parent_id: Optional[StrictStr] = Field(default=None, alias="cronParentId") cron_schedule: Optional[StrictStr] = Field(default=None, alias="cronSchedule") - __properties: ClassVar[List[str]] = ["metadata", "parentId", "eventId", "event", "cronParentId", "cronSchedule"] + __properties: ClassVar[List[str]] = [ + "metadata", + "parentWorkflowRunId", + "eventId", + "cronParentId", + "cronSchedule", + ] model_config = ConfigDict( populate_by_name=True, @@ -42,7 +51,6 @@ class WorkflowRunTriggeredBy(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +75,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +84,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() - # override the default output from pydantic by calling `to_dict()` of event - if self.event: - _dict['event'] = self.event.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -92,14 +96,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "parentId": obj.get("parentId"), - "eventId": obj.get("eventId"), - "event": Event.from_dict(obj["event"]) if obj.get("event") is not None else None, - "cronParentId": obj.get("cronParentId"), - "cronSchedule": obj.get("cronSchedule") - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "parentWorkflowRunId": obj.get("parentWorkflowRunId"), + "eventId": obj.get("eventId"), + "cronParentId": obj.get("cronParentId"), + "cronSchedule": obj.get("cronSchedule"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py b/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py index d545a282..d5557cda 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class WorkflowRunsCancelRequest(BaseModel): """ WorkflowRunsCancelRequest - """ # noqa: E501 - workflow_run_ids: List[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = Field(alias="workflowRunIds") + """ # noqa: E501 + + workflow_run_ids: List[ + Annotated[str, Field(min_length=36, strict=True, max_length=36)] + ] = Field(alias="workflowRunIds") __properties: ClassVar[List[str]] = ["workflowRunIds"] model_config = ConfigDict( @@ -36,7 +39,6 @@ class WorkflowRunsCancelRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "workflowRunIds": obj.get("workflowRunIds") - }) + _obj = cls.model_validate({"workflowRunIds": obj.get("workflowRunIds")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py index ad171718..5f70c441 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py @@ -13,20 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.workflow_runs_metrics_counts import ( + WorkflowRunsMetricsCounts, +) + + class WorkflowRunsMetrics(BaseModel): """ WorkflowRunsMetrics - """ # noqa: E501 - counts: Optional[Dict[str, Any]] = None + """ # noqa: E501 + + counts: Optional[WorkflowRunsMetricsCounts] = None __properties: ClassVar[List[str]] = ["counts"] model_config = ConfigDict( @@ -35,7 +41,6 @@ class WorkflowRunsMetrics(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -70,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of counts if self.counts: - _dict['counts'] = self.counts.to_dict() + _dict["counts"] = self.counts.to_dict() return _dict @classmethod @@ -82,9 +86,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "counts": WorkflowRunsMetricsCounts.from_dict(obj["counts"]) if obj.get("counts") is not None else None - }) + _obj = cls.model_validate( + { + "counts": ( + WorkflowRunsMetricsCounts.from_dict(obj["counts"]) + if obj.get("counts") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py b/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py index 3695d60e..c80b0997 100644 --- a/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py +++ b/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py @@ -13,25 +13,33 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class WorkflowRunsMetricsCounts(BaseModel): """ WorkflowRunsMetricsCounts - """ # noqa: E501 + """ # noqa: E501 + pending: Optional[StrictInt] = Field(default=None, alias="PENDING") running: Optional[StrictInt] = Field(default=None, alias="RUNNING") succeeded: Optional[StrictInt] = Field(default=None, alias="SUCCEEDED") failed: Optional[StrictInt] = Field(default=None, alias="FAILED") queued: Optional[StrictInt] = Field(default=None, alias="QUEUED") - __properties: ClassVar[List[str]] = ["PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] + __properties: ClassVar[List[str]] = [ + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "QUEUED", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +47,6 @@ class WorkflowRunsMetricsCounts(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +71,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,13 +89,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "PENDING": obj.get("PENDING"), - "RUNNING": obj.get("RUNNING"), - "SUCCEEDED": obj.get("SUCCEEDED"), - "FAILED": obj.get("FAILED"), - "QUEUED": obj.get("QUEUED") - }) + _obj = cls.model_validate( + { + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_tag.py b/hatchet_sdk/clients/rest/models/workflow_tag.py index 28a68afc..fcd3423a 100644 --- a/hatchet_sdk/clients/rest/models/workflow_tag.py +++ b/hatchet_sdk/clients/rest/models/workflow_tag.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class WorkflowTag(BaseModel): """ WorkflowTag - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the workflow.") color: StrictStr = Field(description="The description of the workflow.") __properties: ClassVar[List[str]] = ["name", "color"] @@ -36,7 +38,6 @@ class WorkflowTag(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "color": obj.get("color") - }) + _obj = cls.model_validate({"name": obj.get("name"), "color": obj.get("color")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py b/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py index 550e9609..1750e659 100644 --- a/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py +++ b/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class WorkflowTriggerCronRef(BaseModel): """ WorkflowTriggerCronRef - """ # noqa: E501 + """ # noqa: E501 + parent_id: Optional[StrictStr] = None cron: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["parent_id", "cron"] @@ -36,7 +38,6 @@ class WorkflowTriggerCronRef(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "parent_id": obj.get("parent_id"), - "cron": obj.get("cron") - }) + _obj = cls.model_validate( + {"parent_id": obj.get("parent_id"), "cron": obj.get("cron")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py b/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py index d2b7db76..cfabbe02 100644 --- a/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py +++ b/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class WorkflowTriggerEventRef(BaseModel): """ WorkflowTriggerEventRef - """ # noqa: E501 + """ # noqa: E501 + parent_id: Optional[StrictStr] = None event_key: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["parent_id", "event_key"] @@ -36,7 +38,6 @@ class WorkflowTriggerEventRef(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "parent_id": obj.get("parent_id"), - "event_key": obj.get("event_key") - }) + _obj = cls.model_validate( + {"parent_id": obj.get("parent_id"), "event_key": obj.get("event_key")} + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_triggers.py b/hatchet_sdk/clients/rest/models/workflow_triggers.py index 77a69376..d3fff3f1 100644 --- a/hatchet_sdk/clients/rest/models/workflow_triggers.py +++ b/hatchet_sdk/clients/rest/models/workflow_triggers.py @@ -13,28 +13,41 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import WorkflowTriggerCronRef -from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import WorkflowTriggerEventRef -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta +from hatchet_sdk.clients.rest.models.workflow_trigger_cron_ref import ( + WorkflowTriggerCronRef, +) +from hatchet_sdk.clients.rest.models.workflow_trigger_event_ref import ( + WorkflowTriggerEventRef, +) + + class WorkflowTriggers(BaseModel): """ WorkflowTriggers - """ # noqa: E501 + """ # noqa: E501 + metadata: Optional[APIResourceMeta] = None workflow_version_id: Optional[StrictStr] = None tenant_id: Optional[StrictStr] = None events: Optional[List[WorkflowTriggerEventRef]] = None crons: Optional[List[WorkflowTriggerCronRef]] = None - __properties: ClassVar[List[str]] = ["metadata", "workflow_version_id", "tenant_id", "events", "crons"] + __properties: ClassVar[List[str]] = [ + "metadata", + "workflow_version_id", + "tenant_id", + "events", + "crons", + ] model_config = ConfigDict( populate_by_name=True, @@ -42,7 +55,6 @@ class WorkflowTriggers(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +79,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,21 +88,21 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in events (list) _items = [] if self.events: for _item in self.events: if _item: _items.append(_item.to_dict()) - _dict['events'] = _items + _dict["events"] = _items # override the default output from pydantic by calling `to_dict()` of each item in crons (list) _items = [] if self.crons: for _item in self.crons: if _item: _items.append(_item.to_dict()) - _dict['crons'] = _items + _dict["crons"] = _items return _dict @classmethod @@ -103,13 +114,28 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "workflow_version_id": obj.get("workflow_version_id"), - "tenant_id": obj.get("tenant_id"), - "events": [WorkflowTriggerEventRef.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, - "crons": [WorkflowTriggerCronRef.from_dict(_item) for _item in obj["crons"]] if obj.get("crons") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "workflow_version_id": obj.get("workflow_version_id"), + "tenant_id": obj.get("tenant_id"), + "events": ( + [ + WorkflowTriggerEventRef.from_dict(_item) + for _item in obj["events"] + ] + if obj.get("events") is not None + else None + ), + "crons": ( + [WorkflowTriggerCronRef.from_dict(_item) for _item in obj["crons"]] + if obj.get("crons") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_update_request.py b/hatchet_sdk/clients/rest/models/workflow_update_request.py new file mode 100644 index 00000000..59710e86 --- /dev/null +++ b/hatchet_sdk/clients/rest/models/workflow_update_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WorkflowUpdateRequest(BaseModel): + """ + WorkflowUpdateRequest + """ # noqa: E501 + is_paused: Optional[StrictBool] = Field(default=None, description="Whether the workflow is paused.", alias="isPaused") + __properties: ClassVar[List[str]] = ["isPaused"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkflowUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkflowUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "isPaused": obj.get("isPaused") + }) + return _obj + + diff --git a/hatchet_sdk/clients/rest/models/workflow_version.py b/hatchet_sdk/clients/rest/models/workflow_version.py index 9da07553..87d0cb29 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version.py +++ b/hatchet_sdk/clients/rest/models/workflow_version.py @@ -13,34 +13,57 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.rest.models.job import Job from hatchet_sdk.clients.rest.models.workflow import Workflow from hatchet_sdk.clients.rest.models.workflow_concurrency import WorkflowConcurrency from hatchet_sdk.clients.rest.models.workflow_triggers import WorkflowTriggers -from typing import Optional, Set -from typing_extensions import Self + class WorkflowVersion(BaseModel): """ WorkflowVersion - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta version: StrictStr = Field(description="The version of the workflow.") order: StrictInt workflow_id: StrictStr = Field(alias="workflowId") + sticky: Optional[StrictStr] = Field( + default=None, description="The sticky strategy of the workflow." + ) + default_priority: Optional[StrictInt] = Field( + default=None, + description="The default priority of the workflow.", + alias="defaultPriority", + ) workflow: Optional[Workflow] = None concurrency: Optional[WorkflowConcurrency] = None triggers: Optional[WorkflowTriggers] = None schedule_timeout: Optional[StrictStr] = Field(default=None, alias="scheduleTimeout") jobs: Optional[List[Job]] = None - __properties: ClassVar[List[str]] = ["metadata", "version", "order", "workflowId", "workflow", "concurrency", "triggers", "scheduleTimeout", "jobs"] + __properties: ClassVar[List[str]] = [ + "metadata", + "version", + "order", + "workflowId", + "sticky", + "defaultPriority", + "workflow", + "concurrency", + "triggers", + "scheduleTimeout", + "jobs", + ] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +71,6 @@ class WorkflowVersion(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,8 +95,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,23 +104,23 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow if self.workflow: - _dict['workflow'] = self.workflow.to_dict() + _dict["workflow"] = self.workflow.to_dict() # override the default output from pydantic by calling `to_dict()` of concurrency if self.concurrency: - _dict['concurrency'] = self.concurrency.to_dict() + _dict["concurrency"] = self.concurrency.to_dict() # override the default output from pydantic by calling `to_dict()` of triggers if self.triggers: - _dict['triggers'] = self.triggers.to_dict() + _dict["triggers"] = self.triggers.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in jobs (list) _items = [] if self.jobs: for _item in self.jobs: if _item: _items.append(_item.to_dict()) - _dict['jobs'] = _items + _dict["jobs"] = _items return _dict @classmethod @@ -111,17 +132,39 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "version": obj.get("version"), - "order": obj.get("order"), - "workflowId": obj.get("workflowId"), - "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None, - "concurrency": WorkflowConcurrency.from_dict(obj["concurrency"]) if obj.get("concurrency") is not None else None, - "triggers": WorkflowTriggers.from_dict(obj["triggers"]) if obj.get("triggers") is not None else None, - "scheduleTimeout": obj.get("scheduleTimeout"), - "jobs": [Job.from_dict(_item) for _item in obj["jobs"]] if obj.get("jobs") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "version": obj.get("version"), + "order": obj.get("order"), + "workflowId": obj.get("workflowId"), + "sticky": obj.get("sticky"), + "defaultPriority": obj.get("defaultPriority"), + "workflow": ( + Workflow.from_dict(obj["workflow"]) + if obj.get("workflow") is not None + else None + ), + "concurrency": ( + WorkflowConcurrency.from_dict(obj["concurrency"]) + if obj.get("concurrency") is not None + else None + ), + "triggers": ( + WorkflowTriggers.from_dict(obj["triggers"]) + if obj.get("triggers") is not None + else None + ), + "scheduleTimeout": obj.get("scheduleTimeout"), + "jobs": ( + [Job.from_dict(_item) for _item in obj["jobs"]] + if obj.get("jobs") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_version_definition.py b/hatchet_sdk/clients/rest/models/workflow_version_definition.py index dd0f9847..3f44c23a 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version_definition.py +++ b/hatchet_sdk/clients/rest/models/workflow_version_definition.py @@ -13,20 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class WorkflowVersionDefinition(BaseModel): """ WorkflowVersionDefinition - """ # noqa: E501 - raw_definition: StrictStr = Field(description="The raw YAML definition of the workflow.", alias="rawDefinition") + """ # noqa: E501 + + raw_definition: StrictStr = Field( + description="The raw YAML definition of the workflow.", alias="rawDefinition" + ) __properties: ClassVar[List[str]] = ["rawDefinition"] model_config = ConfigDict( @@ -35,7 +39,6 @@ class WorkflowVersionDefinition(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rawDefinition": obj.get("rawDefinition") - }) + _obj = cls.model_validate({"rawDefinition": obj.get("rawDefinition")}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_version_meta.py b/hatchet_sdk/clients/rest/models/workflow_version_meta.py index 92bc0d16..be2c5672 100644 --- a/hatchet_sdk/clients/rest/models/workflow_version_meta.py +++ b/hatchet_sdk/clients/rest/models/workflow_version_meta.py @@ -13,26 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.rest.models.api_resource_meta import APIResourceMeta + + class WorkflowVersionMeta(BaseModel): """ WorkflowVersionMeta - """ # noqa: E501 + """ # noqa: E501 + metadata: APIResourceMeta version: StrictStr = Field(description="The version of the workflow.") order: StrictInt workflow_id: StrictStr = Field(alias="workflowId") workflow: Optional[Workflow] = None - __properties: ClassVar[List[str]] = ["metadata", "version", "order", "workflowId", "workflow"] + __properties: ClassVar[List[str]] = [ + "metadata", + "version", + "order", + "workflowId", + "workflow", + ] model_config = ConfigDict( populate_by_name=True, @@ -40,7 +49,6 @@ class WorkflowVersionMeta(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,10 +82,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of workflow if self.workflow: - _dict['workflow'] = self.workflow.to_dict() + _dict["workflow"] = self.workflow.to_dict() return _dict @classmethod @@ -90,16 +97,27 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": APIResourceMeta.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "version": obj.get("version"), - "order": obj.get("order"), - "workflowId": obj.get("workflowId"), - "workflow": Workflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + APIResourceMeta.from_dict(obj["metadata"]) + if obj.get("metadata") is not None + else None + ), + "version": obj.get("version"), + "order": obj.get("order"), + "workflowId": obj.get("workflowId"), + "workflow": ( + Workflow.from_dict(obj["workflow"]) + if obj.get("workflow") is not None + else None + ), + } + ) return _obj + from hatchet_sdk.clients.rest.models.workflow import Workflow + # TODO: Rewrite to not use raise_errors WorkflowVersionMeta.model_rebuild(raise_errors=False) - diff --git a/hatchet_sdk/clients/rest/rest.py b/hatchet_sdk/clients/rest/rest.py index fb4880ec..67566fa1 100644 --- a/hatchet_sdk/clients/rest/rest.py +++ b/hatchet_sdk/clients/rest/rest.py @@ -25,7 +25,8 @@ RESTResponseType = aiohttp.ClientResponse -ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) +ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"}) + class RESTResponse(io.IOBase): @@ -56,9 +57,7 @@ def __init__(self, configuration) -> None: # maxsize is number of requests to host that are allowed in parallel maxsize = configuration.connection_pool_maxsize - ssl_context = ssl.create_default_context( - cafile=configuration.ssl_ca_cert - ) + ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) if configuration.cert_file: ssl_context.load_cert_chain( configuration.cert_file, keyfile=configuration.key_file @@ -68,19 +67,13 @@ def __init__(self, configuration) -> None: ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE - connector = aiohttp.TCPConnector( - limit=maxsize, - ssl=ssl_context - ) + connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context) self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers # https pool manager - self.pool_manager = aiohttp.ClientSession( - connector=connector, - trust_env=True - ) + self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) retries = configuration.retries self.retry_client: Optional[aiohttp_retry.RetryClient] @@ -88,11 +81,8 @@ def __init__(self, configuration) -> None: self.retry_client = aiohttp_retry.RetryClient( client_session=self.pool_manager, retry_options=aiohttp_retry.ExponentialRetry( - attempts=retries, - factor=0.0, - start_timeout=0.0, - max_timeout=120.0 - ) + attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 + ), ) else: self.retry_client = None @@ -109,7 +99,7 @@ async def request( headers=None, body=None, post_params=None, - _request_timeout=None + _request_timeout=None, ): """Execute request @@ -126,15 +116,7 @@ async def request( (connection, read) timeouts. """ method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] if post_params and body: raise ApiValueError( @@ -146,15 +128,10 @@ async def request( # url already contains the URL query string timeout = _request_timeout or 5 * 60 - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" - args = { - "method": method, - "url": url, - "timeout": timeout, - "headers": headers - } + args = {"method": method, "url": url, "timeout": timeout, "headers": headers} if self.proxy: args["proxy"] = self.proxy @@ -162,27 +139,22 @@ async def request( args["proxy_headers"] = self.proxy_headers # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if re.search('json', headers['Content-Type'], re.IGNORECASE): + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if re.search("json", headers["Content-Type"], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + elif headers["Content-Type"] == "application/x-www-form-urlencoded": args["data"] = aiohttp.FormData(post_params) - elif headers['Content-Type'] == 'multipart/form-data': + elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by aiohttp - del headers['Content-Type'] + del headers["Content-Type"] data = aiohttp.FormData() for param in post_params: k, v = param if isinstance(v, tuple) and len(v) == 3: - data.add_field( - k, - value=v[1], - filename=v[0], - content_type=v[2] - ) + data.add_field(k, value=v[1], filename=v[0], content_type=v[2]) else: data.add_field(k, v) args["data"] = data @@ -208,8 +180,3 @@ async def request( r = await pool_manager.request(**args) return RESTResponse(r) - - - - - diff --git a/hatchet_sdk/clients/rest_client.py b/hatchet_sdk/clients/rest_client.py index f0fca4b7..d62ce221 100644 --- a/hatchet_sdk/clients/rest_client.py +++ b/hatchet_sdk/clients/rest_client.py @@ -4,6 +4,10 @@ from typing import Any from hatchet_sdk.clients.cloud_rest.api.managed_worker_api import ManagedWorkerApi +from hatchet_sdk.clients.cloud_rest.api_client import ApiClient as CloudApiClient +from hatchet_sdk.clients.cloud_rest.configuration import ( + Configuration as CloudConfiguration, +) from hatchet_sdk.clients.rest.api.event_api import EventApi from hatchet_sdk.clients.rest.api.log_api import LogApi from hatchet_sdk.clients.rest.api.step_run_api import StepRunApi @@ -51,10 +55,6 @@ ) from hatchet_sdk.clients.rest.models.workflow_version import WorkflowVersion -from hatchet_sdk.clients.cloud_rest.configuration import Configuration as CloudConfiguration -from hatchet_sdk.clients.cloud_rest.api_client import ApiClient as CloudApiClient - - class AsyncRestApi: def __init__(self, host: str, api_key: str, tenant_id: str): diff --git a/hatchet_sdk/contracts/dispatcher_pb2.py b/hatchet_sdk/contracts/dispatcher_pb2.py index 699cfe33..68d2b5ec 100644 --- a/hatchet_sdk/contracts/dispatcher_pb2.py +++ b/hatchet_sdk/contracts/dispatcher_pb2.py @@ -15,7 +15,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"V\n\x0cWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValue\"\x88\x02\n\x15WorkerRegisterRequest\x12\x12\n\nworkerName\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x14\n\x07maxRuns\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x16\n\twebhookId\x18\x06 \x01(\tH\x01\x88\x01\x01\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x42\n\n\x08_maxRunsB\x0c\n\n_webhookId\"P\n\x16WorkerRegisterResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\x12\x12\n\nworkerName\x18\x03 \x01(\t\"\xa3\x01\n\x19UpsertWorkerLabelsRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"@\n\x1aUpsertWorkerLabelsResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\x86\x04\n\x0e\x41ssignedAction\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\r\n\x05jobId\x18\x04 \x01(\t\x12\x0f\n\x07jobName\x18\x05 \x01(\t\x12\x10\n\x08jobRunId\x18\x06 \x01(\t\x12\x0e\n\x06stepId\x18\x07 \x01(\t\x12\x11\n\tstepRunId\x18\x08 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\t \x01(\t\x12\x1f\n\nactionType\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x15\n\ractionPayload\x18\x0b \x01(\t\x12\x10\n\x08stepName\x18\x0c \x01(\t\x12\x12\n\nretryCount\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_id\"\'\n\x13WorkerListenRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\",\n\x18WorkerUnsubscribeRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\"?\n\x19WorkerUnsubscribeResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xe1\x01\n\x13GroupKeyActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\teventType\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x14\n\x0c\x65ventPayload\x18\x07 \x01(\t\"\xec\x01\n\x0fStepActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\r\n\x05jobId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x0e\n\x06stepId\x18\x04 \x01(\t\x12\x11\n\tstepRunId\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x06 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\teventType\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x14\n\x0c\x65ventPayload\x18\t \x01(\t\"9\n\x13\x41\x63tionEventResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xc0\x01\n SubscribeToWorkflowEventsRequest\x12\x1a\n\rworkflowRunId\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x61\x64\x64itionalMetaKey\x18\x02 \x01(\tH\x01\x88\x01\x01\x12 \n\x13\x61\x64\x64itionalMetaValue\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x10\n\x0e_workflowRunIdB\x14\n\x12_additionalMetaKeyB\x16\n\x14_additionalMetaValue\"7\n\x1eSubscribeToWorkflowRunsRequest\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\"\xb2\x02\n\rWorkflowEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12#\n\x0cresourceType\x18\x02 \x01(\x0e\x32\r.ResourceType\x12%\n\teventType\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x12\n\nresourceId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65ventPayload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x18\n\x0bstepRetries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nretryCount\x18\t \x01(\x05H\x01\x88\x01\x01\x42\x0e\n\x0c_stepRetriesB\r\n\x0b_retryCount\"\xa8\x01\n\x10WorkflowRunEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12(\n\teventType\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x8a\x01\n\rStepRunResult\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x16\n\x0estepReadableId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"W\n\rOverridesData\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61llerFilename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"U\n\x10HeartbeatRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12/\n\x0bheartbeatAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"F\n\x15RefreshTimeoutRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x1a\n\x12incrementTimeoutBy\x18\x02 \x01(\t\"G\n\x16RefreshTimeoutResponse\x12-\n\ttimeoutAt\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\'\n\x12ReleaseSlotRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse*N\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\x8a\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xf8\x06\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x64ispatcher.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"V\n\x0cWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValue\"\x88\x02\n\x15WorkerRegisterRequest\x12\x12\n\nworkerName\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t\x12\x10\n\x08services\x18\x03 \x03(\t\x12\x14\n\x07maxRuns\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x32\n\x06labels\x18\x05 \x03(\x0b\x32\".WorkerRegisterRequest.LabelsEntry\x12\x16\n\twebhookId\x18\x06 \x01(\tH\x01\x88\x01\x01\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\x42\n\n\x08_maxRunsB\x0c\n\n_webhookId\"P\n\x16WorkerRegisterResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\x12\x12\n\nworkerName\x18\x03 \x01(\t\"\xa3\x01\n\x19UpsertWorkerLabelsRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x36\n\x06labels\x18\x02 \x03(\x0b\x32&.UpsertWorkerLabelsRequest.LabelsEntry\x1a<\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.WorkerLabels:\x02\x38\x01\"@\n\x1aUpsertWorkerLabelsResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\x86\x04\n\x0e\x41ssignedAction\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\r\n\x05jobId\x18\x04 \x01(\t\x12\x0f\n\x07jobName\x18\x05 \x01(\t\x12\x10\n\x08jobRunId\x18\x06 \x01(\t\x12\x0e\n\x06stepId\x18\x07 \x01(\t\x12\x11\n\tstepRunId\x18\x08 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\t \x01(\t\x12\x1f\n\nactionType\x18\n \x01(\x0e\x32\x0b.ActionType\x12\x15\n\ractionPayload\x18\x0b \x01(\t\x12\x10\n\x08stepName\x18\x0c \x01(\t\x12\x12\n\nretryCount\x18\r \x01(\x05\x12 \n\x13\x61\x64\x64itional_metadata\x18\x0e \x01(\tH\x00\x88\x01\x01\x12!\n\x14\x63hild_workflow_index\x18\x0f \x01(\x05H\x01\x88\x01\x01\x12\x1f\n\x12\x63hild_workflow_key\x18\x10 \x01(\tH\x02\x88\x01\x01\x12#\n\x16parent_workflow_run_id\x18\x11 \x01(\tH\x03\x88\x01\x01\x42\x16\n\x14_additional_metadataB\x17\n\x15_child_workflow_indexB\x15\n\x13_child_workflow_keyB\x19\n\x17_parent_workflow_run_id\"\'\n\x13WorkerListenRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\",\n\x18WorkerUnsubscribeRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\"?\n\x19WorkerUnsubscribeResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xe1\x01\n\x13GroupKeyActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\x15\n\rworkflowRunId\x18\x02 \x01(\t\x12\x18\n\x10getGroupKeyRunId\x18\x03 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\teventType\x18\x06 \x01(\x0e\x32\x18.GroupKeyActionEventType\x12\x14\n\x0c\x65ventPayload\x18\x07 \x01(\t\"\xec\x01\n\x0fStepActionEvent\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12\r\n\x05jobId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x0e\n\x06stepId\x18\x04 \x01(\t\x12\x11\n\tstepRunId\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tionId\x18\x06 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\teventType\x18\x08 \x01(\x0e\x32\x14.StepActionEventType\x12\x14\n\x0c\x65ventPayload\x18\t \x01(\t\"9\n\x13\x41\x63tionEventResponse\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x10\n\x08workerId\x18\x02 \x01(\t\"\xc0\x01\n SubscribeToWorkflowEventsRequest\x12\x1a\n\rworkflowRunId\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1e\n\x11\x61\x64\x64itionalMetaKey\x18\x02 \x01(\tH\x01\x88\x01\x01\x12 \n\x13\x61\x64\x64itionalMetaValue\x18\x03 \x01(\tH\x02\x88\x01\x01\x42\x10\n\x0e_workflowRunIdB\x14\n\x12_additionalMetaKeyB\x16\n\x14_additionalMetaValue\"7\n\x1eSubscribeToWorkflowRunsRequest\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\"\xb2\x02\n\rWorkflowEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12#\n\x0cresourceType\x18\x02 \x01(\x0e\x32\r.ResourceType\x12%\n\teventType\x18\x03 \x01(\x0e\x32\x12.ResourceEventType\x12\x12\n\nresourceId\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65ventPayload\x18\x06 \x01(\t\x12\x0e\n\x06hangup\x18\x07 \x01(\x08\x12\x18\n\x0bstepRetries\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nretryCount\x18\t \x01(\x05H\x01\x88\x01\x01\x42\x0e\n\x0c_stepRetriesB\r\n\x0b_retryCount\"\xa8\x01\n\x10WorkflowRunEvent\x12\x15\n\rworkflowRunId\x18\x01 \x01(\t\x12(\n\teventType\x18\x02 \x01(\x0e\x32\x15.WorkflowRunEventType\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x07results\x18\x04 \x03(\x0b\x32\x0e.StepRunResult\"\x8a\x01\n\rStepRunResult\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x16\n\x0estepReadableId\x18\x02 \x01(\t\x12\x10\n\x08jobRunId\x18\x03 \x01(\t\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06output\x18\x05 \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_errorB\t\n\x07_output\"W\n\rOverridesData\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x16\n\x0e\x63\x61llerFilename\x18\x04 \x01(\t\"\x17\n\x15OverridesDataResponse\"U\n\x10HeartbeatRequest\x12\x10\n\x08workerId\x18\x01 \x01(\t\x12/\n\x0bheartbeatAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x13\n\x11HeartbeatResponse\"F\n\x15RefreshTimeoutRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12\x1a\n\x12incrementTimeoutBy\x18\x02 \x01(\t\"G\n\x16RefreshTimeoutResponse\x12-\n\ttimeoutAt\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\'\n\x12ReleaseSlotRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\"\x15\n\x13ReleaseSlotResponse*N\n\nActionType\x12\x12\n\x0eSTART_STEP_RUN\x10\x00\x12\x13\n\x0f\x43\x41NCEL_STEP_RUN\x10\x01\x12\x17\n\x13START_GET_GROUP_KEY\x10\x02*\xa2\x01\n\x17GroupKeyActionEventType\x12 \n\x1cGROUP_KEY_EVENT_TYPE_UNKNOWN\x10\x00\x12 \n\x1cGROUP_KEY_EVENT_TYPE_STARTED\x10\x01\x12\"\n\x1eGROUP_KEY_EVENT_TYPE_COMPLETED\x10\x02\x12\x1f\n\x1bGROUP_KEY_EVENT_TYPE_FAILED\x10\x03*\xac\x01\n\x13StepActionEventType\x12\x1b\n\x17STEP_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1b\n\x17STEP_EVENT_TYPE_STARTED\x10\x01\x12\x1d\n\x19STEP_EVENT_TYPE_COMPLETED\x10\x02\x12\x1a\n\x16STEP_EVENT_TYPE_FAILED\x10\x03\x12 \n\x1cSTEP_EVENT_TYPE_ACKNOWLEDGED\x10\x04*e\n\x0cResourceType\x12\x19\n\x15RESOURCE_TYPE_UNKNOWN\x10\x00\x12\x1a\n\x16RESOURCE_TYPE_STEP_RUN\x10\x01\x12\x1e\n\x1aRESOURCE_TYPE_WORKFLOW_RUN\x10\x02*\xfe\x01\n\x11ResourceEventType\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_UNKNOWN\x10\x00\x12\x1f\n\x1bRESOURCE_EVENT_TYPE_STARTED\x10\x01\x12!\n\x1dRESOURCE_EVENT_TYPE_COMPLETED\x10\x02\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_FAILED\x10\x03\x12!\n\x1dRESOURCE_EVENT_TYPE_CANCELLED\x10\x04\x12!\n\x1dRESOURCE_EVENT_TYPE_TIMED_OUT\x10\x05\x12\x1e\n\x1aRESOURCE_EVENT_TYPE_STREAM\x10\x06*<\n\x14WorkflowRunEventType\x12$\n WORKFLOW_RUN_EVENT_TYPE_FINISHED\x10\x00\x32\xf8\x06\n\nDispatcher\x12=\n\x08Register\x12\x16.WorkerRegisterRequest\x1a\x17.WorkerRegisterResponse\"\x00\x12\x33\n\x06Listen\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x35\n\x08ListenV2\x12\x14.WorkerListenRequest\x1a\x0f.AssignedAction\"\x00\x30\x01\x12\x34\n\tHeartbeat\x12\x11.HeartbeatRequest\x1a\x12.HeartbeatResponse\"\x00\x12R\n\x19SubscribeToWorkflowEvents\x12!.SubscribeToWorkflowEventsRequest\x1a\x0e.WorkflowEvent\"\x00\x30\x01\x12S\n\x17SubscribeToWorkflowRuns\x12\x1f.SubscribeToWorkflowRunsRequest\x1a\x11.WorkflowRunEvent\"\x00(\x01\x30\x01\x12?\n\x13SendStepActionEvent\x12\x10.StepActionEvent\x1a\x14.ActionEventResponse\"\x00\x12G\n\x17SendGroupKeyActionEvent\x12\x14.GroupKeyActionEvent\x1a\x14.ActionEventResponse\"\x00\x12<\n\x10PutOverridesData\x12\x0e.OverridesData\x1a\x16.OverridesDataResponse\"\x00\x12\x46\n\x0bUnsubscribe\x12\x19.WorkerUnsubscribeRequest\x1a\x1a.WorkerUnsubscribeResponse\"\x00\x12\x43\n\x0eRefreshTimeout\x12\x16.RefreshTimeoutRequest\x1a\x17.RefreshTimeoutResponse\"\x00\x12:\n\x0bReleaseSlot\x12\x13.ReleaseSlotRequest\x1a\x14.ReleaseSlotResponse\"\x00\x12O\n\x12UpsertWorkerLabels\x12\x1a.UpsertWorkerLabelsRequest\x1a\x1b.UpsertWorkerLabelsResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -32,13 +32,13 @@ _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_start=3306 _globals['_GROUPKEYACTIONEVENTTYPE']._serialized_end=3468 _globals['_STEPACTIONEVENTTYPE']._serialized_start=3471 - _globals['_STEPACTIONEVENTTYPE']._serialized_end=3609 - _globals['_RESOURCETYPE']._serialized_start=3611 - _globals['_RESOURCETYPE']._serialized_end=3712 - _globals['_RESOURCEEVENTTYPE']._serialized_start=3715 - _globals['_RESOURCEEVENTTYPE']._serialized_end=3969 - _globals['_WORKFLOWRUNEVENTTYPE']._serialized_start=3971 - _globals['_WORKFLOWRUNEVENTTYPE']._serialized_end=4031 + _globals['_STEPACTIONEVENTTYPE']._serialized_end=3643 + _globals['_RESOURCETYPE']._serialized_start=3645 + _globals['_RESOURCETYPE']._serialized_end=3746 + _globals['_RESOURCEEVENTTYPE']._serialized_start=3749 + _globals['_RESOURCEEVENTTYPE']._serialized_end=4003 + _globals['_WORKFLOWRUNEVENTTYPE']._serialized_start=4005 + _globals['_WORKFLOWRUNEVENTTYPE']._serialized_end=4065 _globals['_WORKERLABELS']._serialized_start=53 _globals['_WORKERLABELS']._serialized_end=139 _globals['_WORKERREGISTERREQUEST']._serialized_start=142 @@ -93,6 +93,6 @@ _globals['_RELEASESLOTREQUEST']._serialized_end=3200 _globals['_RELEASESLOTRESPONSE']._serialized_start=3202 _globals['_RELEASESLOTRESPONSE']._serialized_end=3223 - _globals['_DISPATCHER']._serialized_start=4034 - _globals['_DISPATCHER']._serialized_end=4922 + _globals['_DISPATCHER']._serialized_start=4068 + _globals['_DISPATCHER']._serialized_end=4956 # @@protoc_insertion_point(module_scope) diff --git a/hatchet_sdk/contracts/dispatcher_pb2.pyi b/hatchet_sdk/contracts/dispatcher_pb2.pyi index 206dd4b5..96a996ee 100644 --- a/hatchet_sdk/contracts/dispatcher_pb2.pyi +++ b/hatchet_sdk/contracts/dispatcher_pb2.pyi @@ -26,6 +26,7 @@ class StepActionEventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): STEP_EVENT_TYPE_STARTED: _ClassVar[StepActionEventType] STEP_EVENT_TYPE_COMPLETED: _ClassVar[StepActionEventType] STEP_EVENT_TYPE_FAILED: _ClassVar[StepActionEventType] + STEP_EVENT_TYPE_ACKNOWLEDGED: _ClassVar[StepActionEventType] class ResourceType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -57,6 +58,7 @@ STEP_EVENT_TYPE_UNKNOWN: StepActionEventType STEP_EVENT_TYPE_STARTED: StepActionEventType STEP_EVENT_TYPE_COMPLETED: StepActionEventType STEP_EVENT_TYPE_FAILED: StepActionEventType +STEP_EVENT_TYPE_ACKNOWLEDGED: StepActionEventType RESOURCE_TYPE_UNKNOWN: ResourceType RESOURCE_TYPE_STEP_RUN: ResourceType RESOURCE_TYPE_WORKFLOW_RUN: ResourceType diff --git a/hatchet_sdk/contracts/events_pb2.py b/hatchet_sdk/contracts/events_pb2.py index e105621a..a0166ace 100644 --- a/hatchet_sdk/contracts/events_pb2.py +++ b/hatchet_sdk/contracts/events_pb2.py @@ -15,7 +15,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65vents.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb4\x01\n\x05\x45vent\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x0f\n\x07\x65ventId\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"\x92\x01\n\rPutLogRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x12\n\x05level\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08metadata\x18\x05 \x01(\tB\x08\n\x06_level\"\x10\n\x0ePutLogResponse\"|\n\x15PutStreamEventRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\x0c\x12\x10\n\x08metadata\x18\x05 \x01(\t\"\x18\n\x16PutStreamEventResponse\"\x9c\x01\n\x10PushEventRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"%\n\x12ReplayEventRequest\x12\x0f\n\x07\x65ventId\x18\x01 \x01(\t2\xda\x01\n\rEventsService\x12#\n\x04Push\x12\x11.PushEventRequest\x1a\x06.Event\"\x00\x12\x32\n\x11ReplaySingleEvent\x12\x13.ReplayEventRequest\x1a\x06.Event\"\x00\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse\"\x00\x12\x43\n\x0ePutStreamEvent\x12\x16.PutStreamEventRequest\x1a\x17.PutStreamEventResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x65vents.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb4\x01\n\x05\x45vent\x12\x10\n\x08tenantId\x18\x01 \x01(\t\x12\x0f\n\x07\x65ventId\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x12\x0f\n\x07payload\x18\x04 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x06 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\" \n\x06\x45vents\x12\x16\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x06.Event\"\x92\x01\n\rPutLogRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x12\n\x05level\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08metadata\x18\x05 \x01(\tB\x08\n\x06_level\"\x10\n\x0ePutLogResponse\"|\n\x15PutStreamEventRequest\x12\x11\n\tstepRunId\x18\x01 \x01(\t\x12-\n\tcreatedAt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x03 \x01(\x0c\x12\x10\n\x08metadata\x18\x05 \x01(\t\"\x18\n\x16PutStreamEventResponse\"9\n\x14\x42ulkPushEventRequest\x12!\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x11.PushEventRequest\"\x9c\x01\n\x10PushEventRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\t\x12\x32\n\x0e\x65ventTimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1f\n\x12\x61\x64\x64itionalMetadata\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x15\n\x13_additionalMetadata\"%\n\x12ReplayEventRequest\x12\x0f\n\x07\x65ventId\x18\x01 \x01(\t2\x88\x02\n\rEventsService\x12#\n\x04Push\x12\x11.PushEventRequest\x1a\x06.Event\"\x00\x12,\n\x08\x42ulkPush\x12\x15.BulkPushEventRequest\x1a\x07.Events\"\x00\x12\x32\n\x11ReplaySingleEvent\x12\x13.ReplayEventRequest\x1a\x06.Event\"\x00\x12+\n\x06PutLog\x12\x0e.PutLogRequest\x1a\x0f.PutLogResponse\"\x00\x12\x43\n\x0ePutStreamEvent\x12\x16.PutStreamEventRequest\x1a\x17.PutStreamEventResponse\"\x00\x42GZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contractsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -25,18 +25,22 @@ _globals['DESCRIPTOR']._serialized_options = b'ZEgithub.com/hatchet-dev/hatchet/internal/services/dispatcher/contracts' _globals['_EVENT']._serialized_start=50 _globals['_EVENT']._serialized_end=230 - _globals['_PUTLOGREQUEST']._serialized_start=233 - _globals['_PUTLOGREQUEST']._serialized_end=379 - _globals['_PUTLOGRESPONSE']._serialized_start=381 - _globals['_PUTLOGRESPONSE']._serialized_end=397 - _globals['_PUTSTREAMEVENTREQUEST']._serialized_start=399 - _globals['_PUTSTREAMEVENTREQUEST']._serialized_end=523 - _globals['_PUTSTREAMEVENTRESPONSE']._serialized_start=525 - _globals['_PUTSTREAMEVENTRESPONSE']._serialized_end=549 - _globals['_PUSHEVENTREQUEST']._serialized_start=552 - _globals['_PUSHEVENTREQUEST']._serialized_end=708 - _globals['_REPLAYEVENTREQUEST']._serialized_start=710 - _globals['_REPLAYEVENTREQUEST']._serialized_end=747 - _globals['_EVENTSSERVICE']._serialized_start=750 - _globals['_EVENTSSERVICE']._serialized_end=968 + _globals['_EVENTS']._serialized_start=232 + _globals['_EVENTS']._serialized_end=264 + _globals['_PUTLOGREQUEST']._serialized_start=267 + _globals['_PUTLOGREQUEST']._serialized_end=413 + _globals['_PUTLOGRESPONSE']._serialized_start=415 + _globals['_PUTLOGRESPONSE']._serialized_end=431 + _globals['_PUTSTREAMEVENTREQUEST']._serialized_start=433 + _globals['_PUTSTREAMEVENTREQUEST']._serialized_end=557 + _globals['_PUTSTREAMEVENTRESPONSE']._serialized_start=559 + _globals['_PUTSTREAMEVENTRESPONSE']._serialized_end=583 + _globals['_BULKPUSHEVENTREQUEST']._serialized_start=585 + _globals['_BULKPUSHEVENTREQUEST']._serialized_end=642 + _globals['_PUSHEVENTREQUEST']._serialized_start=645 + _globals['_PUSHEVENTREQUEST']._serialized_end=801 + _globals['_REPLAYEVENTREQUEST']._serialized_start=803 + _globals['_REPLAYEVENTREQUEST']._serialized_end=840 + _globals['_EVENTSSERVICE']._serialized_start=843 + _globals['_EVENTSSERVICE']._serialized_end=1107 # @@protoc_insertion_point(module_scope) diff --git a/hatchet_sdk/contracts/events_pb2.pyi b/hatchet_sdk/contracts/events_pb2.pyi index 40447467..e9132fb2 100644 --- a/hatchet_sdk/contracts/events_pb2.pyi +++ b/hatchet_sdk/contracts/events_pb2.pyi @@ -1,7 +1,8 @@ from google.protobuf import timestamp_pb2 as _timestamp_pb2 +from google.protobuf.internal import containers as _containers from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -21,6 +22,12 @@ class Event(_message.Message): additionalMetadata: str def __init__(self, tenantId: _Optional[str] = ..., eventId: _Optional[str] = ..., key: _Optional[str] = ..., payload: _Optional[str] = ..., eventTimestamp: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., additionalMetadata: _Optional[str] = ...) -> None: ... +class Events(_message.Message): + __slots__ = ("events",) + EVENTS_FIELD_NUMBER: _ClassVar[int] + events: _containers.RepeatedCompositeFieldContainer[Event] + def __init__(self, events: _Optional[_Iterable[_Union[Event, _Mapping]]] = ...) -> None: ... + class PutLogRequest(_message.Message): __slots__ = ("stepRunId", "createdAt", "message", "level", "metadata") STEPRUNID_FIELD_NUMBER: _ClassVar[int] @@ -55,6 +62,12 @@ class PutStreamEventResponse(_message.Message): __slots__ = () def __init__(self) -> None: ... +class BulkPushEventRequest(_message.Message): + __slots__ = ("events",) + EVENTS_FIELD_NUMBER: _ClassVar[int] + events: _containers.RepeatedCompositeFieldContainer[PushEventRequest] + def __init__(self, events: _Optional[_Iterable[_Union[PushEventRequest, _Mapping]]] = ...) -> None: ... + class PushEventRequest(_message.Message): __slots__ = ("key", "payload", "eventTimestamp", "additionalMetadata") KEY_FIELD_NUMBER: _ClassVar[int] diff --git a/hatchet_sdk/contracts/events_pb2_grpc.py b/hatchet_sdk/contracts/events_pb2_grpc.py index 66fae0dd..344d3798 100644 --- a/hatchet_sdk/contracts/events_pb2_grpc.py +++ b/hatchet_sdk/contracts/events_pb2_grpc.py @@ -19,6 +19,11 @@ def __init__(self, channel): request_serializer=events__pb2.PushEventRequest.SerializeToString, response_deserializer=events__pb2.Event.FromString, ) + self.BulkPush = channel.unary_unary( + '/EventsService/BulkPush', + request_serializer=events__pb2.BulkPushEventRequest.SerializeToString, + response_deserializer=events__pb2.Events.FromString, + ) self.ReplaySingleEvent = channel.unary_unary( '/EventsService/ReplaySingleEvent', request_serializer=events__pb2.ReplayEventRequest.SerializeToString, @@ -45,6 +50,12 @@ def Push(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def BulkPush(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def ReplaySingleEvent(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -71,6 +82,11 @@ def add_EventsServiceServicer_to_server(servicer, server): request_deserializer=events__pb2.PushEventRequest.FromString, response_serializer=events__pb2.Event.SerializeToString, ), + 'BulkPush': grpc.unary_unary_rpc_method_handler( + servicer.BulkPush, + request_deserializer=events__pb2.BulkPushEventRequest.FromString, + response_serializer=events__pb2.Events.SerializeToString, + ), 'ReplaySingleEvent': grpc.unary_unary_rpc_method_handler( servicer.ReplaySingleEvent, request_deserializer=events__pb2.ReplayEventRequest.FromString, @@ -113,6 +129,23 @@ def Push(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def BulkPush(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/EventsService/BulkPush', + events__pb2.BulkPushEventRequest.SerializeToString, + events__pb2.Events.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def ReplaySingleEvent(request, target, diff --git a/hatchet_sdk/contracts/workflows_pb2.py b/hatchet_sdk/contracts/workflows_pb2.py index bb9b72e7..113609bf 100644 --- a/hatchet_sdk/contracts/workflows_pb2.py +++ b/hatchet_sdk/contracts/workflows_pb2.py @@ -15,7 +15,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fworkflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"n\n\x17WorkflowConcurrencyOpts\x12\x0e\n\x06\x61\x63tion\x18\x01 \x01(\t\x12\x10\n\x08max_runs\x18\x02 \x01(\x05\x12\x31\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategy\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xe1\x01\n\x13\x44\x65siredWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\x08required\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12/\n\ncomparator\x18\x04 \x01(\x0e\x32\x16.WorkerLabelComparatorH\x03\x88\x01\x01\x12\x13\n\x06weight\x18\x05 \x01(\x05H\x04\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValueB\x0b\n\t_requiredB\r\n\x0b_comparatorB\t\n\x07_weight\"\xcb\x02\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x1aI\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.DesiredWorkerLabels:\x02\x38\x01\"1\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05units\x18\x02 \x01(\x05\"\x16\n\x14ListWorkflowsRequest\"\x93\x02\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_key\"\xb2\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x05\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"\xf7\x02\n\x16TriggerWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\t\x12\x16\n\tparent_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x05 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x06 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1e\n\x11\x64\x65sired_worker_id\x18\x08 \x01(\tH\x05\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x06\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x14\n\x12_desired_worker_idB\x0b\n\t_priority\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*l\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03*\x85\x01\n\x15WorkerLabelComparator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x05*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\x8a\x02\n\x0fWorkflowService\x12\x34\n\x0bPutWorkflow\x12\x13.PutWorkflowRequest\x1a\x10.WorkflowVersion\x12>\n\x10ScheduleWorkflow\x12\x18.ScheduleWorkflowRequest\x1a\x10.WorkflowVersion\x12\x44\n\x0fTriggerWorkflow\x12\x17.TriggerWorkflowRequest\x1a\x18.TriggerWorkflowResponse\x12;\n\x0cPutRateLimit\x12\x14.PutRateLimitRequest\x1a\x15.PutRateLimitResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/admin/contractsb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fworkflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"\xd0\x01\n\x17WorkflowConcurrencyOpts\x12\x13\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x36\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategyH\x02\x88\x01\x01\x12\x17\n\nexpression\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_actionB\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\r\n\x0b_expression\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xe1\x01\n\x13\x44\x65siredWorkerLabels\x12\x15\n\x08strValue\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08intValue\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x15\n\x08required\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12/\n\ncomparator\x18\x04 \x01(\x0e\x32\x16.WorkerLabelComparatorH\x03\x88\x01\x01\x12\x13\n\x06weight\x18\x05 \x01(\x05H\x04\x88\x01\x01\x42\x0b\n\t_strValueB\x0b\n\t_intValueB\x0b\n\t_requiredB\r\n\x0b_comparatorB\t\n\x07_weight\"\xcb\x02\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x1aI\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.DesiredWorkerLabels:\x02\x38\x01\"\xfa\x01\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\x05units\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08key_expr\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nunits_expr\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11limit_values_expr\x18\x05 \x01(\tH\x03\x88\x01\x01\x12)\n\x08\x64uration\x18\x06 \x01(\x0e\x32\x12.RateLimitDurationH\x04\x88\x01\x01\x42\x08\n\x06_unitsB\x0b\n\t_key_exprB\r\n\x0b_units_exprB\x14\n\x12_limit_values_exprB\x0b\n\t_duration\"\x16\n\x14ListWorkflowsRequest\"\x93\x02\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_key\"\xb2\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x05\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"H\n\x1a\x42ulkTriggerWorkflowRequest\x12*\n\tworkflows\x18\x01 \x03(\x0b\x32\x17.TriggerWorkflowRequest\"7\n\x1b\x42ulkTriggerWorkflowResponse\x12\x18\n\x10workflow_run_ids\x18\x01 \x03(\t\"\xf7\x02\n\x16TriggerWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05input\x18\x02 \x01(\t\x12\x16\n\tparent_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1f\n\x12parent_step_run_id\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x05 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x06 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x07 \x01(\tH\x04\x88\x01\x01\x12\x1e\n\x11\x64\x65sired_worker_id\x18\x08 \x01(\tH\x05\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x06\x88\x01\x01\x42\x0c\n\n_parent_idB\x15\n\x13_parent_step_run_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x14\n\x12_desired_worker_idB\x0b\n\t_priority\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*l\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03*\x85\x01\n\x15WorkerLabelComparator\x12\t\n\x05\x45QUAL\x10\x00\x12\r\n\tNOT_EQUAL\x10\x01\x12\x10\n\x0cGREATER_THAN\x10\x02\x12\x19\n\x15GREATER_THAN_OR_EQUAL\x10\x03\x12\r\n\tLESS_THAN\x10\x04\x12\x16\n\x12LESS_THAN_OR_EQUAL\x10\x05*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\xdc\x02\n\x0fWorkflowService\x12\x34\n\x0bPutWorkflow\x12\x13.PutWorkflowRequest\x1a\x10.WorkflowVersion\x12>\n\x10ScheduleWorkflow\x12\x18.ScheduleWorkflowRequest\x1a\x10.WorkflowVersion\x12\x44\n\x0fTriggerWorkflow\x12\x17.TriggerWorkflowRequest\x1a\x18.TriggerWorkflowResponse\x12P\n\x13\x42ulkTriggerWorkflow\x12\x1b.BulkTriggerWorkflowRequest\x1a\x1c.BulkTriggerWorkflowResponse\x12;\n\x0cPutRateLimit\x12\x14.PutRateLimitRequest\x1a\x15.PutRateLimitResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/admin/contractsb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -25,50 +25,54 @@ _globals['DESCRIPTOR']._serialized_options = b'Z@github.com/hatchet-dev/hatchet/internal/services/admin/contracts' _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._options = None _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_options = b'8\001' - _globals['_STICKYSTRATEGY']._serialized_start=2675 - _globals['_STICKYSTRATEGY']._serialized_end=2711 - _globals['_WORKFLOWKIND']._serialized_start=2713 - _globals['_WORKFLOWKIND']._serialized_end=2763 - _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_start=2765 - _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_end=2873 - _globals['_WORKERLABELCOMPARATOR']._serialized_start=2876 - _globals['_WORKERLABELCOMPARATOR']._serialized_end=3009 - _globals['_RATELIMITDURATION']._serialized_start=3011 - _globals['_RATELIMITDURATION']._serialized_end=3104 + _globals['_STICKYSTRATEGY']._serialized_start=3107 + _globals['_STICKYSTRATEGY']._serialized_end=3143 + _globals['_WORKFLOWKIND']._serialized_start=3145 + _globals['_WORKFLOWKIND']._serialized_end=3195 + _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_start=3197 + _globals['_CONCURRENCYLIMITSTRATEGY']._serialized_end=3305 + _globals['_WORKERLABELCOMPARATOR']._serialized_start=3308 + _globals['_WORKERLABELCOMPARATOR']._serialized_end=3441 + _globals['_RATELIMITDURATION']._serialized_start=3443 + _globals['_RATELIMITDURATION']._serialized_end=3536 _globals['_PUTWORKFLOWREQUEST']._serialized_start=52 _globals['_PUTWORKFLOWREQUEST']._serialized_end=114 _globals['_CREATEWORKFLOWVERSIONOPTS']._serialized_start=117 _globals['_CREATEWORKFLOWVERSIONOPTS']._serialized_end=692 - _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_start=694 - _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_end=804 - _globals['_CREATEWORKFLOWJOBOPTS']._serialized_start=806 - _globals['_CREATEWORKFLOWJOBOPTS']._serialized_end=910 - _globals['_DESIREDWORKERLABELS']._serialized_start=913 - _globals['_DESIREDWORKERLABELS']._serialized_end=1138 - _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_start=1141 - _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_end=1472 - _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_start=1399 - _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_end=1472 - _globals['_CREATESTEPRATELIMIT']._serialized_start=1474 - _globals['_CREATESTEPRATELIMIT']._serialized_end=1523 - _globals['_LISTWORKFLOWSREQUEST']._serialized_start=1525 - _globals['_LISTWORKFLOWSREQUEST']._serialized_end=1547 - _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_start=1550 - _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_end=1825 - _globals['_WORKFLOWVERSION']._serialized_start=1828 - _globals['_WORKFLOWVERSION']._serialized_end=2006 - _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_start=2008 - _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_end=2071 - _globals['_WORKFLOWTRIGGERCRONREF']._serialized_start=2073 - _globals['_WORKFLOWTRIGGERCRONREF']._serialized_end=2130 - _globals['_TRIGGERWORKFLOWREQUEST']._serialized_start=2133 - _globals['_TRIGGERWORKFLOWREQUEST']._serialized_end=2508 - _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_start=2510 - _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_end=2560 - _globals['_PUTRATELIMITREQUEST']._serialized_start=2562 - _globals['_PUTRATELIMITREQUEST']._serialized_end=2649 - _globals['_PUTRATELIMITRESPONSE']._serialized_start=2651 - _globals['_PUTRATELIMITRESPONSE']._serialized_end=2673 - _globals['_WORKFLOWSERVICE']._serialized_start=3107 - _globals['_WORKFLOWSERVICE']._serialized_end=3373 + _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_start=695 + _globals['_WORKFLOWCONCURRENCYOPTS']._serialized_end=903 + _globals['_CREATEWORKFLOWJOBOPTS']._serialized_start=905 + _globals['_CREATEWORKFLOWJOBOPTS']._serialized_end=1009 + _globals['_DESIREDWORKERLABELS']._serialized_start=1012 + _globals['_DESIREDWORKERLABELS']._serialized_end=1237 + _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_start=1240 + _globals['_CREATEWORKFLOWSTEPOPTS']._serialized_end=1571 + _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_start=1498 + _globals['_CREATEWORKFLOWSTEPOPTS_WORKERLABELSENTRY']._serialized_end=1571 + _globals['_CREATESTEPRATELIMIT']._serialized_start=1574 + _globals['_CREATESTEPRATELIMIT']._serialized_end=1824 + _globals['_LISTWORKFLOWSREQUEST']._serialized_start=1826 + _globals['_LISTWORKFLOWSREQUEST']._serialized_end=1848 + _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_start=1851 + _globals['_SCHEDULEWORKFLOWREQUEST']._serialized_end=2126 + _globals['_WORKFLOWVERSION']._serialized_start=2129 + _globals['_WORKFLOWVERSION']._serialized_end=2307 + _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_start=2309 + _globals['_WORKFLOWTRIGGEREVENTREF']._serialized_end=2372 + _globals['_WORKFLOWTRIGGERCRONREF']._serialized_start=2374 + _globals['_WORKFLOWTRIGGERCRONREF']._serialized_end=2431 + _globals['_BULKTRIGGERWORKFLOWREQUEST']._serialized_start=2433 + _globals['_BULKTRIGGERWORKFLOWREQUEST']._serialized_end=2505 + _globals['_BULKTRIGGERWORKFLOWRESPONSE']._serialized_start=2507 + _globals['_BULKTRIGGERWORKFLOWRESPONSE']._serialized_end=2562 + _globals['_TRIGGERWORKFLOWREQUEST']._serialized_start=2565 + _globals['_TRIGGERWORKFLOWREQUEST']._serialized_end=2940 + _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_start=2942 + _globals['_TRIGGERWORKFLOWRESPONSE']._serialized_end=2992 + _globals['_PUTRATELIMITREQUEST']._serialized_start=2994 + _globals['_PUTRATELIMITREQUEST']._serialized_end=3081 + _globals['_PUTRATELIMITRESPONSE']._serialized_start=3083 + _globals['_PUTRATELIMITRESPONSE']._serialized_end=3105 + _globals['_WORKFLOWSERVICE']._serialized_start=3539 + _globals['_WORKFLOWSERVICE']._serialized_end=3887 # @@protoc_insertion_point(module_scope) diff --git a/hatchet_sdk/contracts/workflows_pb2.pyi b/hatchet_sdk/contracts/workflows_pb2.pyi index b58fa382..219c12bf 100644 --- a/hatchet_sdk/contracts/workflows_pb2.pyi +++ b/hatchet_sdk/contracts/workflows_pb2.pyi @@ -105,14 +105,16 @@ class CreateWorkflowVersionOpts(_message.Message): def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., version: _Optional[str] = ..., event_triggers: _Optional[_Iterable[str]] = ..., cron_triggers: _Optional[_Iterable[str]] = ..., scheduled_triggers: _Optional[_Iterable[_Union[_timestamp_pb2.Timestamp, _Mapping]]] = ..., jobs: _Optional[_Iterable[_Union[CreateWorkflowJobOpts, _Mapping]]] = ..., concurrency: _Optional[_Union[WorkflowConcurrencyOpts, _Mapping]] = ..., schedule_timeout: _Optional[str] = ..., cron_input: _Optional[str] = ..., on_failure_job: _Optional[_Union[CreateWorkflowJobOpts, _Mapping]] = ..., sticky: _Optional[_Union[StickyStrategy, str]] = ..., kind: _Optional[_Union[WorkflowKind, str]] = ..., default_priority: _Optional[int] = ...) -> None: ... class WorkflowConcurrencyOpts(_message.Message): - __slots__ = ("action", "max_runs", "limit_strategy") + __slots__ = ("action", "max_runs", "limit_strategy", "expression") ACTION_FIELD_NUMBER: _ClassVar[int] MAX_RUNS_FIELD_NUMBER: _ClassVar[int] LIMIT_STRATEGY_FIELD_NUMBER: _ClassVar[int] + EXPRESSION_FIELD_NUMBER: _ClassVar[int] action: str max_runs: int limit_strategy: ConcurrencyLimitStrategy - def __init__(self, action: _Optional[str] = ..., max_runs: _Optional[int] = ..., limit_strategy: _Optional[_Union[ConcurrencyLimitStrategy, str]] = ...) -> None: ... + expression: str + def __init__(self, action: _Optional[str] = ..., max_runs: _Optional[int] = ..., limit_strategy: _Optional[_Union[ConcurrencyLimitStrategy, str]] = ..., expression: _Optional[str] = ...) -> None: ... class CreateWorkflowJobOpts(_message.Message): __slots__ = ("name", "description", "steps") @@ -168,12 +170,20 @@ class CreateWorkflowStepOpts(_message.Message): def __init__(self, readable_id: _Optional[str] = ..., action: _Optional[str] = ..., timeout: _Optional[str] = ..., inputs: _Optional[str] = ..., parents: _Optional[_Iterable[str]] = ..., user_data: _Optional[str] = ..., retries: _Optional[int] = ..., rate_limits: _Optional[_Iterable[_Union[CreateStepRateLimit, _Mapping]]] = ..., worker_labels: _Optional[_Mapping[str, DesiredWorkerLabels]] = ...) -> None: ... class CreateStepRateLimit(_message.Message): - __slots__ = ("key", "units") + __slots__ = ("key", "units", "key_expr", "units_expr", "limit_values_expr", "duration") KEY_FIELD_NUMBER: _ClassVar[int] UNITS_FIELD_NUMBER: _ClassVar[int] + KEY_EXPR_FIELD_NUMBER: _ClassVar[int] + UNITS_EXPR_FIELD_NUMBER: _ClassVar[int] + LIMIT_VALUES_EXPR_FIELD_NUMBER: _ClassVar[int] + DURATION_FIELD_NUMBER: _ClassVar[int] key: str units: int - def __init__(self, key: _Optional[str] = ..., units: _Optional[int] = ...) -> None: ... + key_expr: str + units_expr: str + limit_values_expr: str + duration: RateLimitDuration + def __init__(self, key: _Optional[str] = ..., units: _Optional[int] = ..., key_expr: _Optional[str] = ..., units_expr: _Optional[str] = ..., limit_values_expr: _Optional[str] = ..., duration: _Optional[_Union[RateLimitDuration, str]] = ...) -> None: ... class ListWorkflowsRequest(_message.Message): __slots__ = () @@ -229,6 +239,18 @@ class WorkflowTriggerCronRef(_message.Message): cron: str def __init__(self, parent_id: _Optional[str] = ..., cron: _Optional[str] = ...) -> None: ... +class BulkTriggerWorkflowRequest(_message.Message): + __slots__ = ("workflows",) + WORKFLOWS_FIELD_NUMBER: _ClassVar[int] + workflows: _containers.RepeatedCompositeFieldContainer[TriggerWorkflowRequest] + def __init__(self, workflows: _Optional[_Iterable[_Union[TriggerWorkflowRequest, _Mapping]]] = ...) -> None: ... + +class BulkTriggerWorkflowResponse(_message.Message): + __slots__ = ("workflow_run_ids",) + WORKFLOW_RUN_IDS_FIELD_NUMBER: _ClassVar[int] + workflow_run_ids: _containers.RepeatedScalarFieldContainer[str] + def __init__(self, workflow_run_ids: _Optional[_Iterable[str]] = ...) -> None: ... + class TriggerWorkflowRequest(_message.Message): __slots__ = ("name", "input", "parent_id", "parent_step_run_id", "child_index", "child_key", "additional_metadata", "desired_worker_id", "priority") NAME_FIELD_NUMBER: _ClassVar[int] diff --git a/hatchet_sdk/contracts/workflows_pb2_grpc.py b/hatchet_sdk/contracts/workflows_pb2_grpc.py index 3fbf53b3..7f0b419a 100644 --- a/hatchet_sdk/contracts/workflows_pb2_grpc.py +++ b/hatchet_sdk/contracts/workflows_pb2_grpc.py @@ -30,6 +30,11 @@ def __init__(self, channel): request_serializer=workflows__pb2.TriggerWorkflowRequest.SerializeToString, response_deserializer=workflows__pb2.TriggerWorkflowResponse.FromString, ) + self.BulkTriggerWorkflow = channel.unary_unary( + '/WorkflowService/BulkTriggerWorkflow', + request_serializer=workflows__pb2.BulkTriggerWorkflowRequest.SerializeToString, + response_deserializer=workflows__pb2.BulkTriggerWorkflowResponse.FromString, + ) self.PutRateLimit = channel.unary_unary( '/WorkflowService/PutRateLimit', request_serializer=workflows__pb2.PutRateLimitRequest.SerializeToString, @@ -59,6 +64,12 @@ def TriggerWorkflow(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def BulkTriggerWorkflow(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def PutRateLimit(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -83,6 +94,11 @@ def add_WorkflowServiceServicer_to_server(servicer, server): request_deserializer=workflows__pb2.TriggerWorkflowRequest.FromString, response_serializer=workflows__pb2.TriggerWorkflowResponse.SerializeToString, ), + 'BulkTriggerWorkflow': grpc.unary_unary_rpc_method_handler( + servicer.BulkTriggerWorkflow, + request_deserializer=workflows__pb2.BulkTriggerWorkflowRequest.FromString, + response_serializer=workflows__pb2.BulkTriggerWorkflowResponse.SerializeToString, + ), 'PutRateLimit': grpc.unary_unary_rpc_method_handler( servicer.PutRateLimit, request_deserializer=workflows__pb2.PutRateLimitRequest.FromString, @@ -150,6 +166,23 @@ def TriggerWorkflow(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def BulkTriggerWorkflow(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/WorkflowService/BulkTriggerWorkflow', + workflows__pb2.BulkTriggerWorkflowRequest.SerializeToString, + workflows__pb2.BulkTriggerWorkflowResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def PutRateLimit(request, target, diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index 2d84e5d6..c97eec74 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -9,9 +9,15 @@ from typing import Any, Callable, Dict, Optional from hatchet_sdk.client import Client, new_client_raw -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( + InfraAsCodeRequest, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) from hatchet_sdk.context import Context from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts from hatchet_sdk.loader import ClientConfig @@ -156,29 +162,31 @@ async def async_start( # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit if not os.environ.get("HATCHET_CLOUD_REGISTER_ID"): print("REGISTERING WORKER", os.environ.get("HATCHET_CLOUD_REGISTER_ID")) - + try: print("1") mw = CreateManagedWorkerRuntimeConfigRequest( - actions = self.action_registry.keys(), - num_replicas = 1, - cpu_kind = "shared", - cpus = 1, - memory_mb = 1024, - region = ManagedWorkerRegion.EWR + actions=self.action_registry.keys(), + num_replicas=1, + cpu_kind="shared", + cpus=1, + memory_mb=1024, + region=ManagedWorkerRegion.EWR, ) print("2") - req = InfraAsCodeRequest( - runtime_configs = [mw] - ) + req = InfraAsCodeRequest(runtime_configs=[mw]) print("REQ", req.to_dict()) - res = await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=os.environ.get("HATCHET_CLOUD_REGISTER_ID"), - infra_as_code_request2=req, - _request_timeout=10, + res = ( + await self.client.rest.aio.managed_worker_api.infra_as_code_create( + infra_as_code_request=os.environ.get( + "HATCHET_CLOUD_REGISTER_ID" + ), + infra_as_code_request2=req, + _request_timeout=10, + ) ) print("RESPONSE", res) From 4f80ef3a5ab5f3db669abed69eb60a9f045fe92f Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Fri, 25 Oct 2024 14:42:54 -0400 Subject: [PATCH 07/33] wip: stub compute model --- examples/simple/worker.py | 71 ++++++++++++++++++++- hatchet_sdk/compute/__init__.py | 0 hatchet_sdk/compute/configs.py | 20 ++++++ hatchet_sdk/compute/managed_compute.py | 85 ++++++++++++++++++++++++++ hatchet_sdk/hatchet.py | 35 +++++++++++ hatchet_sdk/worker/worker.py | 46 +++----------- 6 files changed, 217 insertions(+), 40 deletions(-) create mode 100644 hatchet_sdk/compute/__init__.py create mode 100644 hatchet_sdk/compute/configs.py create mode 100644 hatchet_sdk/compute/managed_compute.py diff --git a/examples/simple/worker.py b/examples/simple/worker.py index 1eca4c79..edfb4d5b 100644 --- a/examples/simple/worker.py +++ b/examples/simple/worker.py @@ -3,15 +3,45 @@ from dotenv import load_dotenv from hatchet_sdk import Context, Hatchet +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.compute.configs import Compute load_dotenv() -hatchet = Hatchet(debug=True) +hatchet = Hatchet() + +# Default compute + +default_compute = Compute( + cpu_kind="shared", + cpus=1, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) + +blocked_compute = Compute( + pool="blocked-pool", + cpu_kind="shared", + cpus=1, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) + +gpu_compute = Compute( + cpu_kind="gpu", + cpus=2, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) @hatchet.workflow(on_events=["user:create"]) class MyWorkflow: - @hatchet.step(timeout="11s", retries=3) + @hatchet.step( + timeout="11s", + retries=3, + compute=default_compute + ) def step1(self, context: Context): print("executed step1") time.sleep(10) @@ -20,6 +50,43 @@ def step1(self, context: Context): "step1": "step1", } + @hatchet.step( + timeout="11s", + retries=3, + compute=gpu_compute + ) + def step2(self, context: Context): + print("executed step2") + time.sleep(10) + # raise Exception("test") + return { + "step2": "step2", + } + + @hatchet.step( + timeout="11s", + retries=3, + compute=blocked_compute + ) + def step3(self, context: Context): + print("executed step3") + + return { + "step3": "step3", + } + + + @hatchet.step( + timeout="11s", + retries=3, + compute=default_compute + ) + def step4(self, context: Context): + print("executed step4") + time.sleep(10) + return { + "step4": "step4", + } def main(): workflow = MyWorkflow() diff --git a/hatchet_sdk/compute/__init__.py b/hatchet_sdk/compute/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/hatchet_sdk/compute/configs.py b/hatchet_sdk/compute/configs.py new file mode 100644 index 00000000..cd9c6815 --- /dev/null +++ b/hatchet_sdk/compute/configs.py @@ -0,0 +1,20 @@ +import hashlib +from typing import Annotated, Optional + +from pydantic import BaseModel, StrictStr, Field +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion + +class Compute(BaseModel): + pool: Optional[str] = Field(default="default", description="The name of the compute pool to use",) + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(default=1, alias="num_replicas") + region: Optional[ManagedWorkerRegion] = Field(default=None, description="The region to deploy the worker to") + cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpu_kind") + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memory_mb") + + def __json__(self): + return self.model_dump_json() + + def hash(self): + return hashlib.sha256(self.__json__().encode()).hexdigest() diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py new file mode 100644 index 00000000..73434ee0 --- /dev/null +++ b/hatchet_sdk/compute/managed_compute.py @@ -0,0 +1,85 @@ +import os +import sys +from typing import Any, Callable, Dict, List + +from hatchet_sdk.client import Client +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.compute.configs import Compute +from hatchet_sdk.logger import logger + +class ManagedCompute: + def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): + self.actions = actions + self.client = client + self.action_map = self.get_action_map(self.actions) + + self.cloud_register_enabled = os.environ.get("HATCHET_CLOUD_REGISTER_ID") + + if self.cloud_register_enabled is None: + logger.warning("🚫 Local mode detected, skipping cloud registration and running all actions locally.") + + logger.warning("Managed Cloud Compute Plan:") + for _, compute in self.action_map.items(): + logger.warning(f" ----------------------------") + logger.warning(f" Actions: {', '.join(compute.actions)}") + logger.warning(f" Num Replicas: {compute.num_replicas}") + logger.warning(f" CPU Kind: {compute.cpu_kind}") + logger.warning(f" CPUs: {compute.cpus}") + logger.warning(f" Memory MB: {compute.memory_mb}") + logger.warning(f" Region: {compute.region}") + + logger.warning("🚫 Local mode detected, skipping cloud registration and running all actions locally.") + + + def get_action_map(self, actions: Dict[str, Callable[..., Any]]) -> Dict[str, CreateManagedWorkerRuntimeConfigRequest]: + ''' + Builds a map of compute hashes to compute configs and lists of actions that correspond to each compute hash. + ''' + map: Dict[str, CreateManagedWorkerRuntimeConfigRequest] = {} + + for action, func in actions.items(): + try: + compute = func._step_compute + key = compute.hash() + if key not in map: + map[key] = CreateManagedWorkerRuntimeConfigRequest( + actions=[], + num_replicas=1, + cpu_kind = compute.cpu_kind, + cpus = compute.cpus, + memory_mb = compute.memory_mb, + region = compute.region + ) + map[key].actions.append(action) + except Exception as e: + logger.error(f"Error getting compute for action {action}: {e}") + return map + + async def cloud_register(self): + # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit + if self.cloud_register_enabled is not None: + logger.info(f"Registering cloud compute plan with ID: {self.cloud_register_enabled}") + + try: + configs = list(self.action_map.values()) + + if len(configs) == 0: + logger.warning("No actions to register, skipping cloud registration.") + return + + req = InfraAsCodeRequest( + runtime_configs = configs + ) + + res = await self.client.rest.aio.managed_worker_api.infra_as_code_create( + infra_as_code_request=self.cloud_register_enabled, + infra_as_code_request2=req, + _request_timeout=10, + ) + + sys.exit(0) + except Exception as e: + print("ERROR", e) + sys.exit(1) \ No newline at end of file diff --git a/hatchet_sdk/hatchet.py b/hatchet_sdk/hatchet.py index 54ffbfbe..37baabdc 100644 --- a/hatchet_sdk/hatchet.py +++ b/hatchet_sdk/hatchet.py @@ -5,6 +5,7 @@ from typing_extensions import deprecated from hatchet_sdk.clients.rest_client import RestApi +from hatchet_sdk.compute.configs import Compute from hatchet_sdk.contracts.workflows_pb2 import ( ConcurrencyLimitStrategy, CreateStepRateLimit, @@ -32,6 +33,23 @@ def workflow( default_priority: int | None = None, concurrency: ConcurrencyExpression | None = None, ): + """ + Decorator to mark a class as a workflow. + + Args: + name (str, optional): The name of the workflow. Defaults to an empty string. + on_events (list, optional): A list of events that trigger the workflow. Defaults to None. + on_crons (list, optional): A list of cron expressions that trigger the workflow. Defaults to None. + version (str, optional): The version of the workflow. Defaults to an empty string. + timeout (str, optional): The timeout for the workflow. Defaults to "60m". + schedule_timeout (str, optional): The schedule timeout for the workflow. Defaults to "5m". + sticky (StickyStrategy, optional): The sticky strategy for the workflow. Defaults to None. + default_priority (int, optional): The default priority for the workflow. Defaults to None. + concurrency (ConcurrencyExpression, optional): The concurrency expression for the workflow. Defaults to None. + + Returns: + function: The decorated class with workflow metadata. + """ on_events = on_events or [] on_crons = on_crons or [] @@ -59,7 +77,23 @@ def step( retries: int = 0, rate_limits: List[RateLimit] | None = None, desired_worker_labels: dict[str:DesiredWorkerLabel] = {}, + compute: Compute | None = None, ): + """ + Decorator to mark a function as a step in a workflow. + + Args: + name (str, optional): The name of the step. Defaults to the function name. + timeout (str, optional): The timeout for the step. Defaults to an empty string. + parents (List[str], optional): A list of parent step names. Defaults to an empty list. + retries (int, optional): The number of retries for the step. Defaults to 0. + rate_limits (List[RateLimit], optional): A list of rate limits for the step. Defaults to None. + desired_worker_labels (dict[str:DesiredWorkerLabel], optional): A dictionary of desired worker labels. Defaults to an empty dictionary. + compute (Compute, optional): The compute configuration for the step. Hatchet Cloud only. Defaults to None. + + Returns: + function: The decorated function with step metadata. + """ parents = parents or [] def inner(func): @@ -75,6 +109,7 @@ def inner(func): func._step_timeout = timeout func._step_retries = retries func._step_rate_limits = limits + func._step_compute = compute func._step_desired_worker_labels = {} diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index c97eec74..bdca13fc 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -24,6 +24,7 @@ from hatchet_sdk.logger import logger from hatchet_sdk.v2.callable import HatchetCallable from hatchet_sdk.worker.action_listener_process import worker_action_listener_process +from hatchet_sdk.compute.managed_compute import ManagedCompute from hatchet_sdk.worker.runner.run_loop_manager import WorkerActionRunLoopManager from hatchet_sdk.workflow import WorkflowMeta @@ -108,7 +109,10 @@ def action_function(context): return action_function for action_name, action_func in workflow.get_actions(namespace): - self.action_registry[action_name] = create_action_function(action_func) + fn = create_action_function(action_func) + # copy the compute from the action func to the action function + fn._step_compute = action_func._step_compute + self.action_registry[action_name] = fn def status(self) -> WorkerStatus: return self._status @@ -159,47 +163,13 @@ async def async_start( ) return - # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit - if not os.environ.get("HATCHET_CLOUD_REGISTER_ID"): - print("REGISTERING WORKER", os.environ.get("HATCHET_CLOUD_REGISTER_ID")) - - try: - print("1") - mw = CreateManagedWorkerRuntimeConfigRequest( - actions=self.action_registry.keys(), - num_replicas=1, - cpu_kind="shared", - cpus=1, - memory_mb=1024, - region=ManagedWorkerRegion.EWR, - ) - print("2") - - req = InfraAsCodeRequest(runtime_configs=[mw]) - - print("REQ", req.to_dict()) - - res = ( - await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=os.environ.get( - "HATCHET_CLOUD_REGISTER_ID" - ), - infra_as_code_request2=req, - _request_timeout=10, - ) - ) - - print("RESPONSE", res) - - sys.exit(0) - except Exception as e: - print("ERROR", e) - sys.exit(1) - # non blocking setup if not _from_start: self.setup_loop(options.loop) + managed_compute = ManagedCompute(self.action_registry, self.client) + await managed_compute.cloud_register() + self.action_listener_process = self._start_listener() self.action_runner = self._run_action_runner() self.action_listener_health_check = self.loop.create_task( From 08232284b14441ebfacf5b6edc76c143d1bd7f18 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Fri, 25 Oct 2024 14:50:09 -0400 Subject: [PATCH 08/33] wip: managed --- examples/managed/event.py | 41 +++++++++++ examples/managed/worker.py | 99 ++++++++++++++++++++++++++ examples/simple/worker.py | 71 +----------------- hatchet_sdk/compute/managed_compute.py | 51 +++++++------ pyproject.toml | 1 + 5 files changed, 171 insertions(+), 92 deletions(-) create mode 100644 examples/managed/event.py create mode 100644 examples/managed/worker.py diff --git a/examples/managed/event.py b/examples/managed/event.py new file mode 100644 index 00000000..c2d0178a --- /dev/null +++ b/examples/managed/event.py @@ -0,0 +1,41 @@ +from typing import List + +from dotenv import load_dotenv + +from hatchet_sdk import new_client +from hatchet_sdk.clients.events import BulkPushEventWithMetadata + +load_dotenv() + +client = new_client() + +# client.event.push("user:create", {"test": "test"}) +client.event.push( + "user:create", {"test": "test"}, options={"additional_metadata": {"hello": "moon"}} +) + +events: List[BulkPushEventWithMetadata] = [ + { + "key": "event1", + "payload": {"message": "This is event 1"}, + "additional_metadata": {"source": "test", "user_id": "user123"}, + }, + { + "key": "event2", + "payload": {"message": "This is event 2"}, + "additional_metadata": {"source": "test", "user_id": "user456"}, + }, + { + "key": "event3", + "payload": {"message": "This is event 3"}, + "additional_metadata": {"source": "test", "user_id": "user789"}, + }, +] + + +result = client.event.bulk_push( + events, + options={"namespace": "bulk-test"}, +) + +print(result) diff --git a/examples/managed/worker.py b/examples/managed/worker.py new file mode 100644 index 00000000..000e648b --- /dev/null +++ b/examples/managed/worker.py @@ -0,0 +1,99 @@ +import time + +from dotenv import load_dotenv + +from hatchet_sdk import Context, Hatchet +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.compute.configs import Compute + +load_dotenv() + +hatchet = Hatchet() + +# Default compute + +default_compute = Compute( + cpu_kind="shared", + cpus=1, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) + +blocked_compute = Compute( + pool="blocked-pool", + cpu_kind="shared", + cpus=1, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) + +gpu_compute = Compute( + cpu_kind="gpu", + cpus=2, + memory_mb=1024, + region=ManagedWorkerRegion.EWR +) + + +@hatchet.workflow(on_events=["user:create"]) +class ManagedWorkflow: + @hatchet.step( + timeout="11s", + retries=3, + compute=default_compute + ) + def step1(self, context: Context): + print("executed step1") + time.sleep(10) + # raise Exception("test") + return { + "step1": "step1", + } + + @hatchet.step( + timeout="11s", + retries=3, + compute=gpu_compute + ) + def step2(self, context: Context): + print("executed step2") + time.sleep(10) + # raise Exception("test") + return { + "step2": "step2", + } + + @hatchet.step( + timeout="11s", + retries=3, + compute=blocked_compute + ) + def step3(self, context: Context): + print("executed step3") + + return { + "step3": "step3", + } + + + @hatchet.step( + timeout="11s", + retries=3, + compute=default_compute + ) + def step4(self, context: Context): + print("executed step4") + time.sleep(10) + return { + "step4": "step4", + } + +def main(): + workflow = MyWorkflow() + worker = hatchet.worker("test-worker", max_runs=1) + worker.register_workflow(workflow) + worker.start() + + +if __name__ == "__main__": + main() diff --git a/examples/simple/worker.py b/examples/simple/worker.py index edfb4d5b..1eca4c79 100644 --- a/examples/simple/worker.py +++ b/examples/simple/worker.py @@ -3,45 +3,15 @@ from dotenv import load_dotenv from hatchet_sdk import Context, Hatchet -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion -from hatchet_sdk.compute.configs import Compute load_dotenv() -hatchet = Hatchet() - -# Default compute - -default_compute = Compute( - cpu_kind="shared", - cpus=1, - memory_mb=1024, - region=ManagedWorkerRegion.EWR -) - -blocked_compute = Compute( - pool="blocked-pool", - cpu_kind="shared", - cpus=1, - memory_mb=1024, - region=ManagedWorkerRegion.EWR -) - -gpu_compute = Compute( - cpu_kind="gpu", - cpus=2, - memory_mb=1024, - region=ManagedWorkerRegion.EWR -) +hatchet = Hatchet(debug=True) @hatchet.workflow(on_events=["user:create"]) class MyWorkflow: - @hatchet.step( - timeout="11s", - retries=3, - compute=default_compute - ) + @hatchet.step(timeout="11s", retries=3) def step1(self, context: Context): print("executed step1") time.sleep(10) @@ -50,43 +20,6 @@ def step1(self, context: Context): "step1": "step1", } - @hatchet.step( - timeout="11s", - retries=3, - compute=gpu_compute - ) - def step2(self, context: Context): - print("executed step2") - time.sleep(10) - # raise Exception("test") - return { - "step2": "step2", - } - - @hatchet.step( - timeout="11s", - retries=3, - compute=blocked_compute - ) - def step3(self, context: Context): - print("executed step3") - - return { - "step3": "step3", - } - - - @hatchet.step( - timeout="11s", - retries=3, - compute=default_compute - ) - def step4(self, context: Context): - print("executed step4") - time.sleep(10) - return { - "step4": "step4", - } def main(): workflow = MyWorkflow() diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 73434ee0..c5e62b8d 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -13,35 +13,40 @@ class ManagedCompute: def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): self.actions = actions self.client = client - self.action_map = self.get_action_map(self.actions) - + self.configs = self.get_compute_configs(self.actions) self.cloud_register_enabled = os.environ.get("HATCHET_CLOUD_REGISTER_ID") - if self.cloud_register_enabled is None: - logger.warning("🚫 Local mode detected, skipping cloud registration and running all actions locally.") + if len(self.configs) == 0: + logger.debug("no compute configs found, skipping cloud registration and running all actions locally.") + return - logger.warning("Managed Cloud Compute Plan:") - for _, compute in self.action_map.items(): + if self.cloud_register_enabled is None: + logger.warning("managed cloud compute plan:") + for compute in self.configs: logger.warning(f" ----------------------------") - logger.warning(f" Actions: {', '.join(compute.actions)}") - logger.warning(f" Num Replicas: {compute.num_replicas}") - logger.warning(f" CPU Kind: {compute.cpu_kind}") - logger.warning(f" CPUs: {compute.cpus}") - logger.warning(f" Memory MB: {compute.memory_mb}") - logger.warning(f" Region: {compute.region}") + logger.warning(f" actions: {', '.join(compute.actions)}") + logger.warning(f" num replicas: {compute.num_replicas}") + logger.warning(f" cpu kind: {compute.cpu_kind}") + logger.warning(f" cpus: {compute.cpus}") + logger.warning(f" memory mb: {compute.memory_mb}") + logger.warning(f" region: {compute.region}") - logger.warning("🚫 Local mode detected, skipping cloud registration and running all actions locally.") + logger.warning("NOTICE: local mode detected, skipping cloud registration and running all actions locally.") - def get_action_map(self, actions: Dict[str, Callable[..., Any]]) -> Dict[str, CreateManagedWorkerRuntimeConfigRequest]: + def get_compute_configs(self, actions: Dict[str, Callable[..., Any]]) -> List[CreateManagedWorkerRuntimeConfigRequest]: ''' Builds a map of compute hashes to compute configs and lists of actions that correspond to each compute hash. ''' map: Dict[str, CreateManagedWorkerRuntimeConfigRequest] = {} - for action, func in actions.items(): - try: + try: + for action, func in actions.items(): compute = func._step_compute + + if compute is None: + continue + key = compute.hash() if key not in map: map[key] = CreateManagedWorkerRuntimeConfigRequest( @@ -53,9 +58,11 @@ def get_action_map(self, actions: Dict[str, Callable[..., Any]]) -> Dict[str, Cr region = compute.region ) map[key].actions.append(action) - except Exception as e: - logger.error(f"Error getting compute for action {action}: {e}") - return map + + return list(map.values()) + except Exception as e: + logger.error(f"Error getting compute configs: {e}") + return [] async def cloud_register(self): # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit @@ -63,14 +70,12 @@ async def cloud_register(self): logger.info(f"Registering cloud compute plan with ID: {self.cloud_register_enabled}") try: - configs = list(self.action_map.values()) - - if len(configs) == 0: + if len(self.configs) == 0: logger.warning("No actions to register, skipping cloud registration.") return req = InfraAsCodeRequest( - runtime_configs = configs + runtime_configs = self.configs ) res = await self.client.rest.aio.managed_worker_api.infra_as_code_create( diff --git a/pyproject.toml b/pyproject.toml index c7d07914..2a174782 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ on_failure = "examples.on_failure.worker:main" programatic_replay = "examples.programatic_replay.worker:main" rate_limit = "examples.rate_limit.worker:main" simple = "examples.simple.worker:main" +managed = "examples.managed.worker:main" timeout = "examples.timeout.worker:main" blocked = "examples.blocked_async.worker:main" existing_loop = "examples.worker_existing_loop.worker:main" From a557c88ac6635873660897df3f25b368e1cfcb44 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 13:32:30 -0400 Subject: [PATCH 09/33] chore: gen --- examples/managed/worker.py | 46 ++-- .../clients/rest/api/rate_limits_api.py | 213 ++++++++++-------- hatchet_sdk/clients/rest/models/rate_limit.py | 67 ++++-- .../clients/rest/models/rate_limit_list.py | 41 ++-- .../models/rate_limit_order_by_direction.py | 8 +- .../rest/models/rate_limit_order_by_field.py | 10 +- .../models/tenant_step_run_queue_metrics.py | 19 +- .../rest/models/workflow_update_request.py | 24 +- hatchet_sdk/compute/configs.py | 38 +++- hatchet_sdk/compute/managed_compute.py | 68 +++--- hatchet_sdk/worker/worker.py | 2 +- 11 files changed, 302 insertions(+), 234 deletions(-) diff --git a/examples/managed/worker.py b/examples/managed/worker.py index 000e648b..53861fa7 100644 --- a/examples/managed/worker.py +++ b/examples/managed/worker.py @@ -3,7 +3,9 @@ from dotenv import load_dotenv from hatchet_sdk import Context, Hatchet -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) from hatchet_sdk.compute.configs import Compute load_dotenv() @@ -13,10 +15,7 @@ # Default compute default_compute = Compute( - cpu_kind="shared", - cpus=1, - memory_mb=1024, - region=ManagedWorkerRegion.EWR + cpu_kind="shared", cpus=1, memory_mb=1024, region=ManagedWorkerRegion.EWR ) blocked_compute = Compute( @@ -24,24 +23,17 @@ cpu_kind="shared", cpus=1, memory_mb=1024, - region=ManagedWorkerRegion.EWR + region=ManagedWorkerRegion.EWR, ) gpu_compute = Compute( - cpu_kind="gpu", - cpus=2, - memory_mb=1024, - region=ManagedWorkerRegion.EWR + cpu_kind="gpu", cpus=2, memory_mb=1024, region=ManagedWorkerRegion.EWR ) @hatchet.workflow(on_events=["user:create"]) class ManagedWorkflow: - @hatchet.step( - timeout="11s", - retries=3, - compute=default_compute - ) + @hatchet.step(timeout="11s", retries=3, compute=default_compute) def step1(self, context: Context): print("executed step1") time.sleep(10) @@ -50,11 +42,7 @@ def step1(self, context: Context): "step1": "step1", } - @hatchet.step( - timeout="11s", - retries=3, - compute=gpu_compute - ) + @hatchet.step(timeout="11s", retries=3, compute=gpu_compute) def step2(self, context: Context): print("executed step2") time.sleep(10) @@ -62,12 +50,8 @@ def step2(self, context: Context): return { "step2": "step2", } - - @hatchet.step( - timeout="11s", - retries=3, - compute=blocked_compute - ) + + @hatchet.step(timeout="11s", retries=3, compute=blocked_compute) def step3(self, context: Context): print("executed step3") @@ -75,19 +59,15 @@ def step3(self, context: Context): "step3": "step3", } - - @hatchet.step( - timeout="11s", - retries=3, - compute=default_compute - ) + @hatchet.step(timeout="11s", retries=3, compute=default_compute) def step4(self, context: Context): - print("executed step4") + print("executed step4") time.sleep(10) return { "step4": "step4", } + def main(): workflow = MyWorkflow() worker = hatchet.worker("test-worker", max_runs=1) diff --git a/hatchet_sdk/clients/rest/api/rate_limits_api.py b/hatchet_sdk/clients/rest/api/rate_limits_api.py index 7022fd93..3445856c 100644 --- a/hatchet_sdk/clients/rest/api/rate_limits_api.py +++ b/hatchet_sdk/clients/rest/api/rate_limits_api.py @@ -12,19 +12,20 @@ """ # noqa: E501 import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr -from typing import Optional +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList -from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import RateLimitOrderByDirection -from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import RateLimitOrderByField from hatchet_sdk.clients.rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.rest.api_response import ApiResponse +from hatchet_sdk.clients.rest.models.rate_limit_list import RateLimitList +from hatchet_sdk.clients.rest.models.rate_limit_order_by_direction import ( + RateLimitOrderByDirection, +) +from hatchet_sdk.clients.rest.models.rate_limit_order_by_field import ( + RateLimitOrderByField, +) from hatchet_sdk.clients.rest.rest import RESTResponseType @@ -40,23 +41,37 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call async def rate_limit_list( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[RateLimitOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[RateLimitOrderByDirection], + Field(description="The order direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -99,7 +114,7 @@ async def rate_limit_list( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._rate_limit_list_serialize( tenant=tenant, @@ -111,17 +126,16 @@ async def rate_limit_list( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RateLimitList", - '400': "APIErrors", - '403': "APIErrors", + "200": "RateLimitList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -129,23 +143,37 @@ async def rate_limit_list( response_types_map=_response_types_map, ).data - @validate_call async def rate_limit_list_with_http_info( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[RateLimitOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[RateLimitOrderByDirection], + Field(description="The order direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -188,7 +216,7 @@ async def rate_limit_list_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._rate_limit_list_serialize( tenant=tenant, @@ -200,17 +228,16 @@ async def rate_limit_list_with_http_info( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RateLimitList", - '400': "APIErrors", - '403': "APIErrors", + "200": "RateLimitList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) await response_data.read() return self.api_client.response_deserialize( @@ -218,23 +245,37 @@ async def rate_limit_list_with_http_info( response_types_map=_response_types_map, ) - @validate_call async def rate_limit_list_without_preload_content( self, - tenant: Annotated[str, Field(min_length=36, strict=True, max_length=36, description="The tenant id")], - offset: Annotated[Optional[StrictInt], Field(description="The number to skip")] = None, - limit: Annotated[Optional[StrictInt], Field(description="The number to limit by")] = None, - search: Annotated[Optional[StrictStr], Field(description="The search query to filter for")] = None, - order_by_field: Annotated[Optional[RateLimitOrderByField], Field(description="What to order by")] = None, - order_by_direction: Annotated[Optional[RateLimitOrderByDirection], Field(description="The order direction")] = None, + tenant: Annotated[ + str, + Field( + min_length=36, strict=True, max_length=36, description="The tenant id" + ), + ], + offset: Annotated[ + Optional[StrictInt], Field(description="The number to skip") + ] = None, + limit: Annotated[ + Optional[StrictInt], Field(description="The number to limit by") + ] = None, + search: Annotated[ + Optional[StrictStr], Field(description="The search query to filter for") + ] = None, + order_by_field: Annotated[ + Optional[RateLimitOrderByField], Field(description="What to order by") + ] = None, + order_by_direction: Annotated[ + Optional[RateLimitOrderByDirection], + Field(description="The order direction"), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, @@ -277,7 +318,7 @@ async def rate_limit_list_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 _param = self._rate_limit_list_serialize( tenant=tenant, @@ -289,21 +330,19 @@ async def rate_limit_list_without_preload_content( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, - _host_index=_host_index + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RateLimitList", - '400': "APIErrors", - '403': "APIErrors", + "200": "RateLimitList", + "400": "APIErrors", + "403": "APIErrors", } response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + *_param, _request_timeout=_request_timeout ) return response_data.response - def _rate_limit_list_serialize( self, tenant, @@ -320,8 +359,7 @@ def _rate_limit_list_serialize( _host = None - _collection_formats: Dict[str, str] = { - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -332,50 +370,43 @@ def _rate_limit_list_serialize( # process the path parameters if tenant is not None: - _path_params['tenant'] = tenant + _path_params["tenant"] = tenant # process the query parameters if offset is not None: - - _query_params.append(('offset', offset)) - + + _query_params.append(("offset", offset)) + if limit is not None: - - _query_params.append(('limit', limit)) - + + _query_params.append(("limit", limit)) + if search is not None: - - _query_params.append(('search', search)) - + + _query_params.append(("search", search)) + if order_by_field is not None: - - _query_params.append(('orderByField', order_by_field.value)) - + + _query_params.append(("orderByField", order_by_field.value)) + if order_by_direction is not None: - - _query_params.append(('orderByDirection', order_by_direction.value)) - + + _query_params.append(("orderByDirection", order_by_direction.value)) + # process the header parameters # process the form parameters # process the body parameter - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] ) - # authentication setting - _auth_settings: List[str] = [ - 'cookieAuth', - 'bearerAuth' - ] + _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/tenants/{tenant}/rate-limits', + method="GET", + resource_path="/api/v1/tenants/{tenant}/rate-limits", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -385,7 +416,5 @@ def _rate_limit_list_serialize( auth_settings=_auth_settings, collection_formats=_collection_formats, _host=_host, - _request_auth=_request_auth + _request_auth=_request_auth, ) - - diff --git a/hatchet_sdk/clients/rest/models/rate_limit.py b/hatchet_sdk/clients/rest/models/rate_limit.py index 7ecd674f..0bf88522 100644 --- a/hatchet_sdk/clients/rest/models/rate_limit.py +++ b/hatchet_sdk/clients/rest/models/rate_limit.py @@ -13,27 +13,48 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class RateLimit(BaseModel): """ RateLimit - """ # noqa: E501 + """ # noqa: E501 + key: StrictStr = Field(description="The key for the rate limit.") - tenant_id: StrictStr = Field(description="The ID of the tenant associated with this rate limit.", alias="tenantId") - limit_value: StrictInt = Field(description="The maximum number of requests allowed within the window.", alias="limitValue") - value: StrictInt = Field(description="The current number of requests made within the window.") - window: StrictStr = Field(description="The window of time in which the limitValue is enforced.") - last_refill: datetime = Field(description="The last time the rate limit was refilled.", alias="lastRefill") - __properties: ClassVar[List[str]] = ["key", "tenantId", "limitValue", "value", "window", "lastRefill"] + tenant_id: StrictStr = Field( + description="The ID of the tenant associated with this rate limit.", + alias="tenantId", + ) + limit_value: StrictInt = Field( + description="The maximum number of requests allowed within the window.", + alias="limitValue", + ) + value: StrictInt = Field( + description="The current number of requests made within the window." + ) + window: StrictStr = Field( + description="The window of time in which the limitValue is enforced." + ) + last_refill: datetime = Field( + description="The last time the rate limit was refilled.", alias="lastRefill" + ) + __properties: ClassVar[List[str]] = [ + "key", + "tenantId", + "limitValue", + "value", + "window", + "lastRefill", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +62,6 @@ class RateLimit(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -85,14 +104,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "key": obj.get("key"), - "tenantId": obj.get("tenantId"), - "limitValue": obj.get("limitValue"), - "value": obj.get("value"), - "window": obj.get("window"), - "lastRefill": obj.get("lastRefill") - }) + _obj = cls.model_validate( + { + "key": obj.get("key"), + "tenantId": obj.get("tenantId"), + "limitValue": obj.get("limitValue"), + "value": obj.get("value"), + "window": obj.get("window"), + "lastRefill": obj.get("lastRefill"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/rate_limit_list.py b/hatchet_sdk/clients/rest/models/rate_limit_list.py index d7cd3ce5..24df2f3a 100644 --- a/hatchet_sdk/clients/rest/models/rate_limit_list.py +++ b/hatchet_sdk/clients/rest/models/rate_limit_list.py @@ -13,21 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Self + from hatchet_sdk.clients.rest.models.pagination_response import PaginationResponse from hatchet_sdk.clients.rest.models.rate_limit import RateLimit -from typing import Optional, Set -from typing_extensions import Self + class RateLimitList(BaseModel): """ RateLimitList - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[PaginationResponse] = None rows: Optional[List[RateLimit]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +41,6 @@ class RateLimitList(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +74,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +93,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": PaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [RateLimit.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + PaginationResponse.from_dict(obj["pagination"]) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [RateLimit.from_dict(_item) for _item in obj["rows"]] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py b/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py index 13e249a6..64451da9 100644 --- a/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py +++ b/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,12 +28,10 @@ class RateLimitOrderByDirection(str, Enum): """ allowed enum values """ - ASC = 'asc' - DESC = 'desc' + ASC = "asc" + DESC = "desc" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of RateLimitOrderByDirection from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py b/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py index 1eed535c..6b5077be 100644 --- a/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py +++ b/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py @@ -13,8 +13,10 @@ from __future__ import annotations + import json from enum import Enum + from typing_extensions import Self @@ -26,13 +28,11 @@ class RateLimitOrderByField(str, Enum): """ allowed enum values """ - KEY = 'key' - VALUE = 'value' - LIMITVALUE = 'limitValue' + KEY = "key" + VALUE = "value" + LIMITVALUE = "limitValue" @classmethod def from_json(cls, json_str: str) -> Self: """Create an instance of RateLimitOrderByField from a JSON string""" return cls(json.loads(json_str)) - - diff --git a/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py index 045fa467..90f85ae6 100644 --- a/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TenantStepRunQueueMetrics(BaseModel): """ TenantStepRunQueueMetrics - """ # noqa: E501 + """ # noqa: E501 + queues: Optional[Dict[str, StrictInt]] = None __properties: ClassVar[List[str]] = ["queues"] @@ -35,7 +37,6 @@ class TenantStepRunQueueMetrics(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,8 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - }) + _obj = cls.model_validate({}) return _obj - - diff --git a/hatchet_sdk/clients/rest/models/workflow_update_request.py b/hatchet_sdk/clients/rest/models/workflow_update_request.py index 59710e86..5ec56835 100644 --- a/hatchet_sdk/clients/rest/models/workflow_update_request.py +++ b/hatchet_sdk/clients/rest/models/workflow_update_request.py @@ -13,20 +13,24 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class WorkflowUpdateRequest(BaseModel): """ WorkflowUpdateRequest - """ # noqa: E501 - is_paused: Optional[StrictBool] = Field(default=None, description="Whether the workflow is paused.", alias="isPaused") + """ # noqa: E501 + + is_paused: Optional[StrictBool] = Field( + default=None, description="Whether the workflow is paused.", alias="isPaused" + ) __properties: ClassVar[List[str]] = ["isPaused"] model_config = ConfigDict( @@ -35,7 +39,6 @@ class WorkflowUpdateRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +63,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +81,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "isPaused": obj.get("isPaused") - }) + _obj = cls.model_validate({"isPaused": obj.get("isPaused")}) return _obj - - diff --git a/hatchet_sdk/compute/configs.py b/hatchet_sdk/compute/configs.py index cd9c6815..906835f8 100644 --- a/hatchet_sdk/compute/configs.py +++ b/hatchet_sdk/compute/configs.py @@ -1,17 +1,37 @@ import hashlib from typing import Annotated, Optional -from pydantic import BaseModel, StrictStr, Field -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from pydantic import BaseModel, Field, StrictStr + +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) + class Compute(BaseModel): - pool: Optional[str] = Field(default="default", description="The name of the compute pool to use",) - num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(default=1, alias="num_replicas") - region: Optional[ManagedWorkerRegion] = Field(default=None, description="The region to deploy the worker to") - cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpu_kind") - cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") - memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memory_mb") + pool: Optional[str] = Field( + default="default", + description="The name of the compute pool to use", + ) + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( + default=1, alias="num_replicas" + ) + region: Optional[ManagedWorkerRegion] = Field( + default=None, description="The region to deploy the worker to" + ) + cpu_kind: StrictStr = Field( + description="The kind of CPU to use for the worker", alias="cpu_kind" + ) + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field( + description="The number of CPUs to use for the worker" + ) + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field( + description="The amount of memory in MB to use for the worker", + alias="memory_mb", + ) def __json__(self): return self.model_dump_json() diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index c5e62b8d..70d8f8d9 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -3,12 +3,19 @@ from typing import Any, Callable, Dict, List from hatchet_sdk.client import Client -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import CreateManagedWorkerRuntimeConfigRequest -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import InfraAsCodeRequest -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ManagedWorkerRegion +from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( + CreateManagedWorkerRuntimeConfigRequest, +) +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( + InfraAsCodeRequest, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( + ManagedWorkerRegion, +) from hatchet_sdk.compute.configs import Compute from hatchet_sdk.logger import logger + class ManagedCompute: def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): self.actions = actions @@ -17,7 +24,9 @@ def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): self.cloud_register_enabled = os.environ.get("HATCHET_CLOUD_REGISTER_ID") if len(self.configs) == 0: - logger.debug("no compute configs found, skipping cloud registration and running all actions locally.") + logger.debug( + "no compute configs found, skipping cloud registration and running all actions locally." + ) return if self.cloud_register_enabled is None: @@ -31,19 +40,22 @@ def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): logger.warning(f" memory mb: {compute.memory_mb}") logger.warning(f" region: {compute.region}") - logger.warning("NOTICE: local mode detected, skipping cloud registration and running all actions locally.") - + logger.warning( + "NOTICE: local mode detected, skipping cloud registration and running all actions locally." + ) - def get_compute_configs(self, actions: Dict[str, Callable[..., Any]]) -> List[CreateManagedWorkerRuntimeConfigRequest]: - ''' + def get_compute_configs( + self, actions: Dict[str, Callable[..., Any]] + ) -> List[CreateManagedWorkerRuntimeConfigRequest]: + """ Builds a map of compute hashes to compute configs and lists of actions that correspond to each compute hash. - ''' + """ map: Dict[str, CreateManagedWorkerRuntimeConfigRequest] = {} - + try: for action, func in actions.items(): compute = func._step_compute - + if compute is None: continue @@ -52,10 +64,10 @@ def get_compute_configs(self, actions: Dict[str, Callable[..., Any]]) -> List[Cr map[key] = CreateManagedWorkerRuntimeConfigRequest( actions=[], num_replicas=1, - cpu_kind = compute.cpu_kind, - cpus = compute.cpus, - memory_mb = compute.memory_mb, - region = compute.region + cpu_kind=compute.cpu_kind, + cpus=compute.cpus, + memory_mb=compute.memory_mb, + region=compute.region, ) map[key].actions.append(action) @@ -67,24 +79,28 @@ def get_compute_configs(self, actions: Dict[str, Callable[..., Any]]) -> List[Cr async def cloud_register(self): # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit if self.cloud_register_enabled is not None: - logger.info(f"Registering cloud compute plan with ID: {self.cloud_register_enabled}") - + logger.info( + f"Registering cloud compute plan with ID: {self.cloud_register_enabled}" + ) + try: if len(self.configs) == 0: - logger.warning("No actions to register, skipping cloud registration.") + logger.warning( + "No actions to register, skipping cloud registration." + ) return - req = InfraAsCodeRequest( - runtime_configs = self.configs - ) + req = InfraAsCodeRequest(runtime_configs=self.configs) - res = await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=self.cloud_register_enabled, - infra_as_code_request2=req, - _request_timeout=10, + res = ( + await self.client.rest.aio.managed_worker_api.infra_as_code_create( + infra_as_code_request=self.cloud_register_enabled, + infra_as_code_request2=req, + _request_timeout=10, + ) ) sys.exit(0) except Exception as e: print("ERROR", e) - sys.exit(1) \ No newline at end of file + sys.exit(1) diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index bdca13fc..909088af 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -18,13 +18,13 @@ from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( ManagedWorkerRegion, ) +from hatchet_sdk.compute.managed_compute import ManagedCompute from hatchet_sdk.context import Context from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts from hatchet_sdk.loader import ClientConfig from hatchet_sdk.logger import logger from hatchet_sdk.v2.callable import HatchetCallable from hatchet_sdk.worker.action_listener_process import worker_action_listener_process -from hatchet_sdk.compute.managed_compute import ManagedCompute from hatchet_sdk.worker.runner.run_loop_manager import WorkerActionRunLoopManager from hatchet_sdk.workflow import WorkflowMeta From c68e6aec5e18bb6d31b43262441244e98e765765 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 13:34:48 -0400 Subject: [PATCH 10/33] feat: regions --- examples/managed/worker.py | 8 ++++---- hatchet_sdk/compute/configs.py | 4 ++-- hatchet_sdk/compute/managed_compute.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/managed/worker.py b/examples/managed/worker.py index 53861fa7..3814ee89 100644 --- a/examples/managed/worker.py +++ b/examples/managed/worker.py @@ -15,7 +15,7 @@ # Default compute default_compute = Compute( - cpu_kind="shared", cpus=1, memory_mb=1024, region=ManagedWorkerRegion.EWR + cpu_kind="shared", cpus=1, memory_mb=1024, regions=[ManagedWorkerRegion.EWR] ) blocked_compute = Compute( @@ -23,11 +23,11 @@ cpu_kind="shared", cpus=1, memory_mb=1024, - region=ManagedWorkerRegion.EWR, + regions=[ManagedWorkerRegion.EWR], ) gpu_compute = Compute( - cpu_kind="gpu", cpus=2, memory_mb=1024, region=ManagedWorkerRegion.EWR + cpu_kind="gpu", cpus=2, memory_mb=1024, regions=[ManagedWorkerRegion.EWR] ) @@ -69,7 +69,7 @@ def step4(self, context: Context): def main(): - workflow = MyWorkflow() + workflow = ManagedWorkflow() worker = hatchet.worker("test-worker", max_runs=1) worker.register_workflow(workflow) worker.start() diff --git a/hatchet_sdk/compute/configs.py b/hatchet_sdk/compute/configs.py index 906835f8..8e7d6ba0 100644 --- a/hatchet_sdk/compute/configs.py +++ b/hatchet_sdk/compute/configs.py @@ -19,8 +19,8 @@ class Compute(BaseModel): num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( default=1, alias="num_replicas" ) - region: Optional[ManagedWorkerRegion] = Field( - default=None, description="The region to deploy the worker to" + regions: Optional[list[ManagedWorkerRegion]] = Field( + default=None, description="The regions to deploy the worker to" ) cpu_kind: StrictStr = Field( description="The kind of CPU to use for the worker", alias="cpu_kind" diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 70d8f8d9..777d293a 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -67,7 +67,7 @@ def get_compute_configs( cpu_kind=compute.cpu_kind, cpus=compute.cpus, memory_mb=compute.memory_mb, - region=compute.region, + regions=compute.regions, ) map[key].actions.append(action) From 2eb05e0fb8b1ddc7ec5b0596d5fe748297b346ff Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 13:53:11 -0400 Subject: [PATCH 11/33] fix: gen --- generate.sh | 4 +- hatchet_sdk/clients/cloud_rest/__init__.py | 187 ++++++---- .../clients/cloud_rest/api/billing_api.py | 84 ++--- .../clients/cloud_rest/api/build_api.py | 26 +- .../cloud_rest/api/feature_flags_api.py | 12 +- .../clients/cloud_rest/api/github_api.py | 132 +++---- hatchet_sdk/clients/cloud_rest/api/log_api.py | 96 ++--- .../cloud_rest/api/managed_worker_api.py | 328 +++++++++--------- .../clients/cloud_rest/api/metadata_api.py | 20 +- .../clients/cloud_rest/api/metrics_api.py | 70 ++-- .../clients/cloud_rest/api/tenant_api.py | 32 +- .../clients/cloud_rest/api/workflow_api.py | 26 +- .../clients/cloud_rest/models/__init__.py | 187 ++++++---- .../{build.py => build_get200_response.py} | 67 ++-- .../clients/cloud_rest/models/coupon.py | 124 ------- .../cloud_rest/models/coupon_frequency.py | 37 -- ...e_managed_worker_runtime_config_request.py | 118 ------- ...ub_app_list_branches200_response_inner.py} | 31 +- ...hub_app_list_installations200_response.py} | 55 ++- ...t_installations200_response_pagination.py} | 44 ++- ...t_installations200_response_rows_inner.py} | 56 ++- ...ations200_response_rows_inner_metadata.py} | 53 ++- ...ithub_app_list_repos200_response_inner.py} | 31 +- ...est.py => infra_as_code_create_request.py} | 50 +-- ..._object.py => log_create_request_inner.py} | 84 ++--- ...t.py => log_create_request_inner_event.py} | 28 +- ...fly.py => log_create_request_inner_fly.py} | 45 ++- ...py => log_create_request_inner_fly_app.py} | 31 +- ...log.py => log_create_request_inner_log.py} | 28 +- ...g_line_list.py => log_list200_response.py} | 55 ++- ....py => log_list200_response_rows_inner.py} | 38 +- ...st.py => managed_worker_create_request.py} | 80 ++--- ...ged_worker_create_request_build_config.py} | 68 ++-- ...reate_request_build_config_steps_inner.py} | 43 +-- ...ed_worker_create_request_runtime_config.py | 109 ++++++ .../models/managed_worker_event_status.py | 39 --- ...managed_worker_events_list200_response.py} | 57 ++- ...ker_events_list200_response_rows_inner.py} | 71 ++-- ...aged_worker_instances_list200_response.py} | 57 ++- ..._instances_list200_response_rows_inner.py} | 60 ++-- ....py => managed_worker_list200_response.py} | 55 ++- ...ged_worker_list200_response_rows_inner.py} | 94 ++--- ...st200_response_rows_inner_build_config.py} | 88 ++--- ...se_rows_inner_build_config_steps_inner.py} | 56 ++- ...sponse_rows_inner_runtime_configs_inner.py | 110 ++++++ .../models/managed_worker_region.py | 68 ---- .../models/managed_worker_runtime_config.py | 127 ------- ...st.py => managed_worker_update_request.py} | 83 ++--- ...etadata.py => metadata_get200_response.py} | 52 ++- ..._errors.py => metadata_get400_response.py} | 43 +-- ... metadata_get400_response_errors_inner.py} | 53 ++- ...y => metrics_cpu_get200_response_inner.py} | 50 ++- ...get200_response_inner_histograms_inner.py} | 45 ++- ...ponse_inner_histograms_inner_histogram.py} | 47 ++- ...stograms_inner_histogram_buckets_inner.py} | 38 +- ...untime_config_list_actions200_response.py} | 28 +- ....py => subscription_upsert200_response.py} | 71 ++-- ...tion.py => subscription_upsert_request.py} | 35 +- ...> tenant_billing_state_get200_response.py} | 99 ++---- ...ing_state_get200_response_coupons_inner.py | 108 ++++++ ..._get200_response_payment_methods_inner.py} | 50 ++- ...ling_state_get200_response_plans_inner.py} | 52 ++- ...ling_state_get200_response_subscription.py | 103 ++++++ .../models/tenant_subscription_status.py | 39 --- ...low_run_events_get_metrics200_response.py} | 48 +-- ..._get_metrics200_response_results_inner.py} | 53 ++- hatchet_sdk/compute/managed_compute.py | 24 +- 67 files changed, 2056 insertions(+), 2426 deletions(-) rename hatchet_sdk/clients/cloud_rest/models/{build.py => build_get200_response.py} (64%) delete mode 100644 hatchet_sdk/clients/cloud_rest/models/coupon.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py rename hatchet_sdk/clients/cloud_rest/models/{github_branch.py => github_app_list_branches200_response_inner.py} (77%) rename hatchet_sdk/clients/cloud_rest/models/{instance_list.py => github_app_list_installations200_response.py} (64%) rename hatchet_sdk/clients/cloud_rest/models/{pagination_response.py => github_app_list_installations200_response_pagination.py} (70%) rename hatchet_sdk/clients/cloud_rest/models/{github_app_installation.py => github_app_list_installations200_response_rows_inner.py} (62%) rename hatchet_sdk/clients/cloud_rest/models/{api_resource_meta.py => github_app_list_installations200_response_rows_inner_metadata.py} (66%) rename hatchet_sdk/clients/cloud_rest/models/{github_repo.py => github_app_list_repos200_response_inner.py} (78%) rename hatchet_sdk/clients/cloud_rest/models/{infra_as_code_request.py => infra_as_code_create_request.py} (68%) rename hatchet_sdk/clients/cloud_rest/models/{event_object.py => log_create_request_inner.py} (57%) rename hatchet_sdk/clients/cloud_rest/models/{event_object_event.py => log_create_request_inner_event.py} (80%) rename hatchet_sdk/clients/cloud_rest/models/{event_object_fly.py => log_create_request_inner_fly.py} (72%) rename hatchet_sdk/clients/cloud_rest/models/{event_object_fly_app.py => log_create_request_inner_fly_app.py} (79%) rename hatchet_sdk/clients/cloud_rest/models/{event_object_log.py => log_create_request_inner_log.py} (80%) rename hatchet_sdk/clients/cloud_rest/models/{log_line_list.py => log_list200_response.py} (66%) rename hatchet_sdk/clients/cloud_rest/models/{log_line.py => log_list200_response_rows_inner.py} (78%) rename hatchet_sdk/clients/cloud_rest/models/{create_managed_worker_request.py => managed_worker_create_request.py} (54%) rename hatchet_sdk/clients/cloud_rest/models/{create_managed_worker_build_config_request.py => managed_worker_create_request_build_config.py} (60%) rename hatchet_sdk/clients/cloud_rest/models/{create_build_step_request.py => managed_worker_create_request_build_config_steps_inner.py} (69%) create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py rename hatchet_sdk/clients/cloud_rest/models/{list_github_app_installations_response.py => managed_worker_events_list200_response.py} (64%) rename hatchet_sdk/clients/cloud_rest/models/{managed_worker_event.py => managed_worker_events_list200_response_rows_inner.py} (62%) rename hatchet_sdk/clients/cloud_rest/models/{managed_worker_event_list.py => managed_worker_instances_list200_response.py} (63%) rename hatchet_sdk/clients/cloud_rest/models/{instance.py => managed_worker_instances_list200_response_rows_inner.py} (68%) rename hatchet_sdk/clients/cloud_rest/models/{managed_worker_list.py => managed_worker_list200_response.py} (64%) rename hatchet_sdk/clients/cloud_rest/models/{managed_worker.py => managed_worker_list200_response_rows_inner.py} (52%) rename hatchet_sdk/clients/cloud_rest/models/{managed_worker_build_config.py => managed_worker_list200_response_rows_inner_build_config.py} (51%) rename hatchet_sdk/clients/cloud_rest/models/{build_step.py => managed_worker_list200_response_rows_inner_build_config_steps_inner.py} (60%) create mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py rename hatchet_sdk/clients/cloud_rest/models/{update_managed_worker_request.py => managed_worker_update_request.py} (53%) rename hatchet_sdk/clients/cloud_rest/models/{api_cloud_metadata.py => metadata_get200_response.py} (65%) rename hatchet_sdk/clients/cloud_rest/models/{api_errors.py => metadata_get400_response.py} (74%) rename hatchet_sdk/clients/cloud_rest/models/{api_error.py => metadata_get400_response_errors_inner.py} (67%) rename hatchet_sdk/clients/cloud_rest/models/{sample_stream.py => metrics_cpu_get200_response_inner.py} (71%) rename hatchet_sdk/clients/cloud_rest/models/{sample_histogram_pair.py => metrics_cpu_get200_response_inner_histograms_inner.py} (67%) rename hatchet_sdk/clients/cloud_rest/models/{sample_histogram.py => metrics_cpu_get200_response_inner_histograms_inner_histogram.py} (67%) rename hatchet_sdk/clients/cloud_rest/models/{histogram_bucket.py => metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py} (74%) rename hatchet_sdk/clients/cloud_rest/models/{runtime_config_actions_response.py => runtime_config_list_actions200_response.py} (79%) rename hatchet_sdk/clients/cloud_rest/models/{tenant_subscription.py => subscription_upsert200_response.py} (55%) rename hatchet_sdk/clients/cloud_rest/models/{update_tenant_subscription.py => subscription_upsert_request.py} (77%) rename hatchet_sdk/clients/cloud_rest/models/{tenant_billing_state.py => tenant_billing_state_get200_response.py} (53%) create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py rename hatchet_sdk/clients/cloud_rest/models/{tenant_payment_method.py => tenant_billing_state_get200_response_payment_methods_inner.py} (66%) rename hatchet_sdk/clients/cloud_rest/models/{subscription_plan.py => tenant_billing_state_get200_response_plans_inner.py} (70%) create mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py delete mode 100644 hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py rename hatchet_sdk/clients/cloud_rest/models/{workflow_run_events_metrics_counts.py => workflow_run_events_get_metrics200_response.py} (69%) rename hatchet_sdk/clients/cloud_rest/models/{workflow_run_events_metric.py => workflow_run_events_get_metrics200_response_results_inner.py} (71%) diff --git a/generate.sh b/generate.sh index 96caa1c6..1f66a7f1 100755 --- a/generate.sh +++ b/generate.sh @@ -101,7 +101,7 @@ if [ "$CLOUD_MODE" = true ]; then mkdir -p $cloud_dst_dir # generate into cloud tmp folder - openapi-generator-cli generate -i ./hatchet-cloud/bin/oas/openapi.yaml -g python -o ./cloud_tmp --skip-validate-spec \ + openapi-generator-cli generate -i ./hatchet-cloud/api-contracts/openapi/openapi.yaml -g python -o ./cloud_tmp --skip-validate-spec \ --library asyncio \ --global-property=apiTests=false \ --global-property=apiDocs=true \ @@ -116,7 +116,7 @@ if [ "$CLOUD_MODE" = true ]; then mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/__init__.py $cloud_dst_dir/__init__.py mv $cloud_tmp_dir/hatchet_sdk/clients/cloud_rest/rest.py $cloud_dst_dir/rest.py - openapi-generator-cli generate -i ./hatchet-cloud/bin/oas/openapi.yaml -g python -o . --skip-validate-spec \ + openapi-generator-cli generate -i ./hatchet-cloud/api-contracts/openapi/openapi.yaml -g python -o . --skip-validate-spec \ --library asyncio \ --global-property=apis,models \ --global-property=apiTests=false \ diff --git a/hatchet_sdk/clients/cloud_rest/__init__.py b/hatchet_sdk/clients/cloud_rest/__init__.py index cdfd048a..4c794689 100644 --- a/hatchet_sdk/clients/cloud_rest/__init__.py +++ b/hatchet_sdk/clients/cloud_rest/__init__.py @@ -43,99 +43,144 @@ ) # import models into sdk package -from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata -from hatchet_sdk.clients.cloud_rest.models.api_error import APIError -from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( BillingPortalLinkGet200Response, ) -from hatchet_sdk.clients.cloud_rest.models.build import Build -from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep -from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon -from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( - CreateBuildStepRequest, +from hatchet_sdk.clients.cloud_rest.models.build_get200_response import ( + BuildGet200Response, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( - CreateManagedWorkerBuildConfigRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_branches200_response_inner import ( + GithubAppListBranches200ResponseInner, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( - CreateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response import ( + GithubAppListInstallations200Response, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, ) -from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject -from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent -from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly -from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp -from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( - GithubAppInstallation, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner import ( + GithubAppListInstallations200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch -from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo -from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( - InfraAsCodeRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, ) -from hatchet_sdk.clients.cloud_rest.models.instance import Instance -from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( - ListGithubAppInstallationsResponse, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import ( + GithubAppListRepos200ResponseInner, ) -from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine -from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( - ManagedWorkerBuildConfig, +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import ( + InfraAsCodeCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( - ManagedWorkerEvent, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner import ( + LogCreateRequestInner, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( - ManagedWorkerEventList, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import ( + LogCreateRequestInnerEvent, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( - ManagedWorkerEventStatus, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import ( + LogCreateRequestInnerFly, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import ( + LogCreateRequestInnerFlyApp, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( - ManagedWorkerRuntimeConfig, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import ( + LogCreateRequestInnerLog, ) -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( - RuntimeConfigActionsResponse, +from hatchet_sdk.clients.cloud_rest.models.log_list200_response import ( + LogList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( - SampleHistogramPair, +from hatchet_sdk.clients.cloud_rest.models.log_list200_response_rows_inner import ( + LogList200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream -from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( - TenantBillingState, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ( + ManagedWorkerCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( - TenantPaymentMethod, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ( + ManagedWorkerCreateRequestBuildConfig, ) -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( - TenantSubscriptionStatus, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import ( + ManagedWorkerCreateRequestBuildConfigStepsInner, ) -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( - UpdateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, ) -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( - UpdateTenantSubscription, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response import ( + ManagedWorkerEventsList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( - WorkflowRunEventsMetric, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import ( + ManagedWorkerEventsList200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( - WorkflowRunEventsMetricsCounts, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response import ( + ManagedWorkerInstancesList200Response, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response_rows_inner import ( + ManagedWorkerInstancesList200ResponseRowsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response import ( + ManagedWorkerList200Response, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ( + ManagedWorkerList200ResponseRowsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import ( + ManagedWorkerList200ResponseRowsInnerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import ( + ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import ( + ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_update_request import ( + ManagedWorkerUpdateRequest, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get200_response import ( + MetadataGet200Response, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response import ( + MetadataGet400Response, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response_errors_inner import ( + MetadataGet400ResponseErrorsInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner import ( + MetricsCpuGet200ResponseInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogram, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner, +) +from hatchet_sdk.clients.cloud_rest.models.runtime_config_list_actions200_response import ( + RuntimeConfigListActions200Response, +) +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert200_response import ( + SubscriptionUpsert200Response, +) +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert_request import ( + SubscriptionUpsertRequest, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response import ( + TenantBillingStateGet200Response, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_coupons_inner import ( + TenantBillingStateGet200ResponseCouponsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_payment_methods_inner import ( + TenantBillingStateGet200ResponsePaymentMethodsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_plans_inner import ( + TenantBillingStateGet200ResponsePlansInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_subscription import ( + TenantBillingStateGet200ResponseSubscription, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response import ( + WorkflowRunEventsGetMetrics200Response, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response_results_inner import ( + WorkflowRunEventsGetMetrics200ResponseResultsInner, ) diff --git a/hatchet_sdk/clients/cloud_rest/api/billing_api.py b/hatchet_sdk/clients/cloud_rest/api/billing_api.py index f952a69a..019e3378 100644 --- a/hatchet_sdk/clients/cloud_rest/api/billing_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/billing_api.py @@ -22,9 +22,11 @@ from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( BillingPortalLinkGet200Response, ) -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( - UpdateTenantSubscription, +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert200_response import ( + SubscriptionUpsert200Response, +) +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert_request import ( + SubscriptionUpsertRequest, ) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -100,8 +102,8 @@ async def billing_portal_link_get( _response_types_map: Dict[str, Optional[str]] = { "200": "BillingPortalLinkGet200Response", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -171,8 +173,8 @@ async def billing_portal_link_get_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "BillingPortalLinkGet200Response", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -242,8 +244,8 @@ async def billing_portal_link_get_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "BillingPortalLinkGet200Response", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -351,8 +353,8 @@ async def lago_message_create( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -413,8 +415,8 @@ async def lago_message_create_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -475,8 +477,8 @@ async def lago_message_create_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -540,7 +542,7 @@ async def subscription_upsert( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + subscription_upsert_request: Optional[SubscriptionUpsertRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -552,15 +554,15 @@ async def subscription_upsert( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TenantSubscription: + ) -> SubscriptionUpsert200Response: """Create a new subscription Update a subscription :param tenant: The tenant id (required) :type tenant: str - :param update_tenant_subscription: - :type update_tenant_subscription: UpdateTenantSubscription + :param subscription_upsert_request: + :type subscription_upsert_request: SubscriptionUpsertRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -585,7 +587,7 @@ async def subscription_upsert( _param = self._subscription_upsert_serialize( tenant=tenant, - update_tenant_subscription=update_tenant_subscription, + subscription_upsert_request=subscription_upsert_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -593,9 +595,9 @@ async def subscription_upsert( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantSubscription", - "400": "APIErrors", - "403": "APIErrors", + "200": "SubscriptionUpsert200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -615,7 +617,7 @@ async def subscription_upsert_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + subscription_upsert_request: Optional[SubscriptionUpsertRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -627,15 +629,15 @@ async def subscription_upsert_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TenantSubscription]: + ) -> ApiResponse[SubscriptionUpsert200Response]: """Create a new subscription Update a subscription :param tenant: The tenant id (required) :type tenant: str - :param update_tenant_subscription: - :type update_tenant_subscription: UpdateTenantSubscription + :param subscription_upsert_request: + :type subscription_upsert_request: SubscriptionUpsertRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -660,7 +662,7 @@ async def subscription_upsert_with_http_info( _param = self._subscription_upsert_serialize( tenant=tenant, - update_tenant_subscription=update_tenant_subscription, + subscription_upsert_request=subscription_upsert_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -668,9 +670,9 @@ async def subscription_upsert_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantSubscription", - "400": "APIErrors", - "403": "APIErrors", + "200": "SubscriptionUpsert200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -690,7 +692,7 @@ async def subscription_upsert_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - update_tenant_subscription: Optional[UpdateTenantSubscription] = None, + subscription_upsert_request: Optional[SubscriptionUpsertRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -709,8 +711,8 @@ async def subscription_upsert_without_preload_content( :param tenant: The tenant id (required) :type tenant: str - :param update_tenant_subscription: - :type update_tenant_subscription: UpdateTenantSubscription + :param subscription_upsert_request: + :type subscription_upsert_request: SubscriptionUpsertRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -735,7 +737,7 @@ async def subscription_upsert_without_preload_content( _param = self._subscription_upsert_serialize( tenant=tenant, - update_tenant_subscription=update_tenant_subscription, + subscription_upsert_request=subscription_upsert_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -743,9 +745,9 @@ async def subscription_upsert_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantSubscription", - "400": "APIErrors", - "403": "APIErrors", + "200": "SubscriptionUpsert200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -755,7 +757,7 @@ async def subscription_upsert_without_preload_content( def _subscription_upsert_serialize( self, tenant, - update_tenant_subscription, + subscription_upsert_request, _request_auth, _content_type, _headers, @@ -780,8 +782,8 @@ def _subscription_upsert_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_tenant_subscription is not None: - _body_params = update_tenant_subscription + if subscription_upsert_request is not None: + _body_params = subscription_upsert_request # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( diff --git a/hatchet_sdk/clients/cloud_rest/api/build_api.py b/hatchet_sdk/clients/cloud_rest/api/build_api.py index f2618ac5..dca1a4a7 100644 --- a/hatchet_sdk/clients/cloud_rest/api/build_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/build_api.py @@ -19,7 +19,9 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.build import Build +from hatchet_sdk.clients.cloud_rest.models.build_get200_response import ( + BuildGet200Response, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -55,7 +57,7 @@ async def build_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Build: + ) -> BuildGet200Response: """Get Build Get a build @@ -93,9 +95,9 @@ async def build_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Build", - "400": "APIErrors", - "403": "APIErrors", + "200": "BuildGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -126,7 +128,7 @@ async def build_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Build]: + ) -> ApiResponse[BuildGet200Response]: """Get Build Get a build @@ -164,9 +166,9 @@ async def build_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Build", - "400": "APIErrors", - "403": "APIErrors", + "200": "BuildGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -235,9 +237,9 @@ async def build_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Build", - "400": "APIErrors", - "403": "APIErrors", + "200": "BuildGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py index a53fbf95..885679b2 100644 --- a/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py @@ -93,8 +93,8 @@ async def feature_flags_list( _response_types_map: Dict[str, Optional[str]] = { "200": "Dict[str, str]", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -164,8 +164,8 @@ async def feature_flags_list_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Dict[str, str]", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -235,8 +235,8 @@ async def feature_flags_list_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Dict[str, str]", - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/github_api.py b/hatchet_sdk/clients/cloud_rest/api/github_api.py index 04fdf4fe..cc94f03f 100644 --- a/hatchet_sdk/clients/cloud_rest/api/github_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/github_api.py @@ -19,10 +19,14 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch -from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( - ListGithubAppInstallationsResponse, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_branches200_response_inner import ( + GithubAppListBranches200ResponseInner, +) +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response import ( + GithubAppListInstallations200Response, +) +from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import ( + GithubAppListRepos200ResponseInner, ) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -64,7 +68,7 @@ async def github_app_list_branches( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GithubBranch]: + ) -> List[GithubAppListBranches200ResponseInner]: """List Github App branches List Github App branches @@ -108,10 +112,10 @@ async def github_app_list_branches( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubBranch]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListBranches200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -147,7 +151,7 @@ async def github_app_list_branches_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GithubBranch]]: + ) -> ApiResponse[List[GithubAppListBranches200ResponseInner]]: """List Github App branches List Github App branches @@ -191,10 +195,10 @@ async def github_app_list_branches_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubBranch]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListBranches200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -274,10 +278,10 @@ async def github_app_list_branches_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubBranch]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListBranches200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -355,7 +359,7 @@ async def github_app_list_installations( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListGithubAppInstallationsResponse: + ) -> GithubAppListInstallations200Response: """List Github App installations List Github App installations @@ -390,10 +394,10 @@ async def github_app_list_installations( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListGithubAppInstallationsResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "GithubAppListInstallations200Response", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -418,7 +422,7 @@ async def github_app_list_installations_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListGithubAppInstallationsResponse]: + ) -> ApiResponse[GithubAppListInstallations200Response]: """List Github App installations List Github App installations @@ -453,10 +457,10 @@ async def github_app_list_installations_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListGithubAppInstallationsResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "GithubAppListInstallations200Response", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -516,10 +520,10 @@ async def github_app_list_installations_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListGithubAppInstallationsResponse", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "GithubAppListInstallations200Response", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -597,7 +601,7 @@ async def github_app_list_repos( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GithubRepo]: + ) -> List[GithubAppListRepos200ResponseInner]: """List Github App repositories List Github App repositories @@ -635,10 +639,10 @@ async def github_app_list_repos( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubRepo]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListRepos200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -672,7 +676,7 @@ async def github_app_list_repos_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GithubRepo]]: + ) -> ApiResponse[List[GithubAppListRepos200ResponseInner]]: """List Github App repositories List Github App repositories @@ -710,10 +714,10 @@ async def github_app_list_repos_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubRepo]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListRepos200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -785,10 +789,10 @@ async def github_app_list_repos_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[GithubRepo]", - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "200": "List[GithubAppListRepos200ResponseInner]", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -896,9 +900,9 @@ async def github_update_global_webhook( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -959,9 +963,9 @@ async def github_update_global_webhook_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1022,9 +1026,9 @@ async def github_update_global_webhook_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1138,9 +1142,9 @@ async def github_update_tenant_webhook( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1210,9 +1214,9 @@ async def github_update_tenant_webhook_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1282,9 +1286,9 @@ async def github_update_tenant_webhook_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "401": "APIErrors", - "405": "APIErrors", + "400": "MetadataGet400Response", + "401": "MetadataGet400Response", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/log_api.py b/hatchet_sdk/clients/cloud_rest/api/log_api.py index ba947bbe..eefc22ae 100644 --- a/hatchet_sdk/clients/cloud_rest/api/log_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/log_api.py @@ -27,8 +27,12 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject -from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner import ( + LogCreateRequestInner, +) +from hatchet_sdk.clients.cloud_rest.models.log_list200_response import ( + LogList200Response, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -64,7 +68,7 @@ async def build_logs_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogLineList: + ) -> LogList200Response: """Get Build Logs Get the build logs for a specific build of a managed worker @@ -102,9 +106,9 @@ async def build_logs_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -135,7 +139,7 @@ async def build_logs_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LogLineList]: + ) -> ApiResponse[LogList200Response]: """Get Build Logs Get the build logs for a specific build of a managed worker @@ -173,9 +177,9 @@ async def build_logs_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -244,9 +248,9 @@ async def build_logs_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -313,7 +317,7 @@ async def log_create( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - event_object: Optional[List[EventObject]] = None, + log_create_request_inner: Optional[List[LogCreateRequestInner]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -332,8 +336,8 @@ async def log_create( :param tenant: The tenant id (required) :type tenant: str - :param event_object: - :type event_object: List[EventObject] + :param log_create_request_inner: + :type log_create_request_inner: List[LogCreateRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -358,7 +362,7 @@ async def log_create( _param = self._log_create_serialize( tenant=tenant, - event_object=event_object, + log_create_request_inner=log_create_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -367,8 +371,8 @@ async def log_create( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -388,7 +392,7 @@ async def log_create_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - event_object: Optional[List[EventObject]] = None, + log_create_request_inner: Optional[List[LogCreateRequestInner]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -407,8 +411,8 @@ async def log_create_with_http_info( :param tenant: The tenant id (required) :type tenant: str - :param event_object: - :type event_object: List[EventObject] + :param log_create_request_inner: + :type log_create_request_inner: List[LogCreateRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -433,7 +437,7 @@ async def log_create_with_http_info( _param = self._log_create_serialize( tenant=tenant, - event_object=event_object, + log_create_request_inner=log_create_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -442,8 +446,8 @@ async def log_create_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -463,7 +467,7 @@ async def log_create_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - event_object: Optional[List[EventObject]] = None, + log_create_request_inner: Optional[List[LogCreateRequestInner]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -482,8 +486,8 @@ async def log_create_without_preload_content( :param tenant: The tenant id (required) :type tenant: str - :param event_object: - :type event_object: List[EventObject] + :param log_create_request_inner: + :type log_create_request_inner: List[LogCreateRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -508,7 +512,7 @@ async def log_create_without_preload_content( _param = self._log_create_serialize( tenant=tenant, - event_object=event_object, + log_create_request_inner=log_create_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -517,8 +521,8 @@ async def log_create_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -528,7 +532,7 @@ async def log_create_without_preload_content( def _log_create_serialize( self, tenant, - event_object, + log_create_request_inner, _request_auth, _content_type, _headers, @@ -538,7 +542,7 @@ def _log_create_serialize( _host = None _collection_formats: Dict[str, str] = { - "EventObject": "", + "LogCreateRequestInner": "", } _path_params: Dict[str, str] = {} @@ -555,8 +559,8 @@ def _log_create_serialize( # process the header parameters # process the form parameters # process the body parameter - if event_object is not None: - _body_params = event_object + if log_create_request_inner is not None: + _body_params = log_create_request_inner # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -626,7 +630,7 @@ async def log_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogLineList: + ) -> LogList200Response: """List Logs Lists logs for a managed worker @@ -676,9 +680,9 @@ async def log_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -724,7 +728,7 @@ async def log_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LogLineList]: + ) -> ApiResponse[LogList200Response]: """List Logs Lists logs for a managed worker @@ -774,9 +778,9 @@ async def log_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -872,9 +876,9 @@ async def log_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogLineList", - "400": "APIErrors", - "403": "APIErrors", + "200": "LogList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py index 3adc95f6..840a93d4 100644 --- a/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py @@ -19,23 +19,29 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( - CreateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import ( + InfraAsCodeCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( - InfraAsCodeRequest, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ( + ManagedWorkerCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( - ManagedWorkerEventList, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response import ( + ManagedWorkerEventsList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( - RuntimeConfigActionsResponse, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response import ( + ManagedWorkerInstancesList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( - UpdateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response import ( + ManagedWorkerList200Response, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ( + ManagedWorkerList200ResponseRowsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_update_request import ( + ManagedWorkerUpdateRequest, +) +from hatchet_sdk.clients.cloud_rest.models.runtime_config_list_actions200_response import ( + RuntimeConfigListActions200Response, ) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -64,7 +70,7 @@ async def infra_as_code_create( description="The infra as code request id", ), ], - infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -83,8 +89,8 @@ async def infra_as_code_create( :param infra_as_code_request: The infra as code request id (required) :type infra_as_code_request: str - :param infra_as_code_request2: - :type infra_as_code_request2: InfraAsCodeRequest + :param infra_as_code_create_request: + :type infra_as_code_create_request: InfraAsCodeCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -109,7 +115,7 @@ async def infra_as_code_create( _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, - infra_as_code_request2=infra_as_code_request2, + infra_as_code_create_request=infra_as_code_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -118,8 +124,8 @@ async def infra_as_code_create( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -142,7 +148,7 @@ async def infra_as_code_create_with_http_info( description="The infra as code request id", ), ], - infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -161,8 +167,8 @@ async def infra_as_code_create_with_http_info( :param infra_as_code_request: The infra as code request id (required) :type infra_as_code_request: str - :param infra_as_code_request2: - :type infra_as_code_request2: InfraAsCodeRequest + :param infra_as_code_create_request: + :type infra_as_code_create_request: InfraAsCodeCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -187,7 +193,7 @@ async def infra_as_code_create_with_http_info( _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, - infra_as_code_request2=infra_as_code_request2, + infra_as_code_create_request=infra_as_code_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -196,8 +202,8 @@ async def infra_as_code_create_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -220,7 +226,7 @@ async def infra_as_code_create_without_preload_content( description="The infra as code request id", ), ], - infra_as_code_request2: Optional[InfraAsCodeRequest] = None, + infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -239,8 +245,8 @@ async def infra_as_code_create_without_preload_content( :param infra_as_code_request: The infra as code request id (required) :type infra_as_code_request: str - :param infra_as_code_request2: - :type infra_as_code_request2: InfraAsCodeRequest + :param infra_as_code_create_request: + :type infra_as_code_create_request: InfraAsCodeCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -265,7 +271,7 @@ async def infra_as_code_create_without_preload_content( _param = self._infra_as_code_create_serialize( infra_as_code_request=infra_as_code_request, - infra_as_code_request2=infra_as_code_request2, + infra_as_code_create_request=infra_as_code_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -274,8 +280,8 @@ async def infra_as_code_create_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": None, - "400": "APIErrors", - "403": "APIErrors", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -285,7 +291,7 @@ async def infra_as_code_create_without_preload_content( def _infra_as_code_create_serialize( self, infra_as_code_request, - infra_as_code_request2, + infra_as_code_create_request, _request_auth, _content_type, _headers, @@ -310,8 +316,8 @@ def _infra_as_code_create_serialize( # process the header parameters # process the form parameters # process the body parameter - if infra_as_code_request2 is not None: - _body_params = infra_as_code_request2 + if infra_as_code_create_request is not None: + _body_params = infra_as_code_create_request # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -355,7 +361,7 @@ async def managed_worker_create( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -367,15 +373,15 @@ async def managed_worker_create( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorker: + ) -> ManagedWorkerList200ResponseRowsInner: """Create Managed Worker Create a managed worker for the tenant :param tenant: The tenant id (required) :type tenant: str - :param create_managed_worker_request: - :type create_managed_worker_request: CreateManagedWorkerRequest + :param managed_worker_create_request: + :type managed_worker_create_request: ManagedWorkerCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -400,7 +406,7 @@ async def managed_worker_create( _param = self._managed_worker_create_serialize( tenant=tenant, - create_managed_worker_request=create_managed_worker_request, + managed_worker_create_request=managed_worker_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -408,9 +414,9 @@ async def managed_worker_create( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -430,7 +436,7 @@ async def managed_worker_create_with_http_info( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -442,15 +448,15 @@ async def managed_worker_create_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorker]: + ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]: """Create Managed Worker Create a managed worker for the tenant :param tenant: The tenant id (required) :type tenant: str - :param create_managed_worker_request: - :type create_managed_worker_request: CreateManagedWorkerRequest + :param managed_worker_create_request: + :type managed_worker_create_request: ManagedWorkerCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -475,7 +481,7 @@ async def managed_worker_create_with_http_info( _param = self._managed_worker_create_serialize( tenant=tenant, - create_managed_worker_request=create_managed_worker_request, + managed_worker_create_request=managed_worker_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -483,9 +489,9 @@ async def managed_worker_create_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -505,7 +511,7 @@ async def managed_worker_create_without_preload_content( min_length=36, strict=True, max_length=36, description="The tenant id" ), ], - create_managed_worker_request: Optional[CreateManagedWorkerRequest] = None, + managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -524,8 +530,8 @@ async def managed_worker_create_without_preload_content( :param tenant: The tenant id (required) :type tenant: str - :param create_managed_worker_request: - :type create_managed_worker_request: CreateManagedWorkerRequest + :param managed_worker_create_request: + :type managed_worker_create_request: ManagedWorkerCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -550,7 +556,7 @@ async def managed_worker_create_without_preload_content( _param = self._managed_worker_create_serialize( tenant=tenant, - create_managed_worker_request=create_managed_worker_request, + managed_worker_create_request=managed_worker_create_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -558,9 +564,9 @@ async def managed_worker_create_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -570,7 +576,7 @@ async def managed_worker_create_without_preload_content( def _managed_worker_create_serialize( self, tenant, - create_managed_worker_request, + managed_worker_create_request, _request_auth, _content_type, _headers, @@ -595,8 +601,8 @@ def _managed_worker_create_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_managed_worker_request is not None: - _body_params = create_managed_worker_request + if managed_worker_create_request is not None: + _body_params = managed_worker_create_request # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -654,7 +660,7 @@ async def managed_worker_delete( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorker: + ) -> ManagedWorkerList200ResponseRowsInner: """Delete Managed Worker Delete a managed worker for the tenant @@ -692,10 +698,10 @@ async def managed_worker_delete( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -729,7 +735,7 @@ async def managed_worker_delete_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorker]: + ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]: """Delete Managed Worker Delete a managed worker for the tenant @@ -767,10 +773,10 @@ async def managed_worker_delete_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -842,10 +848,10 @@ async def managed_worker_delete_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -926,7 +932,7 @@ async def managed_worker_events_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorkerEventList: + ) -> ManagedWorkerEventsList200Response: """Get Managed Worker Events Get events for a managed worker @@ -964,9 +970,9 @@ async def managed_worker_events_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerEventList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerEventsList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1000,7 +1006,7 @@ async def managed_worker_events_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorkerEventList]: + ) -> ApiResponse[ManagedWorkerEventsList200Response]: """Get Managed Worker Events Get events for a managed worker @@ -1038,9 +1044,9 @@ async def managed_worker_events_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerEventList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerEventsList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1112,9 +1118,9 @@ async def managed_worker_events_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerEventList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerEventsList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1195,7 +1201,7 @@ async def managed_worker_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorker: + ) -> ManagedWorkerList200ResponseRowsInner: """Get Managed Worker Get a managed worker for the tenant @@ -1233,10 +1239,10 @@ async def managed_worker_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1270,7 +1276,7 @@ async def managed_worker_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorker]: + ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]: """Get Managed Worker Get a managed worker for the tenant @@ -1308,10 +1314,10 @@ async def managed_worker_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1383,10 +1389,10 @@ async def managed_worker_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1467,7 +1473,7 @@ async def managed_worker_instances_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceList: + ) -> ManagedWorkerInstancesList200Response: """List Instances Get all instances for a managed worker @@ -1505,9 +1511,9 @@ async def managed_worker_instances_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerInstancesList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1541,7 +1547,7 @@ async def managed_worker_instances_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceList]: + ) -> ApiResponse[ManagedWorkerInstancesList200Response]: """List Instances Get all instances for a managed worker @@ -1579,9 +1585,9 @@ async def managed_worker_instances_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerInstancesList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1653,9 +1659,9 @@ async def managed_worker_instances_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "InstanceList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerInstancesList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1733,7 +1739,7 @@ async def managed_worker_list( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorkerList: + ) -> ManagedWorkerList200Response: """List Managed Workers Get all managed workers for the tenant @@ -1771,9 +1777,9 @@ async def managed_worker_list( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1804,7 +1810,7 @@ async def managed_worker_list_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorkerList]: + ) -> ApiResponse[ManagedWorkerList200Response]: """List Managed Workers Get all managed workers for the tenant @@ -1842,9 +1848,9 @@ async def managed_worker_list_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1913,9 +1919,9 @@ async def managed_worker_list_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorkerList", - "400": "APIErrors", - "403": "APIErrors", + "200": "ManagedWorkerList200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -1985,7 +1991,7 @@ async def managed_worker_update( description="The managed worker id", ), ], - update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1997,15 +2003,15 @@ async def managed_worker_update( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ManagedWorker: + ) -> ManagedWorkerList200ResponseRowsInner: """Update Managed Worker Update a managed worker for the tenant :param managed_worker: The managed worker id (required) :type managed_worker: str - :param update_managed_worker_request: - :type update_managed_worker_request: UpdateManagedWorkerRequest + :param managed_worker_update_request: + :type managed_worker_update_request: ManagedWorkerUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2030,7 +2036,7 @@ async def managed_worker_update( _param = self._managed_worker_update_serialize( managed_worker=managed_worker, - update_managed_worker_request=update_managed_worker_request, + managed_worker_update_request=managed_worker_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2038,10 +2044,10 @@ async def managed_worker_update( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2064,7 +2070,7 @@ async def managed_worker_update_with_http_info( description="The managed worker id", ), ], - update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2076,15 +2082,15 @@ async def managed_worker_update_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ManagedWorker]: + ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]: """Update Managed Worker Update a managed worker for the tenant :param managed_worker: The managed worker id (required) :type managed_worker: str - :param update_managed_worker_request: - :type update_managed_worker_request: UpdateManagedWorkerRequest + :param managed_worker_update_request: + :type managed_worker_update_request: ManagedWorkerUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2109,7 +2115,7 @@ async def managed_worker_update_with_http_info( _param = self._managed_worker_update_serialize( managed_worker=managed_worker, - update_managed_worker_request=update_managed_worker_request, + managed_worker_update_request=managed_worker_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2117,10 +2123,10 @@ async def managed_worker_update_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2143,7 +2149,7 @@ async def managed_worker_update_without_preload_content( description="The managed worker id", ), ], - update_managed_worker_request: Optional[UpdateManagedWorkerRequest] = None, + managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2162,8 +2168,8 @@ async def managed_worker_update_without_preload_content( :param managed_worker: The managed worker id (required) :type managed_worker: str - :param update_managed_worker_request: - :type update_managed_worker_request: UpdateManagedWorkerRequest + :param managed_worker_update_request: + :type managed_worker_update_request: ManagedWorkerUpdateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2188,7 +2194,7 @@ async def managed_worker_update_without_preload_content( _param = self._managed_worker_update_serialize( managed_worker=managed_worker, - update_managed_worker_request=update_managed_worker_request, + managed_worker_update_request=managed_worker_update_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2196,10 +2202,10 @@ async def managed_worker_update_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ManagedWorker", - "400": "APIErrors", - "403": "APIErrors", - "404": "APIErrors", + "200": "ManagedWorkerList200ResponseRowsInner", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", + "404": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2209,7 +2215,7 @@ async def managed_worker_update_without_preload_content( def _managed_worker_update_serialize( self, managed_worker, - update_managed_worker_request, + managed_worker_update_request, _request_auth, _content_type, _headers, @@ -2234,8 +2240,8 @@ def _managed_worker_update_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_managed_worker_request is not None: - _body_params = update_managed_worker_request + if managed_worker_update_request is not None: + _body_params = managed_worker_update_request # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( @@ -2293,7 +2299,7 @@ async def runtime_config_list_actions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RuntimeConfigActionsResponse: + ) -> RuntimeConfigListActions200Response: """Get Runtime Config Actions Get a list of runtime config actions for a managed worker @@ -2331,9 +2337,9 @@ async def runtime_config_list_actions( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RuntimeConfigActionsResponse", - "400": "APIErrors", - "403": "APIErrors", + "200": "RuntimeConfigListActions200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2367,7 +2373,7 @@ async def runtime_config_list_actions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RuntimeConfigActionsResponse]: + ) -> ApiResponse[RuntimeConfigListActions200Response]: """Get Runtime Config Actions Get a list of runtime config actions for a managed worker @@ -2405,9 +2411,9 @@ async def runtime_config_list_actions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RuntimeConfigActionsResponse", - "400": "APIErrors", - "403": "APIErrors", + "200": "RuntimeConfigListActions200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -2479,9 +2485,9 @@ async def runtime_config_list_actions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "RuntimeConfigActionsResponse", - "400": "APIErrors", - "403": "APIErrors", + "200": "RuntimeConfigListActions200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/metadata_api.py b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py index 1fa8e3c7..3eafac47 100644 --- a/hatchet_sdk/clients/cloud_rest/api/metadata_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/metadata_api.py @@ -19,7 +19,9 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata +from hatchet_sdk.clients.cloud_rest.models.metadata_get200_response import ( + MetadataGet200Response, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -49,7 +51,7 @@ async def metadata_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> APICloudMetadata: + ) -> MetadataGet200Response: """Get metadata Gets metadata for the Hatchet instance @@ -84,8 +86,8 @@ async def metadata_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APICloudMetadata", - "400": "APIErrors", + "200": "MetadataGet200Response", + "400": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -110,7 +112,7 @@ async def metadata_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[APICloudMetadata]: + ) -> ApiResponse[MetadataGet200Response]: """Get metadata Gets metadata for the Hatchet instance @@ -145,8 +147,8 @@ async def metadata_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APICloudMetadata", - "400": "APIErrors", + "200": "MetadataGet200Response", + "400": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -206,8 +208,8 @@ async def metadata_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "APICloudMetadata", - "400": "APIErrors", + "200": "MetadataGet200Response", + "400": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/metrics_api.py b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py index 34f8e684..872304d8 100644 --- a/hatchet_sdk/clients/cloud_rest/api/metrics_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/metrics_api.py @@ -20,7 +20,9 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner import ( + MetricsCpuGet200ResponseInner, +) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -65,7 +67,7 @@ async def metrics_cpu_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[SampleStream]: + ) -> List[MetricsCpuGet200ResponseInner]: """Get CPU Metrics Get CPU metrics for a managed worker @@ -109,9 +111,9 @@ async def metrics_cpu_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -151,7 +153,7 @@ async def metrics_cpu_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[SampleStream]]: + ) -> ApiResponse[List[MetricsCpuGet200ResponseInner]]: """Get CPU Metrics Get CPU metrics for a managed worker @@ -195,9 +197,9 @@ async def metrics_cpu_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -281,9 +283,9 @@ async def metrics_cpu_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -394,7 +396,7 @@ async def metrics_disk_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[SampleStream]: + ) -> List[MetricsCpuGet200ResponseInner]: """Get Disk Metrics Get disk metrics for a managed worker @@ -438,9 +440,9 @@ async def metrics_disk_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -480,7 +482,7 @@ async def metrics_disk_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[SampleStream]]: + ) -> ApiResponse[List[MetricsCpuGet200ResponseInner]]: """Get Disk Metrics Get disk metrics for a managed worker @@ -524,9 +526,9 @@ async def metrics_disk_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -610,9 +612,9 @@ async def metrics_disk_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -723,7 +725,7 @@ async def metrics_memory_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[SampleStream]: + ) -> List[MetricsCpuGet200ResponseInner]: """Get Memory Metrics Get memory metrics for a managed worker @@ -767,9 +769,9 @@ async def metrics_memory_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -809,7 +811,7 @@ async def metrics_memory_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[SampleStream]]: + ) -> ApiResponse[List[MetricsCpuGet200ResponseInner]]: """Get Memory Metrics Get memory metrics for a managed worker @@ -853,9 +855,9 @@ async def metrics_memory_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -939,9 +941,9 @@ async def metrics_memory_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "List[SampleStream]", - "400": "APIErrors", - "403": "APIErrors", + "200": "List[MetricsCpuGet200ResponseInner]", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/tenant_api.py b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py index 0133ba61..ff558e41 100644 --- a/hatchet_sdk/clients/cloud_rest/api/tenant_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/tenant_api.py @@ -19,8 +19,8 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( - TenantBillingState, +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response import ( + TenantBillingStateGet200Response, ) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -57,7 +57,7 @@ async def tenant_billing_state_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TenantBillingState: + ) -> TenantBillingStateGet200Response: """Get the billing state for a tenant Gets the billing state for a tenant @@ -95,10 +95,10 @@ async def tenant_billing_state_get( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantBillingState", - "400": "APIErrors", - "403": "APIError", - "405": "APIErrors", + "200": "TenantBillingStateGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400ResponseErrorsInner", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -129,7 +129,7 @@ async def tenant_billing_state_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TenantBillingState]: + ) -> ApiResponse[TenantBillingStateGet200Response]: """Get the billing state for a tenant Gets the billing state for a tenant @@ -167,10 +167,10 @@ async def tenant_billing_state_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantBillingState", - "400": "APIErrors", - "403": "APIError", - "405": "APIErrors", + "200": "TenantBillingStateGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400ResponseErrorsInner", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -239,10 +239,10 @@ async def tenant_billing_state_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TenantBillingState", - "400": "APIErrors", - "403": "APIError", - "405": "APIErrors", + "200": "TenantBillingStateGet200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400ResponseErrorsInner", + "405": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/api/workflow_api.py b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py index 6f6b659d..9deb7400 100644 --- a/hatchet_sdk/clients/cloud_rest/api/workflow_api.py +++ b/hatchet_sdk/clients/cloud_rest/api/workflow_api.py @@ -20,8 +20,8 @@ from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( - WorkflowRunEventsMetricsCounts, +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response import ( + WorkflowRunEventsGetMetrics200Response, ) from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType @@ -66,7 +66,7 @@ async def workflow_run_events_get_metrics( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> WorkflowRunEventsMetricsCounts: + ) -> WorkflowRunEventsGetMetrics200Response: """Get workflow runs Get a minute by minute breakdown of workflow run metrics for a tenant @@ -110,9 +110,9 @@ async def workflow_run_events_get_metrics( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunEventsMetricsCounts", - "400": "APIErrors", - "403": "APIErrors", + "200": "WorkflowRunEventsGetMetrics200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -151,7 +151,7 @@ async def workflow_run_events_get_metrics_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[WorkflowRunEventsMetricsCounts]: + ) -> ApiResponse[WorkflowRunEventsGetMetrics200Response]: """Get workflow runs Get a minute by minute breakdown of workflow run metrics for a tenant @@ -195,9 +195,9 @@ async def workflow_run_events_get_metrics_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunEventsMetricsCounts", - "400": "APIErrors", - "403": "APIErrors", + "200": "WorkflowRunEventsGetMetrics200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout @@ -280,9 +280,9 @@ async def workflow_run_events_get_metrics_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkflowRunEventsMetricsCounts", - "400": "APIErrors", - "403": "APIErrors", + "200": "WorkflowRunEventsGetMetrics200Response", + "400": "MetadataGet400Response", + "403": "MetadataGet400Response", } response_data = await self.api_client.call_api( *_param, _request_timeout=_request_timeout diff --git a/hatchet_sdk/clients/cloud_rest/models/__init__.py b/hatchet_sdk/clients/cloud_rest/models/__init__.py index fd04062b..6228df77 100644 --- a/hatchet_sdk/clients/cloud_rest/models/__init__.py +++ b/hatchet_sdk/clients/cloud_rest/models/__init__.py @@ -14,99 +14,144 @@ # import models into model package -from hatchet_sdk.clients.cloud_rest.models.api_cloud_metadata import APICloudMetadata -from hatchet_sdk.clients.cloud_rest.models.api_error import APIError -from hatchet_sdk.clients.cloud_rest.models.api_errors import APIErrors -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta from hatchet_sdk.clients.cloud_rest.models.billing_portal_link_get200_response import ( BillingPortalLinkGet200Response, ) -from hatchet_sdk.clients.cloud_rest.models.build import Build -from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep -from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon -from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( - CreateBuildStepRequest, +from hatchet_sdk.clients.cloud_rest.models.build_get200_response import ( + BuildGet200Response, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( - CreateManagedWorkerBuildConfigRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_branches200_response_inner import ( + GithubAppListBranches200ResponseInner, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_request import ( - CreateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response import ( + GithubAppListInstallations200Response, ) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, ) -from hatchet_sdk.clients.cloud_rest.models.event_object import EventObject -from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent -from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly -from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp -from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( - GithubAppInstallation, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner import ( + GithubAppListInstallations200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.github_branch import GithubBranch -from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo -from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( - InfraAsCodeRequest, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, ) -from hatchet_sdk.clients.cloud_rest.models.instance import Instance -from hatchet_sdk.clients.cloud_rest.models.instance_list import InstanceList -from hatchet_sdk.clients.cloud_rest.models.list_github_app_installations_response import ( - ListGithubAppInstallationsResponse, +from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import ( + GithubAppListRepos200ResponseInner, ) -from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine -from hatchet_sdk.clients.cloud_rest.models.log_line_list import LogLineList -from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( - ManagedWorkerBuildConfig, +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import ( + InfraAsCodeCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( - ManagedWorkerEvent, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner import ( + LogCreateRequestInner, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_list import ( - ManagedWorkerEventList, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import ( + LogCreateRequestInnerEvent, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( - ManagedWorkerEventStatus, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import ( + LogCreateRequestInnerFly, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list import ManagedWorkerList -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import ( + LogCreateRequestInnerFlyApp, ) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( - ManagedWorkerRuntimeConfig, +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import ( + LogCreateRequestInnerLog, ) -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse -from hatchet_sdk.clients.cloud_rest.models.runtime_config_actions_response import ( - RuntimeConfigActionsResponse, +from hatchet_sdk.clients.cloud_rest.models.log_list200_response import ( + LogList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( - SampleHistogramPair, +from hatchet_sdk.clients.cloud_rest.models.log_list200_response_rows_inner import ( + LogList200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.sample_stream import SampleStream -from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state import ( - TenantBillingState, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ( + ManagedWorkerCreateRequest, ) -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( - TenantPaymentMethod, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ( + ManagedWorkerCreateRequestBuildConfig, ) -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( - TenantSubscriptionStatus, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import ( + ManagedWorkerCreateRequestBuildConfigStepsInner, ) -from hatchet_sdk.clients.cloud_rest.models.update_managed_worker_request import ( - UpdateManagedWorkerRequest, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, ) -from hatchet_sdk.clients.cloud_rest.models.update_tenant_subscription import ( - UpdateTenantSubscription, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response import ( + ManagedWorkerEventsList200Response, ) -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( - WorkflowRunEventsMetric, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import ( + ManagedWorkerEventsList200ResponseRowsInner, ) -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metrics_counts import ( - WorkflowRunEventsMetricsCounts, +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response import ( + ManagedWorkerInstancesList200Response, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response_rows_inner import ( + ManagedWorkerInstancesList200ResponseRowsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response import ( + ManagedWorkerList200Response, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ( + ManagedWorkerList200ResponseRowsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import ( + ManagedWorkerList200ResponseRowsInnerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import ( + ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import ( + ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_update_request import ( + ManagedWorkerUpdateRequest, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get200_response import ( + MetadataGet200Response, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response import ( + MetadataGet400Response, +) +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response_errors_inner import ( + MetadataGet400ResponseErrorsInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner import ( + MetricsCpuGet200ResponseInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInner, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogram, +) +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner, +) +from hatchet_sdk.clients.cloud_rest.models.runtime_config_list_actions200_response import ( + RuntimeConfigListActions200Response, +) +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert200_response import ( + SubscriptionUpsert200Response, +) +from hatchet_sdk.clients.cloud_rest.models.subscription_upsert_request import ( + SubscriptionUpsertRequest, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response import ( + TenantBillingStateGet200Response, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_coupons_inner import ( + TenantBillingStateGet200ResponseCouponsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_payment_methods_inner import ( + TenantBillingStateGet200ResponsePaymentMethodsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_plans_inner import ( + TenantBillingStateGet200ResponsePlansInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_subscription import ( + TenantBillingStateGet200ResponseSubscription, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response import ( + WorkflowRunEventsGetMetrics200Response, +) +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response_results_inner import ( + WorkflowRunEventsGetMetrics200ResponseResultsInner, ) diff --git a/hatchet_sdk/clients/cloud_rest/models/build.py b/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py similarity index 64% rename from hatchet_sdk/clients/cloud_rest/models/build.py rename to hatchet_sdk/clients/cloud_rest/models/build_get200_response.py index 3a44e882..eceffc64 100644 --- a/hatchet_sdk/clients/cloud_rest/models/build.py +++ b/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py @@ -13,40 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta - - -class Build(BaseModel): +class BuildGet200Response(BaseModel): """ - Build - """ # noqa: E501 - - metadata: Optional[APIResourceMeta] = None + BuildGet200Response + """ # noqa: E501 + metadata: Optional[GithubAppListInstallations200ResponseRowsInnerMetadata] = None status: StrictStr status_detail: Optional[StrictStr] = Field(default=None, alias="statusDetail") create_time: datetime = Field(alias="createTime") start_time: Optional[datetime] = Field(default=None, alias="startTime") finish_time: Optional[datetime] = Field(default=None, alias="finishTime") build_config_id: StrictStr = Field(alias="buildConfigId") - __properties: ClassVar[List[str]] = [ - "metadata", - "status", - "statusDetail", - "createTime", - "startTime", - "finishTime", - "buildConfigId", - ] + __properties: ClassVar[List[str]] = ["metadata", "status", "statusDetail", "createTime", "startTime", "finishTime", "buildConfigId"] model_config = ConfigDict( populate_by_name=True, @@ -54,6 +43,7 @@ class Build(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Build from a JSON string""" + """Create an instance of BuildGet200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -78,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,31 +78,27 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Build from a dict""" + """Create an instance of BuildGet200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "status": obj.get("status"), - "statusDetail": obj.get("statusDetail"), - "createTime": obj.get("createTime"), - "startTime": obj.get("startTime"), - "finishTime": obj.get("finishTime"), - "buildConfigId": obj.get("buildConfigId"), - } - ) + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "status": obj.get("status"), + "statusDetail": obj.get("statusDetail"), + "createTime": obj.get("createTime"), + "startTime": obj.get("startTime"), + "finishTime": obj.get("finishTime"), + "buildConfigId": obj.get("buildConfigId") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon.py b/hatchet_sdk/clients/cloud_rest/models/coupon.py deleted file mode 100644 index af0c0b76..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/coupon.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -import pprint -import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set, Union - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr -from typing_extensions import Self - -from hatchet_sdk.clients.cloud_rest.models.coupon_frequency import CouponFrequency - - -class Coupon(BaseModel): - """ - Coupon - """ # noqa: E501 - - name: StrictStr = Field(description="The name of the coupon.") - amount_cents: Optional[StrictInt] = Field( - default=None, description="The amount off of the coupon." - ) - amount_cents_remaining: Optional[StrictInt] = Field( - default=None, description="The amount remaining on the coupon." - ) - amount_currency: Optional[StrictStr] = Field( - default=None, description="The currency of the coupon." - ) - frequency: CouponFrequency = Field(description="The frequency of the coupon.") - frequency_duration: Optional[StrictInt] = Field( - default=None, description="The frequency duration of the coupon." - ) - frequency_duration_remaining: Optional[StrictInt] = Field( - default=None, description="The frequency duration remaining of the coupon." - ) - percent: Optional[Union[StrictFloat, StrictInt]] = Field( - default=None, description="The percentage off of the coupon." - ) - __properties: ClassVar[List[str]] = [ - "name", - "amount_cents", - "amount_cents_remaining", - "amount_currency", - "frequency", - "frequency_duration", - "frequency_duration_remaining", - "percent", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Coupon from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Coupon from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "name": obj.get("name"), - "amount_cents": obj.get("amount_cents"), - "amount_cents_remaining": obj.get("amount_cents_remaining"), - "amount_currency": obj.get("amount_currency"), - "frequency": obj.get("frequency"), - "frequency_duration": obj.get("frequency_duration"), - "frequency_duration_remaining": obj.get("frequency_duration_remaining"), - "percent": obj.get("percent"), - } - ) - return _obj diff --git a/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py b/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py deleted file mode 100644 index 79f8f74f..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/coupon_frequency.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -from enum import Enum - -from typing_extensions import Self - - -class CouponFrequency(str, Enum): - """ - CouponFrequency - """ - - """ - allowed enum values - """ - ONCE = "once" - RECURRING = "recurring" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of CouponFrequency from a JSON string""" - return cls(json.loads(json_str)) diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py b/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py deleted file mode 100644 index 89bc9586..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_runtime_config_request.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -import pprint -import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, -) - - -class CreateManagedWorkerRuntimeConfigRequest(BaseModel): - """ - CreateManagedWorkerRuntimeConfigRequest - """ # noqa: E501 - - num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( - alias="numReplicas" - ) - region: Optional[ManagedWorkerRegion] = Field( - default=None, description="The region to deploy the worker to" - ) - cpu_kind: StrictStr = Field( - description="The kind of CPU to use for the worker", alias="cpuKind" - ) - cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field( - description="The number of CPUs to use for the worker" - ) - memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field( - description="The amount of memory in MB to use for the worker", alias="memoryMb" - ) - actions: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ - "numReplicas", - "region", - "cpuKind", - "cpus", - "memoryMb", - "actions", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateManagedWorkerRuntimeConfigRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateManagedWorkerRuntimeConfigRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "numReplicas": obj.get("numReplicas"), - "region": obj.get("region"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "actions": obj.get("actions"), - } - ) - return _obj diff --git a/hatchet_sdk/clients/cloud_rest/models/github_branch.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py similarity index 77% rename from hatchet_sdk/clients/cloud_rest/models/github_branch.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py index 16501da3..32cf58cf 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_branch.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class GithubBranch(BaseModel): +class GithubAppListBranches200ResponseInner(BaseModel): """ - GithubBranch - """ # noqa: E501 - + GithubAppListBranches200ResponseInner + """ # noqa: E501 branch_name: StrictStr is_default: StrictBool __properties: ClassVar[List[str]] = ["branch_name", "is_default"] @@ -38,6 +36,7 @@ class GithubBranch(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GithubBranch from a JSON string""" + """Create an instance of GithubAppListBranches200ResponseInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,14 +73,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GithubBranch from a dict""" + """Create an instance of GithubAppListBranches200ResponseInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"branch_name": obj.get("branch_name"), "is_default": obj.get("is_default")} - ) + _obj = cls.model_validate({ + "branch_name": obj.get("branch_name"), + "is_default": obj.get("is_default") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/instance_list.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py similarity index 64% rename from hatchet_sdk/clients/cloud_rest/models/instance_list.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py index 9a8b1bf8..b3a3c094 100644 --- a/hatchet_sdk/clients/cloud_rest/models/instance_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner import GithubAppListInstallations200ResponseRowsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.instance import Instance -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse - - -class InstanceList(BaseModel): +class GithubAppListInstallations200Response(BaseModel): """ - InstanceList - """ # noqa: E501 - - pagination: Optional[PaginationResponse] = None - rows: Optional[List[Instance]] = None + GithubAppListInstallations200Response + """ # noqa: E501 + pagination: GithubAppListInstallations200ResponsePagination + rows: List[GithubAppListInstallations200ResponseRowsInner] __properties: ClassVar[List[str]] = ["pagination", "rows"] model_config = ConfigDict( @@ -41,6 +38,7 @@ class InstanceList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -52,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceList from a JSON string""" + """Create an instance of GithubAppListInstallations200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -74,37 +73,29 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceList from a dict""" + """Create an instance of GithubAppListInstallations200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [Instance.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [GithubAppListInstallations200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/pagination_response.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py similarity index 70% rename from hatchet_sdk/clients/cloud_rest/models/pagination_response.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py index 2994dee9..8957c4b0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/pagination_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py @@ -13,28 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class PaginationResponse(BaseModel): +class GithubAppListInstallations200ResponsePagination(BaseModel): """ - PaginationResponse - """ # noqa: E501 - - current_page: Optional[StrictInt] = Field( - default=None, description="the current page" - ) + GithubAppListInstallations200ResponsePagination + """ # noqa: E501 + current_page: Optional[StrictInt] = Field(default=None, description="the current page") next_page: Optional[StrictInt] = Field(default=None, description="the next page") - num_pages: Optional[StrictInt] = Field( - default=None, description="the total number of pages for listing" - ) + num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] model_config = ConfigDict( @@ -43,6 +37,7 @@ class PaginationResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PaginationResponse from a JSON string""" + """Create an instance of GithubAppListInstallations200ResponsePagination from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,18 +74,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PaginationResponse from a dict""" + """Create an instance of GithubAppListInstallations200ResponsePagination from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "current_page": obj.get("current_page"), - "next_page": obj.get("next_page"), - "num_pages": obj.get("num_pages"), - } - ) + _obj = cls.model_validate({ + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py similarity index 62% rename from hatchet_sdk/clients/cloud_rest/models/github_app_installation.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py index f8f533fa..1cc72950 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_installation.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py @@ -13,33 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta - - -class GithubAppInstallation(BaseModel): +class GithubAppListInstallations200ResponseRowsInner(BaseModel): """ - GithubAppInstallation - """ # noqa: E501 - - metadata: APIResourceMeta + GithubAppListInstallations200ResponseRowsInner + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata installation_settings_url: StrictStr account_name: StrictStr account_avatar_url: StrictStr - __properties: ClassVar[List[str]] = [ - "metadata", - "installation_settings_url", - "account_name", - "account_avatar_url", - ] + __properties: ClassVar[List[str]] = ["metadata", "installation_settings_url", "account_name", "account_avatar_url"] model_config = ConfigDict( populate_by_name=True, @@ -47,6 +39,7 @@ class GithubAppInstallation(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -58,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GithubAppInstallation from a JSON string""" + """Create an instance of GithubAppListInstallations200ResponseRowsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,28 +74,24 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GithubAppInstallation from a dict""" + """Create an instance of GithubAppListInstallations200ResponseRowsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "installation_settings_url": obj.get("installation_settings_url"), - "account_name": obj.get("account_name"), - "account_avatar_url": obj.get("account_avatar_url"), - } - ) + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "installation_settings_url": obj.get("installation_settings_url"), + "account_name": obj.get("account_name"), + "account_avatar_url": obj.get("account_avatar_url") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py similarity index 66% rename from hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py index bb8ad457..e3da637a 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_resource_meta.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py @@ -13,31 +13,24 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self -class APIResourceMeta(BaseModel): +class GithubAppListInstallations200ResponseRowsInnerMetadata(BaseModel): """ - APIResourceMeta - """ # noqa: E501 - - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( - description="the id of this resource, in UUID format" - ) - created_at: datetime = Field( - description="the time that this resource was created", alias="createdAt" - ) - updated_at: datetime = Field( - description="the time that this resource was last updated", alias="updatedAt" - ) + GithubAppListInstallations200ResponseRowsInnerMetadata + """ # noqa: E501 + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") + created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") + updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] model_config = ConfigDict( @@ -46,6 +39,7 @@ class APIResourceMeta(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -57,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of APIResourceMeta from a JSON string""" + """Create an instance of GithubAppListInstallations200ResponseRowsInnerMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,18 +76,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of APIResourceMeta from a dict""" + """Create an instance of GithubAppListInstallations200ResponseRowsInnerMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "createdAt": obj.get("createdAt"), - "updatedAt": obj.get("updatedAt"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/github_repo.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py similarity index 78% rename from hatchet_sdk/clients/cloud_rest/models/github_repo.py rename to hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py index 3bc4d179..4c221155 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_repo.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class GithubRepo(BaseModel): +class GithubAppListRepos200ResponseInner(BaseModel): """ - GithubRepo - """ # noqa: E501 - + GithubAppListRepos200ResponseInner + """ # noqa: E501 repo_owner: StrictStr repo_name: StrictStr __properties: ClassVar[List[str]] = ["repo_owner", "repo_name"] @@ -38,6 +36,7 @@ class GithubRepo(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GithubRepo from a JSON string""" + """Create an instance of GithubAppListRepos200ResponseInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,14 +73,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GithubRepo from a dict""" + """Create an instance of GithubAppListRepos200ResponseInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"repo_owner": obj.get("repo_owner"), "repo_name": obj.get("repo_name")} - ) + _obj = cls.model_validate({ + "repo_owner": obj.get("repo_owner"), + "repo_name": obj.get("repo_name") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py similarity index 68% rename from hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py rename to hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py index 4d97db73..0d12e172 100644 --- a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py @@ -13,28 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) - - -class InfraAsCodeRequest(BaseModel): +class InfraAsCodeCreateRequest(BaseModel): """ - InfraAsCodeRequest - """ # noqa: E501 - - runtime_configs: List[CreateManagedWorkerRuntimeConfigRequest] = Field( - alias="runtimeConfigs" - ) + InfraAsCodeCreateRequest + """ # noqa: E501 + runtime_configs: List[ManagedWorkerCreateRequestRuntimeConfig] = Field(alias="runtimeConfigs") __properties: ClassVar[List[str]] = ["runtimeConfigs"] model_config = ConfigDict( @@ -43,6 +36,7 @@ class InfraAsCodeRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InfraAsCodeRequest from a JSON string""" + """Create an instance of InfraAsCodeCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,28 +75,21 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict["runtimeConfigs"] = _items + _dict['runtimeConfigs'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InfraAsCodeRequest from a dict""" + """Create an instance of InfraAsCodeCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "runtimeConfigs": ( - [ - CreateManagedWorkerRuntimeConfigRequest.from_dict(_item) - for _item in obj["runtimeConfigs"] - ] - if obj.get("runtimeConfigs") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "runtimeConfigs": [ManagedWorkerCreateRequestRuntimeConfig.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py similarity index 57% rename from hatchet_sdk/clients/cloud_rest/models/event_object.py rename to hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py index 01c2c9b2..06a2044b 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py @@ -13,40 +13,30 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import LogCreateRequestInnerEvent +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import LogCreateRequestInnerFly +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import LogCreateRequestInnerLog +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.event_object_event import EventObjectEvent -from hatchet_sdk.clients.cloud_rest.models.event_object_fly import EventObjectFly -from hatchet_sdk.clients.cloud_rest.models.event_object_log import EventObjectLog - - -class EventObject(BaseModel): +class LogCreateRequestInner(BaseModel): """ - EventObject - """ # noqa: E501 - - event: Optional[EventObjectEvent] = None - fly: Optional[EventObjectFly] = None + LogCreateRequestInner + """ # noqa: E501 + event: Optional[LogCreateRequestInnerEvent] = None + fly: Optional[LogCreateRequestInnerFly] = None host: Optional[StrictStr] = None - log: Optional[EventObjectLog] = None + log: Optional[LogCreateRequestInnerLog] = None message: Optional[StrictStr] = None timestamp: Optional[datetime] = None - __properties: ClassVar[List[str]] = [ - "event", - "fly", - "host", - "log", - "message", - "timestamp", - ] + __properties: ClassVar[List[str]] = ["event", "fly", "host", "log", "message", "timestamp"] model_config = ConfigDict( populate_by_name=True, @@ -54,6 +44,7 @@ class EventObject(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -65,7 +56,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EventObject from a JSON string""" + """Create an instance of LogCreateRequestInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -78,7 +69,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -87,44 +79,32 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of event if self.event: - _dict["event"] = self.event.to_dict() + _dict['event'] = self.event.to_dict() # override the default output from pydantic by calling `to_dict()` of fly if self.fly: - _dict["fly"] = self.fly.to_dict() + _dict['fly'] = self.fly.to_dict() # override the default output from pydantic by calling `to_dict()` of log if self.log: - _dict["log"] = self.log.to_dict() + _dict['log'] = self.log.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EventObject from a dict""" + """Create an instance of LogCreateRequestInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "event": ( - EventObjectEvent.from_dict(obj["event"]) - if obj.get("event") is not None - else None - ), - "fly": ( - EventObjectFly.from_dict(obj["fly"]) - if obj.get("fly") is not None - else None - ), - "host": obj.get("host"), - "log": ( - EventObjectLog.from_dict(obj["log"]) - if obj.get("log") is not None - else None - ), - "message": obj.get("message"), - "timestamp": obj.get("timestamp"), - } - ) + _obj = cls.model_validate({ + "event": LogCreateRequestInnerEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, + "fly": LogCreateRequestInnerFly.from_dict(obj["fly"]) if obj.get("fly") is not None else None, + "host": obj.get("host"), + "log": LogCreateRequestInnerLog.from_dict(obj["log"]) if obj.get("log") is not None else None, + "message": obj.get("message"), + "timestamp": obj.get("timestamp") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_event.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py similarity index 80% rename from hatchet_sdk/clients/cloud_rest/models/event_object_event.py rename to hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py index 6d5154f1..ad98e808 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_event.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class EventObjectEvent(BaseModel): +class LogCreateRequestInnerEvent(BaseModel): """ - EventObjectEvent - """ # noqa: E501 - + LogCreateRequestInnerEvent + """ # noqa: E501 provider: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["provider"] @@ -37,6 +35,7 @@ class EventObjectEvent(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -48,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EventObjectEvent from a JSON string""" + """Create an instance of LogCreateRequestInnerEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,12 +72,16 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EventObjectEvent from a dict""" + """Create an instance of LogCreateRequestInnerEvent from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"provider": obj.get("provider")}) + _obj = cls.model_validate({ + "provider": obj.get("provider") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py similarity index 72% rename from hatchet_sdk/clients/cloud_rest/models/event_object_fly.py rename to hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py index 3cbb7843..a2e2895f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_fly.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import LogCreateRequestInnerFlyApp +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.event_object_fly_app import EventObjectFlyApp - - -class EventObjectFly(BaseModel): +class LogCreateRequestInnerFly(BaseModel): """ - EventObjectFly - """ # noqa: E501 - - app: Optional[EventObjectFlyApp] = None + LogCreateRequestInnerFly + """ # noqa: E501 + app: Optional[LogCreateRequestInnerFlyApp] = None region: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["app", "region"] @@ -40,6 +37,7 @@ class EventObjectFly(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -51,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EventObjectFly from a JSON string""" + """Create an instance of LogCreateRequestInnerFly from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,26 +72,22 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict["app"] = self.app.to_dict() + _dict['app'] = self.app.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EventObjectFly from a dict""" + """Create an instance of LogCreateRequestInnerFly from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "app": ( - EventObjectFlyApp.from_dict(obj["app"]) - if obj.get("app") is not None - else None - ), - "region": obj.get("region"), - } - ) + _obj = cls.model_validate({ + "app": LogCreateRequestInnerFlyApp.from_dict(obj["app"]) if obj.get("app") is not None else None, + "region": obj.get("region") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py similarity index 79% rename from hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py rename to hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py index 3f7b87a0..48d25997 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_fly_app.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class EventObjectFlyApp(BaseModel): +class LogCreateRequestInnerFlyApp(BaseModel): """ - EventObjectFlyApp - """ # noqa: E501 - + LogCreateRequestInnerFlyApp + """ # noqa: E501 instance: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["instance", "name"] @@ -38,6 +36,7 @@ class EventObjectFlyApp(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EventObjectFlyApp from a JSON string""" + """Create an instance of LogCreateRequestInnerFlyApp from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -62,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,14 +73,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EventObjectFlyApp from a dict""" + """Create an instance of LogCreateRequestInnerFlyApp from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"instance": obj.get("instance"), "name": obj.get("name")} - ) + _obj = cls.model_validate({ + "instance": obj.get("instance"), + "name": obj.get("name") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/event_object_log.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py similarity index 80% rename from hatchet_sdk/clients/cloud_rest/models/event_object_log.py rename to hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py index b3d93b83..2d47f66f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/event_object_log.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class EventObjectLog(BaseModel): +class LogCreateRequestInnerLog(BaseModel): """ - EventObjectLog - """ # noqa: E501 - + LogCreateRequestInnerLog + """ # noqa: E501 level: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["level"] @@ -37,6 +35,7 @@ class EventObjectLog(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -48,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EventObjectLog from a JSON string""" + """Create an instance of LogCreateRequestInnerLog from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,12 +72,16 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EventObjectLog from a dict""" + """Create an instance of LogCreateRequestInnerLog from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"level": obj.get("level")}) + _obj = cls.model_validate({ + "level": obj.get("level") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line_list.py b/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py similarity index 66% rename from hatchet_sdk/clients/cloud_rest/models/log_line_list.py rename to hatchet_sdk/clients/cloud_rest/models/log_list200_response.py index 7ddf7cd3..3b5555fc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_line_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination +from hatchet_sdk.clients.cloud_rest.models.log_list200_response_rows_inner import LogList200ResponseRowsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.log_line import LogLine -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse - - -class LogLineList(BaseModel): +class LogList200Response(BaseModel): """ - LogLineList - """ # noqa: E501 - - rows: Optional[List[LogLine]] = None - pagination: Optional[PaginationResponse] = None + LogList200Response + """ # noqa: E501 + rows: Optional[List[LogList200ResponseRowsInner]] = None + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] model_config = ConfigDict( @@ -41,6 +38,7 @@ class LogLineList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -52,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LogLineList from a JSON string""" + """Create an instance of LogList200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,33 +77,25 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LogLineList from a dict""" + """Create an instance of LogList200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "rows": ( - [LogLine.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "rows": [LogList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/log_line.py b/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py similarity index 78% rename from hatchet_sdk/clients/cloud_rest/models/log_line.py rename to hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py index c571f1a7..33cc127e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_line.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py @@ -13,22 +13,20 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class LogLine(BaseModel): +class LogList200ResponseRowsInner(BaseModel): """ - LogLine - """ # noqa: E501 - + LogList200ResponseRowsInner + """ # noqa: E501 timestamp: datetime instance: StrictStr line: StrictStr @@ -40,6 +38,7 @@ class LogLine(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -51,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of LogLine from a JSON string""" + """Create an instance of LogList200ResponseRowsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,18 +75,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LogLine from a dict""" + """Create an instance of LogList200ResponseRowsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "timestamp": obj.get("timestamp"), - "instance": obj.get("instance"), - "line": obj.get("line"), - } - ) + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "instance": obj.get("instance"), + "line": obj.get("line") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py similarity index 54% rename from hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py index 6aa9c562..87f31abe 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py @@ -13,45 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ManagedWorkerCreateRequestBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( - CreateManagedWorkerBuildConfigRequest, -) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) - - -class CreateManagedWorkerRequest(BaseModel): +class ManagedWorkerCreateRequest(BaseModel): """ - CreateManagedWorkerRequest - """ # noqa: E501 - + ManagedWorkerCreateRequest + """ # noqa: E501 name: StrictStr - build_config: CreateManagedWorkerBuildConfigRequest = Field(alias="buildConfig") - env_vars: Dict[str, StrictStr] = Field( - description="A map of environment variables to set for the worker", - alias="envVars", - ) + build_config: ManagedWorkerCreateRequestBuildConfig = Field(alias="buildConfig") + env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") is_iac: StrictBool = Field(alias="isIac") - runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field( - default=None, alias="runtimeConfig" - ) - __properties: ClassVar[List[str]] = [ - "name", - "buildConfig", - "envVars", - "isIac", - "runtimeConfig", - ] + runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(default=None, alias="runtimeConfig") + __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] model_config = ConfigDict( populate_by_name=True, @@ -59,6 +41,7 @@ class CreateManagedWorkerRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -70,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateManagedWorkerRequest from a JSON string""" + """Create an instance of ManagedWorkerCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -92,37 +76,27 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict["buildConfig"] = self.build_config.to_dict() + _dict['buildConfig'] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict["runtimeConfig"] = self.runtime_config.to_dict() + _dict['runtimeConfig'] = self.runtime_config.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateManagedWorkerRequest from a dict""" + """Create an instance of ManagedWorkerCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "buildConfig": ( - CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) - if obj.get("buildConfig") is not None - else None - ), - "isIac": obj.get("isIac"), - "runtimeConfig": ( - CreateManagedWorkerRuntimeConfigRequest.from_dict( - obj["runtimeConfig"] - ) - if obj.get("runtimeConfig") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "buildConfig": ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfig": ManagedWorkerCreateRequestRuntimeConfig.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py similarity index 60% rename from hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py index 66226cda..7e02fecc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_managed_worker_build_config_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py @@ -13,39 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - -from hatchet_sdk.clients.cloud_rest.models.create_build_step_request import ( - CreateBuildStepRequest, -) - +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import ManagedWorkerCreateRequestBuildConfigStepsInner +from typing import Optional, Set +from typing_extensions import Self -class CreateManagedWorkerBuildConfigRequest(BaseModel): +class ManagedWorkerCreateRequestBuildConfig(BaseModel): """ - CreateManagedWorkerBuildConfigRequest - """ # noqa: E501 - - github_installation_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36) - ] = Field(alias="githubInstallationId") + ManagedWorkerCreateRequestBuildConfig + """ # noqa: E501 + github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") github_repository_owner: StrictStr = Field(alias="githubRepositoryOwner") github_repository_name: StrictStr = Field(alias="githubRepositoryName") github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") - steps: List[CreateBuildStepRequest] - __properties: ClassVar[List[str]] = [ - "githubInstallationId", - "githubRepositoryOwner", - "githubRepositoryName", - "githubRepositoryBranch", - "steps", - ] + steps: List[ManagedWorkerCreateRequestBuildConfigStepsInner] + __properties: ClassVar[List[str]] = ["githubInstallationId", "githubRepositoryOwner", "githubRepositoryName", "githubRepositoryBranch", "steps"] model_config = ConfigDict( populate_by_name=True, @@ -53,6 +41,7 @@ class CreateManagedWorkerBuildConfigRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateManagedWorkerBuildConfigRequest from a JSON string""" + """Create an instance of ManagedWorkerCreateRequestBuildConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -90,29 +80,25 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict["steps"] = _items + _dict['steps'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateManagedWorkerBuildConfigRequest from a dict""" + """Create an instance of ManagedWorkerCreateRequestBuildConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepositoryOwner": obj.get("githubRepositoryOwner"), - "githubRepositoryName": obj.get("githubRepositoryName"), - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": ( - [CreateBuildStepRequest.from_dict(_item) for _item in obj["steps"]] - if obj.get("steps") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepositoryOwner": obj.get("githubRepositoryOwner"), + "githubRepositoryName": obj.get("githubRepositoryName"), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": [ManagedWorkerCreateRequestBuildConfigStepsInner.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py similarity index 69% rename from hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py index 4d4fe075..32fefa07 100644 --- a/hatchet_sdk/clients/cloud_rest/models/create_build_step_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py @@ -13,28 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class CreateBuildStepRequest(BaseModel): +class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel): """ - CreateBuildStepRequest - """ # noqa: E501 - - build_dir: StrictStr = Field( - description="The relative path to the build directory", alias="buildDir" - ) - dockerfile_path: StrictStr = Field( - description="The relative path from the build dir to the Dockerfile", - alias="dockerfilePath", - ) + ManagedWorkerCreateRequestBuildConfigStepsInner + """ # noqa: E501 + build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") + dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") __properties: ClassVar[List[str]] = ["buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -43,6 +36,7 @@ class CreateBuildStepRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateBuildStepRequest from a JSON string""" + """Create an instance of ManagedWorkerCreateRequestBuildConfigStepsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,17 +73,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateBuildStepRequest from a dict""" + """Create an instance of ManagedWorkerCreateRequestBuildConfigStepsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath"), - } - ) + _obj = cls.model_validate({ + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py new file mode 100644 index 00000000..0da544d7 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerCreateRequestRuntimeConfig(BaseModel): + """ + ManagedWorkerCreateRequestRuntimeConfig + """ # noqa: E501 + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(alias="numReplicas") + regions: Optional[List[StrictStr]] = Field(default=None, description="The region to deploy the worker to") + cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + actions: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["numReplicas", "regions", "cpuKind", "cpus", "memoryMb", "actions"] + + @field_validator('regions') + def regions_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz']): + raise ValueError("each list item must be one of ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerCreateRequestRuntimeConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerCreateRequestRuntimeConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "numReplicas": obj.get("numReplicas"), + "regions": obj.get("regions"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "actions": obj.get("actions") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py deleted file mode 100644 index db784111..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -from enum import Enum - -from typing_extensions import Self - - -class ManagedWorkerEventStatus(str, Enum): - """ - ManagedWorkerEventStatus - """ - - """ - allowed enum values - """ - IN_PROGRESS = "IN_PROGRESS" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ManagedWorkerEventStatus from a JSON string""" - return cls(json.loads(json_str)) diff --git a/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py similarity index 64% rename from hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py index cc4f82fc..07075eb4 100644 --- a/hatchet_sdk/clients/cloud_rest/models/list_github_app_installations_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py @@ -13,28 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import ManagedWorkerEventsList200ResponseRowsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.github_app_installation import ( - GithubAppInstallation, -) -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse - - -class ListGithubAppInstallationsResponse(BaseModel): +class ManagedWorkerEventsList200Response(BaseModel): """ - ListGithubAppInstallationsResponse - """ # noqa: E501 - - pagination: PaginationResponse - rows: List[GithubAppInstallation] + ManagedWorkerEventsList200Response + """ # noqa: E501 + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None + rows: Optional[List[ManagedWorkerEventsList200ResponseRowsInner]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] model_config = ConfigDict( @@ -43,6 +38,7 @@ class ListGithubAppInstallationsResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListGithubAppInstallationsResponse from a JSON string""" + """Create an instance of ManagedWorkerEventsList200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,37 +73,29 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListGithubAppInstallationsResponse from a dict""" + """Create an instance of ManagedWorkerEventsList200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [GithubAppInstallation.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [ManagedWorkerEventsList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py similarity index 62% rename from hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py index e431112a..77504d3f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py @@ -13,42 +13,35 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event_status import ( - ManagedWorkerEventStatus, -) - - -class ManagedWorkerEvent(BaseModel): +class ManagedWorkerEventsList200ResponseRowsInner(BaseModel): """ - ManagedWorkerEvent - """ # noqa: E501 - + ManagedWorkerEventsList200ResponseRowsInner + """ # noqa: E501 id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") managed_worker_id: StrictStr = Field(alias="managedWorkerId") - status: ManagedWorkerEventStatus + status: StrictStr message: StrictStr data: Dict[str, Any] - __properties: ClassVar[List[str]] = [ - "id", - "timeFirstSeen", - "timeLastSeen", - "managedWorkerId", - "status", - "message", - "data", - ] + __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "managedWorkerId", "status", "message", "data"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED']): + raise ValueError("must be one of enum values ('IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED')") + return value model_config = ConfigDict( populate_by_name=True, @@ -56,6 +49,7 @@ class ManagedWorkerEvent(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorkerEvent from a JSON string""" + """Create an instance of ManagedWorkerEventsList200ResponseRowsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +74,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -91,22 +86,22 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorkerEvent from a dict""" + """Create an instance of ManagedWorkerEventsList200ResponseRowsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "id": obj.get("id"), - "timeFirstSeen": obj.get("timeFirstSeen"), - "timeLastSeen": obj.get("timeLastSeen"), - "managedWorkerId": obj.get("managedWorkerId"), - "status": obj.get("status"), - "message": obj.get("message"), - "data": obj.get("data"), - } - ) + _obj = cls.model_validate({ + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "managedWorkerId": obj.get("managedWorkerId"), + "status": obj.get("status"), + "message": obj.get("message"), + "data": obj.get("data") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py similarity index 63% rename from hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py index 185c0d54..443076b4 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_event_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py @@ -13,28 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response_rows_inner import ManagedWorkerInstancesList200ResponseRowsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.managed_worker_event import ( - ManagedWorkerEvent, -) -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse - - -class ManagedWorkerEventList(BaseModel): +class ManagedWorkerInstancesList200Response(BaseModel): """ - ManagedWorkerEventList - """ # noqa: E501 - - pagination: Optional[PaginationResponse] = None - rows: Optional[List[ManagedWorkerEvent]] = None + ManagedWorkerInstancesList200Response + """ # noqa: E501 + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None + rows: Optional[List[ManagedWorkerInstancesList200ResponseRowsInner]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] model_config = ConfigDict( @@ -43,6 +38,7 @@ class ManagedWorkerEventList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorkerEventList from a JSON string""" + """Create an instance of ManagedWorkerInstancesList200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,37 +73,29 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorkerEventList from a dict""" + """Create an instance of ManagedWorkerInstancesList200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - "rows": ( - [ManagedWorkerEvent.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, + "rows": [ManagedWorkerInstancesList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/instance.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py similarity index 68% rename from hatchet_sdk/clients/cloud_rest/models/instance.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py index 20236f9d..0351e40a 100644 --- a/hatchet_sdk/clients/cloud_rest/models/instance.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class Instance(BaseModel): +class ManagedWorkerInstancesList200ResponseRowsInner(BaseModel): """ - Instance - """ # noqa: E501 - + ManagedWorkerInstancesList200ResponseRowsInner + """ # noqa: E501 instance_id: StrictStr = Field(alias="instanceId") name: StrictStr region: StrictStr @@ -37,17 +35,7 @@ class Instance(BaseModel): memory_mb: StrictInt = Field(alias="memoryMb") disk_gb: StrictInt = Field(alias="diskGb") commit_sha: StrictStr = Field(alias="commitSha") - __properties: ClassVar[List[str]] = [ - "instanceId", - "name", - "region", - "state", - "cpuKind", - "cpus", - "memoryMb", - "diskGb", - "commitSha", - ] + __properties: ClassVar[List[str]] = ["instanceId", "name", "region", "state", "cpuKind", "cpus", "memoryMb", "diskGb", "commitSha"] model_config = ConfigDict( populate_by_name=True, @@ -55,6 +43,7 @@ class Instance(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Instance from a JSON string""" + """Create an instance of ManagedWorkerInstancesList200ResponseRowsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -90,24 +80,24 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Instance from a dict""" + """Create an instance of ManagedWorkerInstancesList200ResponseRowsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "instanceId": obj.get("instanceId"), - "name": obj.get("name"), - "region": obj.get("region"), - "state": obj.get("state"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "diskGb": obj.get("diskGb"), - "commitSha": obj.get("commitSha"), - } - ) + _obj = cls.model_validate({ + "instanceId": obj.get("instanceId"), + "name": obj.get("name"), + "region": obj.get("region"), + "state": obj.get("state"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "diskGb": obj.get("diskGb"), + "commitSha": obj.get("commitSha") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py similarity index 64% rename from hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py index 838e803c..d0656b02 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ManagedWorkerList200ResponseRowsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.managed_worker import ManagedWorker -from hatchet_sdk.clients.cloud_rest.models.pagination_response import PaginationResponse - - -class ManagedWorkerList(BaseModel): +class ManagedWorkerList200Response(BaseModel): """ - ManagedWorkerList - """ # noqa: E501 - - rows: Optional[List[ManagedWorker]] = None - pagination: Optional[PaginationResponse] = None + ManagedWorkerList200Response + """ # noqa: E501 + rows: Optional[List[ManagedWorkerList200ResponseRowsInner]] = None + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] model_config = ConfigDict( @@ -41,6 +38,7 @@ class ManagedWorkerList(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -52,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorkerList from a JSON string""" + """Create an instance of ManagedWorkerList200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,33 +77,25 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict["rows"] = _items + _dict['rows'] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict["pagination"] = self.pagination.to_dict() + _dict['pagination'] = self.pagination.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorkerList from a dict""" + """Create an instance of ManagedWorkerList200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "rows": ( - [ManagedWorker.from_dict(_item) for _item in obj["rows"]] - if obj.get("rows") is not None - else None - ), - "pagination": ( - PaginationResponse.from_dict(obj["pagination"]) - if obj.get("pagination") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "rows": [ManagedWorkerList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, + "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py similarity index 52% rename from hatchet_sdk/clients/cloud_rest/models/managed_worker.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py index 3ab7a453..99224904 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py @@ -13,48 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import ManagedWorkerList200ResponseRowsInnerBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.managed_worker_build_config import ( - ManagedWorkerBuildConfig, -) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_runtime_config import ( - ManagedWorkerRuntimeConfig, -) - - -class ManagedWorker(BaseModel): +class ManagedWorkerList200ResponseRowsInner(BaseModel): """ - ManagedWorker - """ # noqa: E501 - - metadata: APIResourceMeta + ManagedWorkerList200ResponseRowsInner + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata name: StrictStr - build_config: ManagedWorkerBuildConfig = Field(alias="buildConfig") + build_config: ManagedWorkerList200ResponseRowsInnerBuildConfig = Field(alias="buildConfig") is_iac: StrictBool = Field(alias="isIac") - env_vars: Dict[str, StrictStr] = Field( - description="A map of environment variables to set for the worker", - alias="envVars", - ) - runtime_configs: Optional[List[ManagedWorkerRuntimeConfig]] = Field( - default=None, alias="runtimeConfigs" - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "name", - "buildConfig", - "isIac", - "envVars", - "runtimeConfigs", - ] + env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") + runtime_configs: Optional[List[ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner]] = Field(default=None, alias="runtimeConfigs") + __properties: ClassVar[List[str]] = ["metadata", "name", "buildConfig", "isIac", "envVars", "runtimeConfigs"] model_config = ConfigDict( populate_by_name=True, @@ -62,6 +43,7 @@ class ManagedWorker(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorker from a JSON string""" + """Create an instance of ManagedWorkerList200ResponseRowsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -86,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,50 +78,35 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict["buildConfig"] = self.build_config.to_dict() + _dict['buildConfig'] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list) _items = [] if self.runtime_configs: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict["runtimeConfigs"] = _items + _dict['runtimeConfigs'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorker from a dict""" + """Create an instance of ManagedWorkerList200ResponseRowsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "name": obj.get("name"), - "buildConfig": ( - ManagedWorkerBuildConfig.from_dict(obj["buildConfig"]) - if obj.get("buildConfig") is not None - else None - ), - "isIac": obj.get("isIac"), - "runtimeConfigs": ( - [ - ManagedWorkerRuntimeConfig.from_dict(_item) - for _item in obj["runtimeConfigs"] - ] - if obj.get("runtimeConfigs") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "name": obj.get("name"), + "buildConfig": ManagedWorkerList200ResponseRowsInnerBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfigs": [ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py similarity index 51% rename from hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py index 500fac21..23d72f17 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_build_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py @@ -13,39 +13,29 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.build_step import BuildStep -from hatchet_sdk.clients.cloud_rest.models.github_repo import GithubRepo - - -class ManagedWorkerBuildConfig(BaseModel): +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import GithubAppListRepos200ResponseInner +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerList200ResponseRowsInnerBuildConfig(BaseModel): """ - ManagedWorkerBuildConfig - """ # noqa: E501 - - metadata: APIResourceMeta - github_installation_id: Annotated[ - str, Field(min_length=36, strict=True, max_length=36) - ] = Field(alias="githubInstallationId") - github_repository: GithubRepo = Field(alias="githubRepository") + ManagedWorkerList200ResponseRowsInnerBuildConfig + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata + github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + github_repository: GithubAppListRepos200ResponseInner = Field(alias="githubRepository") github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") - steps: Optional[List[BuildStep]] = None - __properties: ClassVar[List[str]] = [ - "metadata", - "githubInstallationId", - "githubRepository", - "githubRepositoryBranch", - "steps", - ] + steps: Optional[List[ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner]] = None + __properties: ClassVar[List[str]] = ["metadata", "githubInstallationId", "githubRepository", "githubRepositoryBranch", "steps"] model_config = ConfigDict( populate_by_name=True, @@ -53,6 +43,7 @@ class ManagedWorkerBuildConfig(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorkerBuildConfig from a JSON string""" + """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,7 +68,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -86,47 +78,35 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of github_repository if self.github_repository: - _dict["githubRepository"] = self.github_repository.to_dict() + _dict['githubRepository'] = self.github_repository.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict["steps"] = _items + _dict['steps'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorkerBuildConfig from a dict""" + """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfig from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepository": ( - GithubRepo.from_dict(obj["githubRepository"]) - if obj.get("githubRepository") is not None - else None - ), - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": ( - [BuildStep.from_dict(_item) for _item in obj["steps"]] - if obj.get("steps") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepository": GithubAppListRepos200ResponseInner.from_dict(obj["githubRepository"]) if obj.get("githubRepository") is not None else None, + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": [ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/build_step.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py similarity index 60% rename from hatchet_sdk/clients/cloud_rest/models/build_step.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py index 387a82c3..23404c75 100644 --- a/hatchet_sdk/clients/cloud_rest/models/build_step.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py @@ -13,31 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta - - -class BuildStep(BaseModel): +class ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner(BaseModel): """ - BuildStep - """ # noqa: E501 - - metadata: APIResourceMeta - build_dir: StrictStr = Field( - description="The relative path to the build directory", alias="buildDir" - ) - dockerfile_path: StrictStr = Field( - description="The relative path from the build dir to the Dockerfile", - alias="dockerfilePath", - ) + ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata + build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") + dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") __properties: ClassVar[List[str]] = ["metadata", "buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -46,6 +38,7 @@ class BuildStep(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -57,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BuildStep from a JSON string""" + """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -79,27 +73,23 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict["metadata"] = self.metadata.to_dict() + _dict['metadata'] = self.metadata.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BuildStep from a dict""" + """Create an instance of ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath"), - } - ) + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py new file mode 100644 index 00000000..57d19105 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata +from typing import Optional, Set +from typing_extensions import Self + +class ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner(BaseModel): + """ + ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata + num_replicas: StrictInt = Field(alias="numReplicas") + cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpus: StrictInt = Field(description="The number of CPUs to use for the worker") + memory_mb: StrictInt = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + region: StrictStr = Field(description="The region that the worker is deployed to") + actions: Optional[List[StrictStr]] = Field(default=None, description="A list of actions this runtime config corresponds to") + __properties: ClassVar[List[str]] = ["metadata", "numReplicas", "cpuKind", "cpus", "memoryMb", "region", "actions"] + + @field_validator('region') + def region_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz']): + raise ValueError("must be one of enum values ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "numReplicas": obj.get("numReplicas"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "region": obj.get("region"), + "actions": obj.get("actions") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py deleted file mode 100644 index 2b07a20a..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_region.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -from enum import Enum - -from typing_extensions import Self - - -class ManagedWorkerRegion(str, Enum): - """ - ManagedWorkerRegion - """ - - """ - allowed enum values - """ - AMS = "ams" - ARN = "arn" - ATL = "atl" - BOG = "bog" - BOS = "bos" - CDG = "cdg" - DEN = "den" - DFW = "dfw" - EWR = "ewr" - EZE = "eze" - GDL = "gdl" - GIG = "gig" - GRU = "gru" - HKG = "hkg" - IAD = "iad" - JNB = "jnb" - LAX = "lax" - LHR = "lhr" - MAD = "mad" - MIA = "mia" - NRT = "nrt" - ORD = "ord" - OTP = "otp" - PHX = "phx" - QRO = "qro" - SCL = "scl" - SEA = "sea" - SIN = "sin" - SJC = "sjc" - SYD = "syd" - WAW = "waw" - YUL = "yul" - YYZ = "yyz" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ManagedWorkerRegion from a JSON string""" - return cls(json.loads(json_str)) diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py deleted file mode 100644 index d4732f3f..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_runtime_config.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -import pprint -import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - -from hatchet_sdk.clients.cloud_rest.models.api_resource_meta import APIResourceMeta -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, -) - - -class ManagedWorkerRuntimeConfig(BaseModel): - """ - ManagedWorkerRuntimeConfig - """ # noqa: E501 - - metadata: APIResourceMeta - num_replicas: StrictInt = Field(alias="numReplicas") - cpu_kind: StrictStr = Field( - description="The kind of CPU to use for the worker", alias="cpuKind" - ) - cpus: StrictInt = Field(description="The number of CPUs to use for the worker") - memory_mb: StrictInt = Field( - description="The amount of memory in MB to use for the worker", alias="memoryMb" - ) - region: ManagedWorkerRegion = Field( - description="The region that the worker is deployed to" - ) - actions: Optional[List[StrictStr]] = Field( - default=None, description="A list of actions this runtime config corresponds to" - ) - __properties: ClassVar[List[str]] = [ - "metadata", - "numReplicas", - "cpuKind", - "cpus", - "memoryMb", - "region", - "actions", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ManagedWorkerRuntimeConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of metadata - if self.metadata: - _dict["metadata"] = self.metadata.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ManagedWorkerRuntimeConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "metadata": ( - APIResourceMeta.from_dict(obj["metadata"]) - if obj.get("metadata") is not None - else None - ), - "numReplicas": obj.get("numReplicas"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "region": obj.get("region"), - "actions": obj.get("actions"), - } - ) - return _obj diff --git a/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py similarity index 53% rename from hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py rename to hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py index 62979281..f77d5642 100644 --- a/hatchet_sdk/clients/cloud_rest/models/update_managed_worker_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py @@ -13,48 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ManagedWorkerCreateRequestBuildConfig +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_build_config_request import ( - CreateManagedWorkerBuildConfigRequest, -) -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) - - -class UpdateManagedWorkerRequest(BaseModel): +class ManagedWorkerUpdateRequest(BaseModel): """ - UpdateManagedWorkerRequest - """ # noqa: E501 - + ManagedWorkerUpdateRequest + """ # noqa: E501 name: Optional[StrictStr] = None - build_config: Optional[CreateManagedWorkerBuildConfigRequest] = Field( - default=None, alias="buildConfig" - ) - env_vars: Optional[Dict[str, StrictStr]] = Field( - default=None, - description="A map of environment variables to set for the worker", - alias="envVars", - ) + build_config: Optional[ManagedWorkerCreateRequestBuildConfig] = Field(default=None, alias="buildConfig") + env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of environment variables to set for the worker", alias="envVars") is_iac: Optional[StrictBool] = Field(default=None, alias="isIac") - runtime_config: Optional[CreateManagedWorkerRuntimeConfigRequest] = Field( - default=None, alias="runtimeConfig" - ) - __properties: ClassVar[List[str]] = [ - "name", - "buildConfig", - "envVars", - "isIac", - "runtimeConfig", - ] + runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(default=None, alias="runtimeConfig") + __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] model_config = ConfigDict( populate_by_name=True, @@ -62,6 +41,7 @@ class UpdateManagedWorkerRequest(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateManagedWorkerRequest from a JSON string""" + """Create an instance of ManagedWorkerUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -86,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -95,37 +76,27 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict["buildConfig"] = self.build_config.to_dict() + _dict['buildConfig'] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict["runtimeConfig"] = self.runtime_config.to_dict() + _dict['runtimeConfig'] = self.runtime_config.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateManagedWorkerRequest from a dict""" + """Create an instance of ManagedWorkerUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "name": obj.get("name"), - "buildConfig": ( - CreateManagedWorkerBuildConfigRequest.from_dict(obj["buildConfig"]) - if obj.get("buildConfig") is not None - else None - ), - "isIac": obj.get("isIac"), - "runtimeConfig": ( - CreateManagedWorkerRuntimeConfigRequest.from_dict( - obj["runtimeConfig"] - ) - if obj.get("runtimeConfig") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "buildConfig": ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, + "isIac": obj.get("isIac"), + "runtimeConfig": ManagedWorkerCreateRequestRuntimeConfig.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py similarity index 65% rename from hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py rename to hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py index 334d28ae..f44ffcaa 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_cloud_metadata.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py @@ -13,34 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class APICloudMetadata(BaseModel): +class MetadataGet200Response(BaseModel): """ - APICloudMetadata - """ # noqa: E501 - - can_bill: Optional[StrictBool] = Field( - default=None, description="whether the tenant can be billed", alias="canBill" - ) - can_link_github: Optional[StrictBool] = Field( - default=None, - description="whether the tenant can link to GitHub", - alias="canLinkGithub", - ) - metrics_enabled: Optional[StrictBool] = Field( - default=None, - description="whether metrics are enabled for the tenant", - alias="metricsEnabled", - ) + MetadataGet200Response + """ # noqa: E501 + can_bill: Optional[StrictBool] = Field(default=None, description="whether the tenant can be billed", alias="canBill") + can_link_github: Optional[StrictBool] = Field(default=None, description="whether the tenant can link to GitHub", alias="canLinkGithub") + metrics_enabled: Optional[StrictBool] = Field(default=None, description="whether metrics are enabled for the tenant", alias="metricsEnabled") __properties: ClassVar[List[str]] = ["canBill", "canLinkGithub", "metricsEnabled"] model_config = ConfigDict( @@ -49,6 +37,7 @@ class APICloudMetadata(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of APICloudMetadata from a JSON string""" + """Create an instance of MetadataGet200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,18 +74,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of APICloudMetadata from a dict""" + """Create an instance of MetadataGet200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "canBill": obj.get("canBill"), - "canLinkGithub": obj.get("canLinkGithub"), - "metricsEnabled": obj.get("metricsEnabled"), - } - ) + _obj = cls.model_validate({ + "canBill": obj.get("canBill"), + "canLinkGithub": obj.get("canLinkGithub"), + "metricsEnabled": obj.get("metricsEnabled") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_errors.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py similarity index 74% rename from hatchet_sdk/clients/cloud_rest/models/api_errors.py rename to hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py index f2579465..dd552bf3 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_errors.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py @@ -13,24 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response_errors_inner import MetadataGet400ResponseErrorsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.api_error import APIError - - -class APIErrors(BaseModel): +class MetadataGet400Response(BaseModel): """ - APIErrors - """ # noqa: E501 - - errors: List[APIError] + MetadataGet400Response + """ # noqa: E501 + errors: List[MetadataGet400ResponseErrorsInner] __properties: ClassVar[List[str]] = ["errors"] model_config = ConfigDict( @@ -39,6 +36,7 @@ class APIErrors(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -50,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of APIErrors from a JSON string""" + """Create an instance of MetadataGet400Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -63,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -76,25 +75,21 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.errors: if _item: _items.append(_item.to_dict()) - _dict["errors"] = _items + _dict['errors'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of APIErrors from a dict""" + """Create an instance of MetadataGet400Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "errors": ( - [APIError.from_dict(_item) for _item in obj["errors"]] - if obj.get("errors") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "errors": [MetadataGet400ResponseErrorsInner.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/api_error.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py similarity index 67% rename from hatchet_sdk/clients/cloud_rest/models/api_error.py rename to hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py index 64edc80f..6e40fe0f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/api_error.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py @@ -13,34 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class APIError(BaseModel): +class MetadataGet400ResponseErrorsInner(BaseModel): """ - APIError - """ # noqa: E501 - - code: Optional[StrictInt] = Field( - default=None, description="a custom Hatchet error code" - ) - var_field: Optional[StrictStr] = Field( - default=None, - description="the field that this error is associated with, if applicable", - alias="field", - ) + MetadataGet400ResponseErrorsInner + """ # noqa: E501 + code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") + var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") description: StrictStr = Field(description="a description for this error") - docs_link: Optional[StrictStr] = Field( - default=None, - description="a link to the documentation for this error, if it exists", - ) + docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] model_config = ConfigDict( @@ -49,6 +38,7 @@ class APIError(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of APIError from a JSON string""" + """Create an instance of MetadataGet400ResponseErrorsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,19 +75,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of APIError from a dict""" + """Create an instance of MetadataGet400ResponseErrorsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "code": obj.get("code"), - "field": obj.get("field"), - "description": obj.get("description"), - "docs_link": obj.get("docs_link"), - } - ) + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_stream.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py similarity index 71% rename from hatchet_sdk/clients/cloud_rest/models/sample_stream.py rename to hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py index 446c3f6c..40918823 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_stream.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py @@ -13,28 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner import MetricsCpuGet200ResponseInnerHistogramsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.sample_histogram_pair import ( - SampleHistogramPair, -) - - -class SampleStream(BaseModel): +class MetricsCpuGet200ResponseInner(BaseModel): """ - SampleStream - """ # noqa: E501 - + MetricsCpuGet200ResponseInner + """ # noqa: E501 metric: Optional[Dict[str, StrictStr]] = None values: Optional[List[List[StrictStr]]] = None - histograms: Optional[List[SampleHistogramPair]] = None + histograms: Optional[List[MetricsCpuGet200ResponseInnerHistogramsInner]] = None __properties: ClassVar[List[str]] = ["metric", "values", "histograms"] model_config = ConfigDict( @@ -43,6 +38,7 @@ class SampleStream(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -54,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SampleStream from a JSON string""" + """Create an instance of MetricsCpuGet200ResponseInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -67,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -80,29 +77,22 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.histograms: if _item: _items.append(_item.to_dict()) - _dict["histograms"] = _items + _dict['histograms'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SampleStream from a dict""" + """Create an instance of MetricsCpuGet200ResponseInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "values": obj.get("values"), - "histograms": ( - [ - SampleHistogramPair.from_dict(_item) - for _item in obj["histograms"] - ] - if obj.get("histograms") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "values": obj.get("values"), + "histograms": [MetricsCpuGet200ResponseInnerHistogramsInner.from_dict(_item) for _item in obj["histograms"]] if obj.get("histograms") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py similarity index 67% rename from hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py rename to hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py index e78aa9c5..14c82abc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_histogram_pair.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py @@ -13,25 +13,22 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram import MetricsCpuGet200ResponseInnerHistogramsInnerHistogram +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.sample_histogram import SampleHistogram - - -class SampleHistogramPair(BaseModel): +class MetricsCpuGet200ResponseInnerHistogramsInner(BaseModel): """ - SampleHistogramPair - """ # noqa: E501 - + MetricsCpuGet200ResponseInnerHistogramsInner + """ # noqa: E501 timestamp: Optional[StrictInt] = None - histogram: Optional[SampleHistogram] = None + histogram: Optional[MetricsCpuGet200ResponseInnerHistogramsInnerHistogram] = None __properties: ClassVar[List[str]] = ["timestamp", "histogram"] model_config = ConfigDict( @@ -40,6 +37,7 @@ class SampleHistogramPair(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -51,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SampleHistogramPair from a JSON string""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,7 +62,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -73,26 +72,22 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of histogram if self.histogram: - _dict["histogram"] = self.histogram.to_dict() + _dict['histogram'] = self.histogram.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SampleHistogramPair from a dict""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "timestamp": obj.get("timestamp"), - "histogram": ( - SampleHistogram.from_dict(obj["histogram"]) - if obj.get("histogram") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "histogram": MetricsCpuGet200ResponseInnerHistogramsInnerHistogram.from_dict(obj["histogram"]) if obj.get("histogram") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py similarity index 67% rename from hatchet_sdk/clients/cloud_rest/models/sample_histogram.py rename to hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py index 5f84eff8..ffcf789a 100644 --- a/hatchet_sdk/clients/cloud_rest/models/sample_histogram.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py @@ -13,26 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set, Union +import json from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner import MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.histogram_bucket import HistogramBucket - - -class SampleHistogram(BaseModel): +class MetricsCpuGet200ResponseInnerHistogramsInnerHistogram(BaseModel): """ - SampleHistogram - """ # noqa: E501 - + MetricsCpuGet200ResponseInnerHistogramsInnerHistogram + """ # noqa: E501 count: Optional[Union[StrictFloat, StrictInt]] = None sum: Optional[Union[StrictFloat, StrictInt]] = None - buckets: Optional[List[HistogramBucket]] = None + buckets: Optional[List[MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner]] = None __properties: ClassVar[List[str]] = ["count", "sum", "buckets"] model_config = ConfigDict( @@ -41,6 +38,7 @@ class SampleHistogram(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -52,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SampleHistogram from a JSON string""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInnerHistogram from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,27 +77,23 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.buckets: if _item: _items.append(_item.to_dict()) - _dict["buckets"] = _items + _dict['buckets'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SampleHistogram from a dict""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInnerHistogram from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "count": obj.get("count"), - "sum": obj.get("sum"), - "buckets": ( - [HistogramBucket.from_dict(_item) for _item in obj["buckets"]] - if obj.get("buckets") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "sum": obj.get("sum"), + "buckets": [MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner.from_dict(_item) for _item in obj["buckets"]] if obj.get("buckets") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py similarity index 74% rename from hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py rename to hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py index b9dd9730..96919b2c 100644 --- a/hatchet_sdk/clients/cloud_rest/models/histogram_bucket.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set, Union +import json from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set from typing_extensions import Self - -class HistogramBucket(BaseModel): +class MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner(BaseModel): """ - HistogramBucket - """ # noqa: E501 - + MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner + """ # noqa: E501 boundaries: Optional[StrictInt] = None lower: Optional[Union[StrictFloat, StrictInt]] = None upper: Optional[Union[StrictFloat, StrictInt]] = None @@ -40,6 +38,7 @@ class HistogramBucket(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -51,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HistogramBucket from a JSON string""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,19 +75,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HistogramBucket from a dict""" + """Create an instance of MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "boundaries": obj.get("boundaries"), - "lower": obj.get("lower"), - "upper": obj.get("upper"), - "count": obj.get("count"), - } - ) + _obj = cls.model_validate({ + "boundaries": obj.get("boundaries"), + "lower": obj.get("lower"), + "upper": obj.get("upper"), + "count": obj.get("count") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py b/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py similarity index 79% rename from hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py rename to hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py index 8d02a0fe..5c10ff38 100644 --- a/hatchet_sdk/clients/cloud_rest/models/runtime_config_actions_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py @@ -13,21 +13,19 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class RuntimeConfigActionsResponse(BaseModel): +class RuntimeConfigListActions200Response(BaseModel): """ - RuntimeConfigActionsResponse - """ # noqa: E501 - + RuntimeConfigListActions200Response + """ # noqa: E501 actions: List[StrictStr] __properties: ClassVar[List[str]] = ["actions"] @@ -37,6 +35,7 @@ class RuntimeConfigActionsResponse(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -48,7 +47,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RuntimeConfigActionsResponse from a JSON string""" + """Create an instance of RuntimeConfigListActions200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -61,7 +60,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -72,12 +72,16 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RuntimeConfigActionsResponse from a dict""" + """Create an instance of RuntimeConfigListActions200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"actions": obj.get("actions")}) + _obj = cls.model_validate({ + "actions": obj.get("actions") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py similarity index 55% rename from hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py rename to hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py index cf89100f..5ba0d227 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription.py +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py @@ -13,46 +13,42 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription_status import ( - TenantSubscriptionStatus, -) - - -class TenantSubscription(BaseModel): +class SubscriptionUpsert200Response(BaseModel): """ - TenantSubscription - """ # noqa: E501 - - plan: Optional[StrictStr] = Field( - default=None, - description="The plan code associated with the tenant subscription.", - ) - period: Optional[StrictStr] = Field( - default=None, description="The period associated with the tenant subscription." - ) - status: Optional[TenantSubscriptionStatus] = Field( - default=None, description="The status of the tenant subscription." - ) - note: Optional[StrictStr] = Field( - default=None, description="A note associated with the tenant subscription." - ) + SubscriptionUpsert200Response + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") + period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") + status: Optional[StrictStr] = Field(default=None, description="The status of the tenant subscription.") + note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['active', 'pending', 'terminated', 'canceled']): + raise ValueError("must be one of enum values ('active', 'pending', 'terminated', 'canceled')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,7 +60,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TenantSubscription from a JSON string""" + """Create an instance of SubscriptionUpsert200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,7 +73,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -88,19 +85,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TenantSubscription from a dict""" + """Create an instance of SubscriptionUpsert200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "plan": obj.get("plan"), - "period": obj.get("period"), - "status": obj.get("status"), - "note": obj.get("note"), - } - ) + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py similarity index 77% rename from hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py rename to hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py index 33babb9e..d6688c23 100644 --- a/hatchet_sdk/clients/cloud_rest/models/update_tenant_subscription.py +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py @@ -13,25 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class UpdateTenantSubscription(BaseModel): +class SubscriptionUpsertRequest(BaseModel): """ - UpdateTenantSubscription - """ # noqa: E501 - + SubscriptionUpsertRequest + """ # noqa: E501 plan: Optional[StrictStr] = Field(default=None, description="The code of the plan.") - period: Optional[StrictStr] = Field( - default=None, description="The period of the plan." - ) + period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") __properties: ClassVar[List[str]] = ["plan", "period"] model_config = ConfigDict( @@ -40,6 +36,7 @@ class UpdateTenantSubscription(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -51,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateTenantSubscription from a JSON string""" + """Create an instance of SubscriptionUpsertRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -75,14 +73,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateTenantSubscription from a dict""" + """Create an instance of SubscriptionUpsertRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"plan": obj.get("plan"), "period": obj.get("period")} - ) + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "period": obj.get("period") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py similarity index 53% rename from hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py rename to hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py index 8b25bedf..d2b55e05 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py @@ -13,46 +13,28 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_coupons_inner import TenantBillingStateGet200ResponseCouponsInner +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_payment_methods_inner import TenantBillingStateGet200ResponsePaymentMethodsInner +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_plans_inner import TenantBillingStateGet200ResponsePlansInner +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_subscription import TenantBillingStateGet200ResponseSubscription +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.coupon import Coupon -from hatchet_sdk.clients.cloud_rest.models.subscription_plan import SubscriptionPlan -from hatchet_sdk.clients.cloud_rest.models.tenant_payment_method import ( - TenantPaymentMethod, -) -from hatchet_sdk.clients.cloud_rest.models.tenant_subscription import TenantSubscription - - -class TenantBillingState(BaseModel): +class TenantBillingStateGet200Response(BaseModel): """ - TenantBillingState - """ # noqa: E501 - - payment_methods: Optional[List[TenantPaymentMethod]] = Field( - default=None, alias="paymentMethods" - ) - subscription: TenantSubscription = Field( - description="The subscription associated with this policy." - ) - plans: Optional[List[SubscriptionPlan]] = Field( - default=None, description="A list of plans available for the tenant." - ) - coupons: Optional[List[Coupon]] = Field( - default=None, description="A list of coupons applied to the tenant." - ) - __properties: ClassVar[List[str]] = [ - "paymentMethods", - "subscription", - "plans", - "coupons", - ] + TenantBillingStateGet200Response + """ # noqa: E501 + payment_methods: Optional[List[TenantBillingStateGet200ResponsePaymentMethodsInner]] = Field(default=None, alias="paymentMethods") + subscription: TenantBillingStateGet200ResponseSubscription + plans: Optional[List[TenantBillingStateGet200ResponsePlansInner]] = Field(default=None, description="A list of plans available for the tenant.") + coupons: Optional[List[TenantBillingStateGet200ResponseCouponsInner]] = Field(default=None, description="A list of coupons applied to the tenant.") + __properties: ClassVar[List[str]] = ["paymentMethods", "subscription", "plans", "coupons"] model_config = ConfigDict( populate_by_name=True, @@ -60,6 +42,7 @@ class TenantBillingState(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -71,7 +54,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TenantBillingState from a JSON string""" + """Create an instance of TenantBillingStateGet200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,7 +67,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -97,60 +81,41 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.payment_methods: if _item: _items.append(_item.to_dict()) - _dict["paymentMethods"] = _items + _dict['paymentMethods'] = _items # override the default output from pydantic by calling `to_dict()` of subscription if self.subscription: - _dict["subscription"] = self.subscription.to_dict() + _dict['subscription'] = self.subscription.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in plans (list) _items = [] if self.plans: for _item in self.plans: if _item: _items.append(_item.to_dict()) - _dict["plans"] = _items + _dict['plans'] = _items # override the default output from pydantic by calling `to_dict()` of each item in coupons (list) _items = [] if self.coupons: for _item in self.coupons: if _item: _items.append(_item.to_dict()) - _dict["coupons"] = _items + _dict['coupons'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TenantBillingState from a dict""" + """Create an instance of TenantBillingStateGet200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "paymentMethods": ( - [ - TenantPaymentMethod.from_dict(_item) - for _item in obj["paymentMethods"] - ] - if obj.get("paymentMethods") is not None - else None - ), - "subscription": ( - TenantSubscription.from_dict(obj["subscription"]) - if obj.get("subscription") is not None - else None - ), - "plans": ( - [SubscriptionPlan.from_dict(_item) for _item in obj["plans"]] - if obj.get("plans") is not None - else None - ), - "coupons": ( - [Coupon.from_dict(_item) for _item in obj["coupons"]] - if obj.get("coupons") is not None - else None - ), - } - ) + _obj = cls.model_validate({ + "paymentMethods": [TenantBillingStateGet200ResponsePaymentMethodsInner.from_dict(_item) for _item in obj["paymentMethods"]] if obj.get("paymentMethods") is not None else None, + "subscription": TenantBillingStateGet200ResponseSubscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None, + "plans": [TenantBillingStateGet200ResponsePlansInner.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None, + "coupons": [TenantBillingStateGet200ResponseCouponsInner.from_dict(_item) for _item in obj["coupons"]] if obj.get("coupons") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py new file mode 100644 index 00000000..af6d1434 --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class TenantBillingStateGet200ResponseCouponsInner(BaseModel): + """ + TenantBillingStateGet200ResponseCouponsInner + """ # noqa: E501 + name: StrictStr = Field(description="The name of the coupon.") + amount_cents: Optional[StrictInt] = Field(default=None, description="The amount off of the coupon.") + amount_cents_remaining: Optional[StrictInt] = Field(default=None, description="The amount remaining on the coupon.") + amount_currency: Optional[StrictStr] = Field(default=None, description="The currency of the coupon.") + frequency: StrictStr = Field(description="The frequency of the coupon.") + frequency_duration: Optional[StrictInt] = Field(default=None, description="The frequency duration of the coupon.") + frequency_duration_remaining: Optional[StrictInt] = Field(default=None, description="The frequency duration remaining of the coupon.") + percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The percentage off of the coupon.") + __properties: ClassVar[List[str]] = ["name", "amount_cents", "amount_cents_remaining", "amount_currency", "frequency", "frequency_duration", "frequency_duration_remaining", "percent"] + + @field_validator('frequency') + def frequency_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['once', 'recurring']): + raise ValueError("must be one of enum values ('once', 'recurring')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantBillingStateGet200ResponseCouponsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantBillingStateGet200ResponseCouponsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "amount_cents": obj.get("amount_cents"), + "amount_cents_remaining": obj.get("amount_cents_remaining"), + "amount_currency": obj.get("amount_currency"), + "frequency": obj.get("frequency"), + "frequency_duration": obj.get("frequency_duration"), + "frequency_duration_remaining": obj.get("frequency_duration_remaining"), + "percent": obj.get("percent") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py similarity index 66% rename from hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py rename to hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py index b73208da..b97207b9 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_payment_method.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py @@ -13,31 +13,23 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class TenantPaymentMethod(BaseModel): +class TenantBillingStateGet200ResponsePaymentMethodsInner(BaseModel): """ - TenantPaymentMethod - """ # noqa: E501 - + TenantBillingStateGet200ResponsePaymentMethodsInner + """ # noqa: E501 brand: StrictStr = Field(description="The brand of the payment method.") - last4: Optional[StrictStr] = Field( - default=None, description="The last 4 digits of the card." - ) - expiration: Optional[StrictStr] = Field( - default=None, description="The expiration date of the card." - ) - description: Optional[StrictStr] = Field( - default=None, description="The description of the payment method." - ) + last4: Optional[StrictStr] = Field(default=None, description="The last 4 digits of the card.") + expiration: Optional[StrictStr] = Field(default=None, description="The expiration date of the card.") + description: Optional[StrictStr] = Field(default=None, description="The description of the payment method.") __properties: ClassVar[List[str]] = ["brand", "last4", "expiration", "description"] model_config = ConfigDict( @@ -46,6 +38,7 @@ class TenantPaymentMethod(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -57,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TenantPaymentMethod from a JSON string""" + """Create an instance of TenantBillingStateGet200ResponsePaymentMethodsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,7 +63,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -81,19 +75,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TenantPaymentMethod from a dict""" + """Create an instance of TenantBillingStateGet200ResponsePaymentMethodsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "brand": obj.get("brand"), - "last4": obj.get("last4"), - "expiration": obj.get("expiration"), - "description": obj.get("description"), - } - ) + _obj = cls.model_validate({ + "brand": obj.get("brand"), + "last4": obj.get("last4"), + "expiration": obj.get("expiration"), + "description": obj.get("description") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py similarity index 70% rename from hatchet_sdk/clients/cloud_rest/models/subscription_plan.py rename to hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py index b775c1bd..ddf50b4b 100644 --- a/hatchet_sdk/clients/cloud_rest/models/subscription_plan.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py @@ -13,35 +13,25 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set from typing_extensions import Self - -class SubscriptionPlan(BaseModel): +class TenantBillingStateGet200ResponsePlansInner(BaseModel): """ - SubscriptionPlan - """ # noqa: E501 - + TenantBillingStateGet200ResponsePlansInner + """ # noqa: E501 plan_code: StrictStr = Field(description="The code of the plan.") name: StrictStr = Field(description="The name of the plan.") description: StrictStr = Field(description="The description of the plan.") amount_cents: StrictInt = Field(description="The price of the plan.") - period: Optional[StrictStr] = Field( - default=None, description="The period of the plan." - ) - __properties: ClassVar[List[str]] = [ - "plan_code", - "name", - "description", - "amount_cents", - "period", - ] + period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") + __properties: ClassVar[List[str]] = ["plan_code", "name", "description", "amount_cents", "period"] model_config = ConfigDict( populate_by_name=True, @@ -49,6 +39,7 @@ class SubscriptionPlan(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SubscriptionPlan from a JSON string""" + """Create an instance of TenantBillingStateGet200ResponsePlansInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +64,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -84,20 +76,20 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SubscriptionPlan from a dict""" + """Create an instance of TenantBillingStateGet200ResponsePlansInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "plan_code": obj.get("plan_code"), - "name": obj.get("name"), - "description": obj.get("description"), - "amount_cents": obj.get("amount_cents"), - "period": obj.get("period"), - } - ) + _obj = cls.model_validate({ + "plan_code": obj.get("plan_code"), + "name": obj.get("name"), + "description": obj.get("description"), + "amount_cents": obj.get("amount_cents"), + "period": obj.get("period") + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py new file mode 100644 index 00000000..8ab1649b --- /dev/null +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Hatchet API + + The Hatchet API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TenantBillingStateGet200ResponseSubscription(BaseModel): + """ + The subscription associated with this policy. + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") + period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") + status: Optional[StrictStr] = Field(default=None, description="The status of the tenant subscription.") + note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") + __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['active', 'pending', 'terminated', 'canceled']): + raise ValueError("must be one of enum values ('active', 'pending', 'terminated', 'canceled')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TenantBillingStateGet200ResponseSubscription from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TenantBillingStateGet200ResponseSubscription from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note") + }) + return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py b/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py deleted file mode 100644 index ab9edba1..00000000 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_subscription_status.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Hatchet API - - The Hatchet API - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations - -import json -from enum import Enum - -from typing_extensions import Self - - -class TenantSubscriptionStatus(str, Enum): - """ - TenantSubscriptionStatus - """ - - """ - allowed enum values - """ - ACTIVE = "active" - PENDING = "pending" - TERMINATED = "terminated" - CANCELED = "canceled" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of TenantSubscriptionStatus from a JSON string""" - return cls(json.loads(json_str)) diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py similarity index 69% rename from hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py rename to hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py index d324a2c0..98a19c0f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metrics_counts.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py @@ -13,26 +13,21 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Any, ClassVar, Dict, List, Optional, Set +import json from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response_results_inner import WorkflowRunEventsGetMetrics200ResponseResultsInner +from typing import Optional, Set from typing_extensions import Self -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_metric import ( - WorkflowRunEventsMetric, -) - - -class WorkflowRunEventsMetricsCounts(BaseModel): +class WorkflowRunEventsGetMetrics200Response(BaseModel): """ - WorkflowRunEventsMetricsCounts - """ # noqa: E501 - - results: Optional[List[WorkflowRunEventsMetric]] = None + WorkflowRunEventsGetMetrics200Response + """ # noqa: E501 + results: Optional[List[WorkflowRunEventsGetMetrics200ResponseResultsInner]] = None __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( @@ -41,6 +36,7 @@ class WorkflowRunEventsMetricsCounts(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -52,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WorkflowRunEventsMetricsCounts from a JSON string""" + """Create an instance of WorkflowRunEventsGetMetrics200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,7 +61,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -78,28 +75,21 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.results: if _item: _items.append(_item.to_dict()) - _dict["results"] = _items + _dict['results'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkflowRunEventsMetricsCounts from a dict""" + """Create an instance of WorkflowRunEventsGetMetrics200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "results": ( - [ - WorkflowRunEventsMetric.from_dict(_item) - for _item in obj["results"] - ] - if obj.get("results") is not None - else None - ) - } - ) + _obj = cls.model_validate({ + "results": [WorkflowRunEventsGetMetrics200ResponseResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None + }) return _obj + + diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py similarity index 71% rename from hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py rename to hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py index 94547c63..c4ea1cf1 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_metric.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py @@ -13,36 +13,27 @@ from __future__ import annotations - -import json import pprint import re # noqa: F401 -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set +import json +from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set from typing_extensions import Self - -class WorkflowRunEventsMetric(BaseModel): +class WorkflowRunEventsGetMetrics200ResponseResultsInner(BaseModel): """ - WorkflowRunEventsMetric - """ # noqa: E501 - + WorkflowRunEventsGetMetrics200ResponseResultsInner + """ # noqa: E501 time: datetime pending: StrictInt = Field(alias="PENDING") running: StrictInt = Field(alias="RUNNING") succeeded: StrictInt = Field(alias="SUCCEEDED") failed: StrictInt = Field(alias="FAILED") queued: StrictInt = Field(alias="QUEUED") - __properties: ClassVar[List[str]] = [ - "time", - "PENDING", - "RUNNING", - "SUCCEEDED", - "FAILED", - "QUEUED", - ] + __properties: ClassVar[List[str]] = ["time", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] model_config = ConfigDict( populate_by_name=True, @@ -50,6 +41,7 @@ class WorkflowRunEventsMetric(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WorkflowRunEventsMetric from a JSON string""" + """Create an instance of WorkflowRunEventsGetMetrics200ResponseResultsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +66,8 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([]) + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -85,21 +78,21 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkflowRunEventsMetric from a dict""" + """Create an instance of WorkflowRunEventsGetMetrics200ResponseResultsInner from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - { - "time": obj.get("time"), - "PENDING": obj.get("PENDING"), - "RUNNING": obj.get("RUNNING"), - "SUCCEEDED": obj.get("SUCCEEDED"), - "FAILED": obj.get("FAILED"), - "QUEUED": obj.get("QUEUED"), - } - ) + _obj = cls.model_validate({ + "time": obj.get("time"), + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED") + }) return _obj + + diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 777d293a..fb552a0a 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -3,15 +3,15 @@ from typing import Any, Callable, Dict, List from hatchet_sdk.client import Client -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( - InfraAsCodeRequest, -) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, + +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import InfraAsCodeCreateRequest +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, ) + + +# from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ManagedWorkerRegion + from hatchet_sdk.compute.configs import Compute from hatchet_sdk.logger import logger @@ -46,11 +46,11 @@ def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): def get_compute_configs( self, actions: Dict[str, Callable[..., Any]] - ) -> List[CreateManagedWorkerRuntimeConfigRequest]: + ) -> List[ManagedWorkerCreateRequestRuntimeConfig]: """ Builds a map of compute hashes to compute configs and lists of actions that correspond to each compute hash. """ - map: Dict[str, CreateManagedWorkerRuntimeConfigRequest] = {} + map: Dict[str, ManagedWorkerCreateRequestRuntimeConfig] = {} try: for action, func in actions.items(): @@ -61,7 +61,7 @@ def get_compute_configs( key = compute.hash() if key not in map: - map[key] = CreateManagedWorkerRuntimeConfigRequest( + map[key] = ManagedWorkerCreateRequestRuntimeConfig( actions=[], num_replicas=1, cpu_kind=compute.cpu_kind, @@ -90,7 +90,7 @@ async def cloud_register(self): ) return - req = InfraAsCodeRequest(runtime_configs=self.configs) + req = InfraAsCodeCreateRequest(runtime_configs=self.configs) res = ( await self.client.rest.aio.managed_worker_api.infra_as_code_create( From 7aed0e2d3cf4f9a9e0d3be417e5a049591b5a1c8 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:06:28 -0400 Subject: [PATCH 12/33] feat: filter actions --- examples/simple/worker.py | 8 ++++++++ hatchet_sdk/compute/configs.py | 10 ++-------- hatchet_sdk/compute/managed_compute.py | 2 +- hatchet_sdk/loader.py | 6 ++++++ hatchet_sdk/worker/worker.py | 14 +++++--------- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/simple/worker.py b/examples/simple/worker.py index 1eca4c79..ef99e390 100644 --- a/examples/simple/worker.py +++ b/examples/simple/worker.py @@ -19,6 +19,14 @@ def step1(self, context: Context): return { "step1": "step1", } + + @hatchet.step(timeout="11s", retries=3) + def step2(self, context: Context): + print("executed step2") + time.sleep(10) + return { + "step2": "step2", + } def main(): diff --git a/hatchet_sdk/compute/configs.py b/hatchet_sdk/compute/configs.py index 8e7d6ba0..89c465f6 100644 --- a/hatchet_sdk/compute/configs.py +++ b/hatchet_sdk/compute/configs.py @@ -3,13 +3,6 @@ from pydantic import BaseModel, Field, StrictStr -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, -) - class Compute(BaseModel): pool: Optional[str] = Field( @@ -19,7 +12,8 @@ class Compute(BaseModel): num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( default=1, alias="num_replicas" ) - regions: Optional[list[ManagedWorkerRegion]] = Field( + # TODO: change to ManagedWorkerRegion + regions: Optional[list[str]] = Field( default=None, description="The regions to deploy the worker to" ) cpu_kind: StrictStr = Field( diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index fb552a0a..5cb35305 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -9,7 +9,7 @@ ManagedWorkerCreateRequestRuntimeConfig, ) - +# TODO why is this not generating # from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ManagedWorkerRegion from hatchet_sdk.compute.configs import Compute diff --git a/hatchet_sdk/loader.py b/hatchet_sdk/loader.py index 06bd5da0..95d5a238 100644 --- a/hatchet_sdk/loader.py +++ b/hatchet_sdk/loader.py @@ -38,6 +38,7 @@ def __init__( logger: Logger = None, grpc_max_recv_message_length: int = 4 * 1024 * 1024, # 4MB grpc_max_send_message_length: int = 4 * 1024 * 1024, # 4MB + runnable_actions: list[str] = None, # list of action names that are runnable, defaults to all actions ): self.tenant_id = tenant_id self.tls_config = tls_config @@ -62,6 +63,7 @@ def __init__( self.listener_v2_timeout = listener_v2_timeout + self.runnable_actions: list[str] | None = [ self.namespace + action for action in runnable_actions] if runnable_actions else None class ConfigLoader: def __init__(self, directory: str): @@ -127,6 +129,9 @@ def get_config_value(key, env_var): tls_config = self._load_tls_config(config_data["tls"], host_port) + raw_runnable_actions = get_config_value("runnable_actions", "HATCHET_CLOUD_ACTIONS") + runnable_actions = raw_runnable_actions.split(",") if raw_runnable_actions else None + return ClientConfig( tenant_id=tenant_id, tls_config=tls_config, @@ -138,6 +143,7 @@ def get_config_value(key, env_var): logger=defaults.logger, grpc_max_recv_message_length=grpc_max_recv_message_length, grpc_max_send_message_length=grpc_max_send_message_length, + runnable_actions=runnable_actions, ) def _load_tls_config(self, tls_data: Dict, host_port) -> ClientTLSConfig: diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index 909088af..ca611e28 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -9,15 +9,7 @@ from typing import Any, Callable, Dict, Optional from hatchet_sdk.client import Client, new_client_raw -from hatchet_sdk.clients.cloud_rest.models.create_managed_worker_runtime_config_request import ( - CreateManagedWorkerRuntimeConfigRequest, -) -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_request import ( - InfraAsCodeRequest, -) -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, -) + from hatchet_sdk.compute.managed_compute import ManagedCompute from hatchet_sdk.context import Context from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts @@ -109,6 +101,10 @@ def action_function(context): return action_function for action_name, action_func in workflow.get_actions(namespace): + if self.client.config.runnable_actions and action_name not in self.client.config.runnable_actions: + logger.debug(f"skipping action: {action_name} not in runnable actions") + continue + fn = create_action_function(action_func) # copy the compute from the action func to the action function fn._step_compute = action_func._step_compute From a4ccdd34fb078d344bc48d574f425e8e23e22608 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:17:18 -0400 Subject: [PATCH 13/33] fix: region --- examples/managed/worker.py | 9 +++------ hatchet_sdk/compute/managed_compute.py | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/managed/worker.py b/examples/managed/worker.py index 3814ee89..fa7a836c 100644 --- a/examples/managed/worker.py +++ b/examples/managed/worker.py @@ -3,9 +3,6 @@ from dotenv import load_dotenv from hatchet_sdk import Context, Hatchet -from hatchet_sdk.clients.cloud_rest.models.managed_worker_region import ( - ManagedWorkerRegion, -) from hatchet_sdk.compute.configs import Compute load_dotenv() @@ -15,7 +12,7 @@ # Default compute default_compute = Compute( - cpu_kind="shared", cpus=1, memory_mb=1024, regions=[ManagedWorkerRegion.EWR] + cpu_kind="shared", cpus=1, memory_mb=1024, regions=["ewr"] ) blocked_compute = Compute( @@ -23,11 +20,11 @@ cpu_kind="shared", cpus=1, memory_mb=1024, - regions=[ManagedWorkerRegion.EWR], + regions=["ewr"], ) gpu_compute = Compute( - cpu_kind="gpu", cpus=2, memory_mb=1024, regions=[ManagedWorkerRegion.EWR] + cpu_kind="gpu", cpus=2, memory_mb=1024, regions=["ewr"] ) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 5cb35305..28b675cf 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -38,7 +38,7 @@ def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): logger.warning(f" cpu kind: {compute.cpu_kind}") logger.warning(f" cpus: {compute.cpus}") logger.warning(f" memory mb: {compute.memory_mb}") - logger.warning(f" region: {compute.region}") + logger.warning(f" regions: {compute.regions}") logger.warning( "NOTICE: local mode detected, skipping cloud registration and running all actions locally." From 00215f470652d094c9c97907fb35008cc9996c61 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:54:05 -0400 Subject: [PATCH 14/33] chore: gen --- examples/managed/worker.py | 8 +- examples/simple/worker.py | 2 +- .../models/build_get200_response.py | 61 +++++---- ...hub_app_list_branches200_response_inner.py | 23 ++-- ...thub_app_list_installations200_response.py | 52 +++++--- ...st_installations200_response_pagination.py | 36 +++--- ...st_installations200_response_rows_inner.py | 50 +++++--- ...lations200_response_rows_inner_metadata.py | 45 ++++--- ...github_app_list_repos200_response_inner.py | 23 ++-- .../models/infra_as_code_create_request.py | 42 ++++--- .../models/log_create_request_inner.py | 76 ++++++++---- .../models/log_create_request_inner_event.py | 20 ++- .../models/log_create_request_inner_fly.py | 37 +++--- .../log_create_request_inner_fly_app.py | 23 ++-- .../models/log_create_request_inner_log.py | 20 ++- .../cloud_rest/models/log_list200_response.py | 52 +++++--- .../models/log_list200_response_rows_inner.py | 30 ++--- .../models/managed_worker_create_request.py | 70 +++++++---- ...aged_worker_create_request_build_config.py | 61 +++++---- ...create_request_build_config_steps_inner.py | 35 +++--- ...ed_worker_create_request_runtime_config.py | 115 ++++++++++++----- .../managed_worker_events_list200_response.py | 52 +++++--- ...rker_events_list200_response_rows_inner.py | 58 +++++---- ...naged_worker_instances_list200_response.py | 52 +++++--- ...r_instances_list200_response_rows_inner.py | 52 ++++---- .../models/managed_worker_list200_response.py | 52 +++++--- ...aged_worker_list200_response_rows_inner.py | 94 ++++++++++---- ...ist200_response_rows_inner_build_config.py | 95 +++++++++----- ...nse_rows_inner_build_config_steps_inner.py | 50 +++++--- ...sponse_rows_inner_runtime_configs_inner.py | 117 +++++++++++++----- .../models/managed_worker_update_request.py | 75 +++++++---- .../models/metadata_get200_response.py | 44 ++++--- .../models/metadata_get400_response.py | 38 +++--- .../metadata_get400_response_errors_inner.py | 45 ++++--- .../metrics_cpu_get200_response_inner.py | 40 +++--- ..._get200_response_inner_histograms_inner.py | 39 +++--- ...sponse_inner_histograms_inner_histogram.py | 48 ++++--- ...istograms_inner_histogram_buckets_inner.py | 30 ++--- ...runtime_config_list_actions200_response.py | 20 ++- .../models/subscription_upsert200_response.py | 55 ++++---- .../models/subscription_upsert_request.py | 27 ++-- .../tenant_billing_state_get200_response.py | 103 +++++++++++---- ...ing_state_get200_response_coupons_inner.py | 91 +++++++++----- ...e_get200_response_payment_methods_inner.py | 42 ++++--- ...lling_state_get200_response_plans_inner.py | 44 ++++--- ...ling_state_get200_response_subscription.py | 55 ++++---- ...flow_run_events_get_metrics200_response.py | 40 +++--- ...s_get_metrics200_response_results_inner.py | 45 ++++--- hatchet_sdk/compute/managed_compute.py | 10 +- hatchet_sdk/loader.py | 19 ++- hatchet_sdk/worker/worker.py | 6 +- 51 files changed, 1543 insertions(+), 876 deletions(-) diff --git a/examples/managed/worker.py b/examples/managed/worker.py index fa7a836c..1f74973b 100644 --- a/examples/managed/worker.py +++ b/examples/managed/worker.py @@ -11,9 +11,7 @@ # Default compute -default_compute = Compute( - cpu_kind="shared", cpus=1, memory_mb=1024, regions=["ewr"] -) +default_compute = Compute(cpu_kind="shared", cpus=1, memory_mb=1024, regions=["ewr"]) blocked_compute = Compute( pool="blocked-pool", @@ -23,9 +21,7 @@ regions=["ewr"], ) -gpu_compute = Compute( - cpu_kind="gpu", cpus=2, memory_mb=1024, regions=["ewr"] -) +gpu_compute = Compute(cpu_kind="gpu", cpus=2, memory_mb=1024, regions=["ewr"]) @hatchet.workflow(on_events=["user:create"]) diff --git a/examples/simple/worker.py b/examples/simple/worker.py index ef99e390..f3d23c14 100644 --- a/examples/simple/worker.py +++ b/examples/simple/worker.py @@ -19,7 +19,7 @@ def step1(self, context: Context): return { "step1": "step1", } - + @hatchet.step(timeout="11s", retries=3) def step2(self, context: Context): print("executed step2") diff --git a/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py b/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py index eceffc64..f9ef142e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/build_get200_response.py @@ -13,21 +13,26 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) + + class BuildGet200Response(BaseModel): """ BuildGet200Response - """ # noqa: E501 + """ # noqa: E501 + metadata: Optional[GithubAppListInstallations200ResponseRowsInnerMetadata] = None status: StrictStr status_detail: Optional[StrictStr] = Field(default=None, alias="statusDetail") @@ -35,7 +40,15 @@ class BuildGet200Response(BaseModel): start_time: Optional[datetime] = Field(default=None, alias="startTime") finish_time: Optional[datetime] = Field(default=None, alias="finishTime") build_config_id: StrictStr = Field(alias="buildConfigId") - __properties: ClassVar[List[str]] = ["metadata", "status", "statusDetail", "createTime", "startTime", "finishTime", "buildConfigId"] + __properties: ClassVar[List[str]] = [ + "metadata", + "status", + "statusDetail", + "createTime", + "startTime", + "finishTime", + "buildConfigId", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +56,6 @@ class BuildGet200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +80,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -90,15 +101,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "status": obj.get("status"), - "statusDetail": obj.get("statusDetail"), - "createTime": obj.get("createTime"), - "startTime": obj.get("startTime"), - "finishTime": obj.get("finishTime"), - "buildConfigId": obj.get("buildConfigId") - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "status": obj.get("status"), + "statusDetail": obj.get("statusDetail"), + "createTime": obj.get("createTime"), + "startTime": obj.get("startTime"), + "finishTime": obj.get("finishTime"), + "buildConfigId": obj.get("buildConfigId"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py index 32cf58cf..36454872 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class GithubAppListBranches200ResponseInner(BaseModel): """ GithubAppListBranches200ResponseInner - """ # noqa: E501 + """ # noqa: E501 + branch_name: StrictStr is_default: StrictBool __properties: ClassVar[List[str]] = ["branch_name", "is_default"] @@ -36,7 +38,6 @@ class GithubAppListBranches200ResponseInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "branch_name": obj.get("branch_name"), - "is_default": obj.get("is_default") - }) + _obj = cls.model_validate( + {"branch_name": obj.get("branch_name"), "is_default": obj.get("is_default")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py index b3a3c094..a56fb429 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner import GithubAppListInstallations200ResponseRowsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, +) +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner import ( + GithubAppListInstallations200ResponseRowsInner, +) + + class GithubAppListInstallations200Response(BaseModel): """ GithubAppListInstallations200Response - """ # noqa: E501 + """ # noqa: E501 + pagination: GithubAppListInstallations200ResponsePagination rows: List[GithubAppListInstallations200ResponseRowsInner] __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +45,6 @@ class GithubAppListInstallations200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +78,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [GithubAppListInstallations200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + GithubAppListInstallations200ResponsePagination.from_dict( + obj["pagination"] + ) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [ + GithubAppListInstallations200ResponseRowsInner.from_dict(_item) + for _item in obj["rows"] + ] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py index 8957c4b0..d47ef6ac 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py @@ -13,22 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class GithubAppListInstallations200ResponsePagination(BaseModel): """ GithubAppListInstallations200ResponsePagination - """ # noqa: E501 - current_page: Optional[StrictInt] = Field(default=None, description="the current page") + """ # noqa: E501 + + current_page: Optional[StrictInt] = Field( + default=None, description="the current page" + ) next_page: Optional[StrictInt] = Field(default=None, description="the next page") - num_pages: Optional[StrictInt] = Field(default=None, description="the total number of pages for listing") + num_pages: Optional[StrictInt] = Field( + default=None, description="the total number of pages for listing" + ) __properties: ClassVar[List[str]] = ["current_page", "next_page", "num_pages"] model_config = ConfigDict( @@ -37,7 +43,6 @@ class GithubAppListInstallations200ResponsePagination(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +85,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "current_page": obj.get("current_page"), - "next_page": obj.get("next_page"), - "num_pages": obj.get("num_pages") - }) + _obj = cls.model_validate( + { + "current_page": obj.get("current_page"), + "next_page": obj.get("next_page"), + "num_pages": obj.get("num_pages"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py index 1cc72950..e2561ee5 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner.py @@ -13,25 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) + + class GithubAppListInstallations200ResponseRowsInner(BaseModel): """ GithubAppListInstallations200ResponseRowsInner - """ # noqa: E501 + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata installation_settings_url: StrictStr account_name: StrictStr account_avatar_url: StrictStr - __properties: ClassVar[List[str]] = ["metadata", "installation_settings_url", "account_name", "account_avatar_url"] + __properties: ClassVar[List[str]] = [ + "metadata", + "installation_settings_url", + "account_name", + "account_avatar_url", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +49,6 @@ class GithubAppListInstallations200ResponseRowsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -74,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -86,12 +94,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "installation_settings_url": obj.get("installation_settings_url"), - "account_name": obj.get("account_name"), - "account_avatar_url": obj.get("account_avatar_url") - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "installation_settings_url": obj.get("installation_settings_url"), + "account_name": obj.get("account_name"), + "account_avatar_url": obj.get("account_avatar_url"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py index e3da637a..e1852c71 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py @@ -13,24 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class GithubAppListInstallations200ResponseRowsInnerMetadata(BaseModel): """ GithubAppListInstallations200ResponseRowsInnerMetadata - """ # noqa: E501 - id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(description="the id of this resource, in UUID format") - created_at: datetime = Field(description="the time that this resource was created", alias="createdAt") - updated_at: datetime = Field(description="the time that this resource was last updated", alias="updatedAt") + """ # noqa: E501 + + id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field( + description="the id of this resource, in UUID format" + ) + created_at: datetime = Field( + description="the time that this resource was created", alias="createdAt" + ) + updated_at: datetime = Field( + description="the time that this resource was last updated", alias="updatedAt" + ) __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt"] model_config = ConfigDict( @@ -39,7 +46,6 @@ class GithubAppListInstallations200ResponseRowsInnerMetadata(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,11 +88,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "createdAt": obj.get("createdAt"), - "updatedAt": obj.get("updatedAt") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py b/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py index 4c221155..193ba06f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class GithubAppListRepos200ResponseInner(BaseModel): """ GithubAppListRepos200ResponseInner - """ # noqa: E501 + """ # noqa: E501 + repo_owner: StrictStr repo_name: StrictStr __properties: ClassVar[List[str]] = ["repo_owner", "repo_name"] @@ -36,7 +38,6 @@ class GithubAppListRepos200ResponseInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "repo_owner": obj.get("repo_owner"), - "repo_name": obj.get("repo_name") - }) + _obj = cls.model_validate( + {"repo_owner": obj.get("repo_owner"), "repo_name": obj.get("repo_name")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py index 0d12e172..551f6cfd 100644 --- a/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, +) + + class InfraAsCodeCreateRequest(BaseModel): """ InfraAsCodeCreateRequest - """ # noqa: E501 - runtime_configs: List[ManagedWorkerCreateRequestRuntimeConfig] = Field(alias="runtimeConfigs") + """ # noqa: E501 + + runtime_configs: List[ManagedWorkerCreateRequestRuntimeConfig] = Field( + alias="runtimeConfigs" + ) __properties: ClassVar[List[str]] = ["runtimeConfigs"] model_config = ConfigDict( @@ -36,7 +43,6 @@ class InfraAsCodeCreateRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict['runtimeConfigs'] = _items + _dict["runtimeConfigs"] = _items return _dict @classmethod @@ -87,9 +92,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "runtimeConfigs": [ManagedWorkerCreateRequestRuntimeConfig.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None - }) + _obj = cls.model_validate( + { + "runtimeConfigs": ( + [ + ManagedWorkerCreateRequestRuntimeConfig.from_dict(_item) + for _item in obj["runtimeConfigs"] + ] + if obj.get("runtimeConfigs") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py index 06a2044b..dffc7605 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py @@ -13,30 +13,46 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import LogCreateRequestInnerEvent -from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import LogCreateRequestInnerFly -from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import LogCreateRequestInnerLog -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_event import ( + LogCreateRequestInnerEvent, +) +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly import ( + LogCreateRequestInnerFly, +) +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_log import ( + LogCreateRequestInnerLog, +) + + class LogCreateRequestInner(BaseModel): """ LogCreateRequestInner - """ # noqa: E501 + """ # noqa: E501 + event: Optional[LogCreateRequestInnerEvent] = None fly: Optional[LogCreateRequestInnerFly] = None host: Optional[StrictStr] = None log: Optional[LogCreateRequestInnerLog] = None message: Optional[StrictStr] = None timestamp: Optional[datetime] = None - __properties: ClassVar[List[str]] = ["event", "fly", "host", "log", "message", "timestamp"] + __properties: ClassVar[List[str]] = [ + "event", + "fly", + "host", + "log", + "message", + "timestamp", + ] model_config = ConfigDict( populate_by_name=True, @@ -44,7 +60,6 @@ class LogCreateRequestInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -69,8 +84,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,13 +93,13 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of event if self.event: - _dict['event'] = self.event.to_dict() + _dict["event"] = self.event.to_dict() # override the default output from pydantic by calling `to_dict()` of fly if self.fly: - _dict['fly'] = self.fly.to_dict() + _dict["fly"] = self.fly.to_dict() # override the default output from pydantic by calling `to_dict()` of log if self.log: - _dict['log'] = self.log.to_dict() + _dict["log"] = self.log.to_dict() return _dict @classmethod @@ -97,14 +111,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "event": LogCreateRequestInnerEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, - "fly": LogCreateRequestInnerFly.from_dict(obj["fly"]) if obj.get("fly") is not None else None, - "host": obj.get("host"), - "log": LogCreateRequestInnerLog.from_dict(obj["log"]) if obj.get("log") is not None else None, - "message": obj.get("message"), - "timestamp": obj.get("timestamp") - }) + _obj = cls.model_validate( + { + "event": ( + LogCreateRequestInnerEvent.from_dict(obj["event"]) + if obj.get("event") is not None + else None + ), + "fly": ( + LogCreateRequestInnerFly.from_dict(obj["fly"]) + if obj.get("fly") is not None + else None + ), + "host": obj.get("host"), + "log": ( + LogCreateRequestInnerLog.from_dict(obj["log"]) + if obj.get("log") is not None + else None + ), + "message": obj.get("message"), + "timestamp": obj.get("timestamp"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py index ad98e808..bd426bb6 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class LogCreateRequestInnerEvent(BaseModel): """ LogCreateRequestInnerEvent - """ # noqa: E501 + """ # noqa: E501 + provider: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["provider"] @@ -35,7 +37,6 @@ class LogCreateRequestInnerEvent(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "provider": obj.get("provider") - }) + _obj = cls.model_validate({"provider": obj.get("provider")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py index a2e2895f..646600e0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import LogCreateRequestInnerFlyApp -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.log_create_request_inner_fly_app import ( + LogCreateRequestInnerFlyApp, +) + + class LogCreateRequestInnerFly(BaseModel): """ LogCreateRequestInnerFly - """ # noqa: E501 + """ # noqa: E501 + app: Optional[LogCreateRequestInnerFlyApp] = None region: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["app", "region"] @@ -37,7 +42,6 @@ class LogCreateRequestInnerFly(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of app if self.app: - _dict['app'] = self.app.to_dict() + _dict["app"] = self.app.to_dict() return _dict @classmethod @@ -84,10 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "app": LogCreateRequestInnerFlyApp.from_dict(obj["app"]) if obj.get("app") is not None else None, - "region": obj.get("region") - }) + _obj = cls.model_validate( + { + "app": ( + LogCreateRequestInnerFlyApp.from_dict(obj["app"]) + if obj.get("app") is not None + else None + ), + "region": obj.get("region"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py index 48d25997..0a21524e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class LogCreateRequestInnerFlyApp(BaseModel): """ LogCreateRequestInnerFlyApp - """ # noqa: E501 + """ # noqa: E501 + instance: Optional[StrictStr] = None name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["instance", "name"] @@ -36,7 +38,6 @@ class LogCreateRequestInnerFlyApp(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +62,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "name": obj.get("name") - }) + _obj = cls.model_validate( + {"instance": obj.get("instance"), "name": obj.get("name")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py index 2d47f66f..409b1a8f 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class LogCreateRequestInnerLog(BaseModel): """ LogCreateRequestInnerLog - """ # noqa: E501 + """ # noqa: E501 + level: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["level"] @@ -35,7 +37,6 @@ class LogCreateRequestInnerLog(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "level": obj.get("level") - }) + _obj = cls.model_validate({"level": obj.get("level")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py b/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py index 3b5555fc..816078dc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_list200_response.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination -from hatchet_sdk.clients.cloud_rest.models.log_list200_response_rows_inner import LogList200ResponseRowsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, +) +from hatchet_sdk.clients.cloud_rest.models.log_list200_response_rows_inner import ( + LogList200ResponseRowsInner, +) + + class LogList200Response(BaseModel): """ LogList200Response - """ # noqa: E501 + """ # noqa: E501 + rows: Optional[List[LogList200ResponseRowsInner]] = None pagination: Optional[GithubAppListInstallations200ResponsePagination] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -38,7 +45,6 @@ class LogList200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +82,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -92,10 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rows": [LogList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "rows": ( + [ + LogList200ResponseRowsInner.from_dict(_item) + for _item in obj["rows"] + ] + if obj.get("rows") is not None + else None + ), + "pagination": ( + GithubAppListInstallations200ResponsePagination.from_dict( + obj["pagination"] + ) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py b/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py index 33cc127e..18bfdb64 100644 --- a/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/log_list200_response_rows_inner.py @@ -13,20 +13,22 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class LogList200ResponseRowsInner(BaseModel): """ LogList200ResponseRowsInner - """ # noqa: E501 + """ # noqa: E501 + timestamp: datetime instance: StrictStr line: StrictStr @@ -38,7 +40,6 @@ class LogList200ResponseRowsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,11 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "instance": obj.get("instance"), - "line": obj.get("line") - }) + _obj = cls.model_validate( + { + "timestamp": obj.get("timestamp"), + "instance": obj.get("instance"), + "line": obj.get("line"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py index 87f31abe..1b42a571 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py @@ -13,27 +13,45 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ManagedWorkerCreateRequestBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ( + ManagedWorkerCreateRequestBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, +) + + class ManagedWorkerCreateRequest(BaseModel): """ ManagedWorkerCreateRequest - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr build_config: ManagedWorkerCreateRequestBuildConfig = Field(alias="buildConfig") - env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") + env_vars: Dict[str, StrictStr] = Field( + description="A map of environment variables to set for the worker", + alias="envVars", + ) is_iac: StrictBool = Field(alias="isIac") - runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(default=None, alias="runtimeConfig") - __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field( + default=None, alias="runtimeConfig" + ) + __properties: ClassVar[List[str]] = [ + "name", + "buildConfig", + "envVars", + "isIac", + "runtimeConfig", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +59,6 @@ class ManagedWorkerCreateRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +83,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,10 +92,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict['runtimeConfig'] = self.runtime_config.to_dict() + _dict["runtimeConfig"] = self.runtime_config.to_dict() return _dict @classmethod @@ -91,12 +107,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "buildConfig": ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfig": ManagedWorkerCreateRequestRuntimeConfig.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "buildConfig": ( + ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfig": ( + ManagedWorkerCreateRequestRuntimeConfig.from_dict( + obj["runtimeConfig"] + ) + if obj.get("runtimeConfig") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py index 7e02fecc..0b5e59bd 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py @@ -13,27 +13,39 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import ManagedWorkerCreateRequestBuildConfigStepsInner -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config_steps_inner import ( + ManagedWorkerCreateRequestBuildConfigStepsInner, +) + class ManagedWorkerCreateRequestBuildConfig(BaseModel): """ ManagedWorkerCreateRequestBuildConfig - """ # noqa: E501 - github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") + """ # noqa: E501 + + github_installation_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36) + ] = Field(alias="githubInstallationId") github_repository_owner: StrictStr = Field(alias="githubRepositoryOwner") github_repository_name: StrictStr = Field(alias="githubRepositoryName") github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") steps: List[ManagedWorkerCreateRequestBuildConfigStepsInner] - __properties: ClassVar[List[str]] = ["githubInstallationId", "githubRepositoryOwner", "githubRepositoryName", "githubRepositoryBranch", "steps"] + __properties: ClassVar[List[str]] = [ + "githubInstallationId", + "githubRepositoryOwner", + "githubRepositoryName", + "githubRepositoryBranch", + "steps", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +53,6 @@ class ManagedWorkerCreateRequestBuildConfig(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict['steps'] = _items + _dict["steps"] = _items return _dict @classmethod @@ -92,13 +102,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepositoryOwner": obj.get("githubRepositoryOwner"), - "githubRepositoryName": obj.get("githubRepositoryName"), - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": [ManagedWorkerCreateRequestBuildConfigStepsInner.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None - }) + _obj = cls.model_validate( + { + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepositoryOwner": obj.get("githubRepositoryOwner"), + "githubRepositoryName": obj.get("githubRepositoryName"), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": ( + [ + ManagedWorkerCreateRequestBuildConfigStepsInner.from_dict(_item) + for _item in obj["steps"] + ] + if obj.get("steps") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py index 32fefa07..9914524e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel): """ ManagedWorkerCreateRequestBuildConfigStepsInner - """ # noqa: E501 - build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") - dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + """ # noqa: E501 + + build_dir: StrictStr = Field( + description="The relative path to the build directory", alias="buildDir" + ) + dockerfile_path: StrictStr = Field( + description="The relative path from the build dir to the Dockerfile", + alias="dockerfilePath", + ) __properties: ClassVar[List[str]] = ["buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -36,7 +43,6 @@ class ManagedWorkerCreateRequestBuildConfigStepsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +85,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath") - }) + _obj = cls.model_validate( + { + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py index 0da544d7..7dff4205 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py @@ -13,37 +13,95 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + class ManagedWorkerCreateRequestRuntimeConfig(BaseModel): """ ManagedWorkerCreateRequestRuntimeConfig - """ # noqa: E501 - num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field(alias="numReplicas") - regions: Optional[List[StrictStr]] = Field(default=None, description="The region to deploy the worker to") - cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") - cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field(description="The number of CPUs to use for the worker") - memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") - actions: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["numReplicas", "regions", "cpuKind", "cpus", "memoryMb", "actions"] + """ # noqa: E501 - @field_validator('regions') + num_replicas: Annotated[int, Field(le=1000, strict=True, ge=0)] = Field( + alias="numReplicas" + ) + regions: Optional[List[StrictStr]] = Field( + default=None, description="The region to deploy the worker to" + ) + cpu_kind: StrictStr = Field( + description="The kind of CPU to use for the worker", alias="cpuKind" + ) + cpus: Annotated[int, Field(le=64, strict=True, ge=1)] = Field( + description="The number of CPUs to use for the worker" + ) + memory_mb: Annotated[int, Field(le=65536, strict=True, ge=1024)] = Field( + description="The amount of memory in MB to use for the worker", alias="memoryMb" + ) + actions: Optional[List[StrictStr]] = None + slots: Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]] = None + __properties: ClassVar[List[str]] = [ + "numReplicas", + "regions", + "cpuKind", + "cpus", + "memoryMb", + "actions", + "slots", + ] + + @field_validator("regions") def regions_validate_enum(cls, value): """Validates the enum""" if value is None: return value for i in value: - if i not in set(['ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz']): - raise ValueError("each list item must be one of ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')") + if i not in set( + [ + "ams", + "arn", + "atl", + "bog", + "bos", + "cdg", + "den", + "dfw", + "ewr", + "eze", + "gdl", + "gig", + "gru", + "hkg", + "iad", + "jnb", + "lax", + "lhr", + "mad", + "mia", + "nrt", + "ord", + "otp", + "phx", + "qro", + "scl", + "sea", + "sin", + "sjc", + "syd", + "waw", + "yul", + "yyz", + ] + ): + raise ValueError( + "each list item must be one of ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')" + ) return value model_config = ConfigDict( @@ -52,7 +110,6 @@ def regions_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -77,8 +134,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -96,14 +152,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "numReplicas": obj.get("numReplicas"), - "regions": obj.get("regions"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "actions": obj.get("actions") - }) + _obj = cls.model_validate( + { + "numReplicas": obj.get("numReplicas"), + "regions": obj.get("regions"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "actions": obj.get("actions"), + "slots": obj.get("slots"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py index 07075eb4..3928468e 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination -from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import ManagedWorkerEventsList200ResponseRowsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response_rows_inner import ( + ManagedWorkerEventsList200ResponseRowsInner, +) + + class ManagedWorkerEventsList200Response(BaseModel): """ ManagedWorkerEventsList200Response - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None rows: Optional[List[ManagedWorkerEventsList200ResponseRowsInner]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +45,6 @@ class ManagedWorkerEventsList200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +78,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [ManagedWorkerEventsList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + GithubAppListInstallations200ResponsePagination.from_dict( + obj["pagination"] + ) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [ + ManagedWorkerEventsList200ResponseRowsInner.from_dict(_item) + for _item in obj["rows"] + ] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py index 77504d3f..7dc23777 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py @@ -13,20 +13,22 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class ManagedWorkerEventsList200ResponseRowsInner(BaseModel): """ ManagedWorkerEventsList200ResponseRowsInner - """ # noqa: E501 + """ # noqa: E501 + id: StrictInt time_first_seen: datetime = Field(alias="timeFirstSeen") time_last_seen: datetime = Field(alias="timeLastSeen") @@ -34,13 +36,23 @@ class ManagedWorkerEventsList200ResponseRowsInner(BaseModel): status: StrictStr message: StrictStr data: Dict[str, Any] - __properties: ClassVar[List[str]] = ["id", "timeFirstSeen", "timeLastSeen", "managedWorkerId", "status", "message", "data"] - - @field_validator('status') + __properties: ClassVar[List[str]] = [ + "id", + "timeFirstSeen", + "timeLastSeen", + "managedWorkerId", + "status", + "message", + "data", + ] + + @field_validator("status") def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED']): - raise ValueError("must be one of enum values ('IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED')") + if value not in set(["IN_PROGRESS", "SUCCEEDED", "FAILED", "CANCELLED"]): + raise ValueError( + "must be one of enum values ('IN_PROGRESS', 'SUCCEEDED', 'FAILED', 'CANCELLED')" + ) return value model_config = ConfigDict( @@ -49,7 +61,6 @@ def status_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -74,8 +85,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -93,15 +103,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "id": obj.get("id"), - "timeFirstSeen": obj.get("timeFirstSeen"), - "timeLastSeen": obj.get("timeLastSeen"), - "managedWorkerId": obj.get("managedWorkerId"), - "status": obj.get("status"), - "message": obj.get("message"), - "data": obj.get("data") - }) + _obj = cls.model_validate( + { + "id": obj.get("id"), + "timeFirstSeen": obj.get("timeFirstSeen"), + "timeLastSeen": obj.get("timeLastSeen"), + "managedWorkerId": obj.get("managedWorkerId"), + "status": obj.get("status"), + "message": obj.get("message"), + "data": obj.get("data"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py index 443076b4..bbe6375d 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination -from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response_rows_inner import ManagedWorkerInstancesList200ResponseRowsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response_rows_inner import ( + ManagedWorkerInstancesList200ResponseRowsInner, +) + + class ManagedWorkerInstancesList200Response(BaseModel): """ ManagedWorkerInstancesList200Response - """ # noqa: E501 + """ # noqa: E501 + pagination: Optional[GithubAppListInstallations200ResponsePagination] = None rows: Optional[List[ManagedWorkerInstancesList200ResponseRowsInner]] = None __properties: ClassVar[List[str]] = ["pagination", "rows"] @@ -38,7 +45,6 @@ class ManagedWorkerInstancesList200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,14 +78,14 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items return _dict @classmethod @@ -92,10 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "rows": [ManagedWorkerInstancesList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None - }) + _obj = cls.model_validate( + { + "pagination": ( + GithubAppListInstallations200ResponsePagination.from_dict( + obj["pagination"] + ) + if obj.get("pagination") is not None + else None + ), + "rows": ( + [ + ManagedWorkerInstancesList200ResponseRowsInner.from_dict(_item) + for _item in obj["rows"] + ] + if obj.get("rows") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py index 0351e40a..d288a1d1 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class ManagedWorkerInstancesList200ResponseRowsInner(BaseModel): """ ManagedWorkerInstancesList200ResponseRowsInner - """ # noqa: E501 + """ # noqa: E501 + instance_id: StrictStr = Field(alias="instanceId") name: StrictStr region: StrictStr @@ -35,7 +37,17 @@ class ManagedWorkerInstancesList200ResponseRowsInner(BaseModel): memory_mb: StrictInt = Field(alias="memoryMb") disk_gb: StrictInt = Field(alias="diskGb") commit_sha: StrictStr = Field(alias="commitSha") - __properties: ClassVar[List[str]] = ["instanceId", "name", "region", "state", "cpuKind", "cpus", "memoryMb", "diskGb", "commitSha"] + __properties: ClassVar[List[str]] = [ + "instanceId", + "name", + "region", + "state", + "cpuKind", + "cpus", + "memoryMb", + "diskGb", + "commitSha", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +55,6 @@ class ManagedWorkerInstancesList200ResponseRowsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +79,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -87,17 +97,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "name": obj.get("name"), - "region": obj.get("region"), - "state": obj.get("state"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "diskGb": obj.get("diskGb"), - "commitSha": obj.get("commitSha") - }) + _obj = cls.model_validate( + { + "instanceId": obj.get("instanceId"), + "name": obj.get("name"), + "region": obj.get("region"), + "state": obj.get("state"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "diskGb": obj.get("diskGb"), + "commitSha": obj.get("commitSha"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py index d0656b02..30f96ecc 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response.py @@ -13,21 +13,28 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import GithubAppListInstallations200ResponsePagination -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ManagedWorkerList200ResponseRowsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_pagination import ( + GithubAppListInstallations200ResponsePagination, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import ( + ManagedWorkerList200ResponseRowsInner, +) + + class ManagedWorkerList200Response(BaseModel): """ ManagedWorkerList200Response - """ # noqa: E501 + """ # noqa: E501 + rows: Optional[List[ManagedWorkerList200ResponseRowsInner]] = None pagination: Optional[GithubAppListInstallations200ResponsePagination] = None __properties: ClassVar[List[str]] = ["rows", "pagination"] @@ -38,7 +45,6 @@ class ManagedWorkerList200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,10 +82,10 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.rows: if _item: _items.append(_item.to_dict()) - _dict['rows'] = _items + _dict["rows"] = _items # override the default output from pydantic by calling `to_dict()` of pagination if self.pagination: - _dict['pagination'] = self.pagination.to_dict() + _dict["pagination"] = self.pagination.to_dict() return _dict @classmethod @@ -92,10 +97,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "rows": [ManagedWorkerList200ResponseRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None, - "pagination": GithubAppListInstallations200ResponsePagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) + _obj = cls.model_validate( + { + "rows": ( + [ + ManagedWorkerList200ResponseRowsInner.from_dict(_item) + for _item in obj["rows"] + ] + if obj.get("rows") is not None + else None + ), + "pagination": ( + GithubAppListInstallations200ResponsePagination.from_dict( + obj["pagination"] + ) + if obj.get("pagination") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py index 99224904..765a37ab 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py @@ -13,29 +13,52 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import ManagedWorkerList200ResponseRowsInnerBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config import ( + ManagedWorkerList200ResponseRowsInnerBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_runtime_configs_inner import ( + ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner, +) + + class ManagedWorkerList200ResponseRowsInner(BaseModel): """ ManagedWorkerList200ResponseRowsInner - """ # noqa: E501 + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata name: StrictStr - build_config: ManagedWorkerList200ResponseRowsInnerBuildConfig = Field(alias="buildConfig") + build_config: ManagedWorkerList200ResponseRowsInnerBuildConfig = Field( + alias="buildConfig" + ) is_iac: StrictBool = Field(alias="isIac") - env_vars: Dict[str, StrictStr] = Field(description="A map of environment variables to set for the worker", alias="envVars") - runtime_configs: Optional[List[ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner]] = Field(default=None, alias="runtimeConfigs") - __properties: ClassVar[List[str]] = ["metadata", "name", "buildConfig", "isIac", "envVars", "runtimeConfigs"] + env_vars: Dict[str, StrictStr] = Field( + description="A map of environment variables to set for the worker", + alias="envVars", + ) + runtime_configs: Optional[ + List[ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner] + ] = Field(default=None, alias="runtimeConfigs") + __properties: ClassVar[List[str]] = [ + "metadata", + "name", + "buildConfig", + "isIac", + "envVars", + "runtimeConfigs", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +66,6 @@ class ManagedWorkerList200ResponseRowsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +90,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,17 +99,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in runtime_configs (list) _items = [] if self.runtime_configs: for _item in self.runtime_configs: if _item: _items.append(_item.to_dict()) - _dict['runtimeConfigs'] = _items + _dict["runtimeConfigs"] = _items return _dict @classmethod @@ -100,13 +121,34 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "name": obj.get("name"), - "buildConfig": ManagedWorkerList200ResponseRowsInnerBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfigs": [ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner.from_dict(_item) for _item in obj["runtimeConfigs"]] if obj.get("runtimeConfigs") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "name": obj.get("name"), + "buildConfig": ( + ManagedWorkerList200ResponseRowsInnerBuildConfig.from_dict( + obj["buildConfig"] + ) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfigs": ( + [ + ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner.from_dict( + _item + ) + for _item in obj["runtimeConfigs"] + ] + if obj.get("runtimeConfigs") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py index 23d72f17..9e80c9be 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py @@ -13,29 +13,49 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import GithubAppListRepos200ResponseInner -from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner -from typing import Optional, Set -from typing_extensions import Self +from typing_extensions import Annotated, Self + +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) +from hatchet_sdk.clients.cloud_rest.models.github_app_list_repos200_response_inner import ( + GithubAppListRepos200ResponseInner, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner_build_config_steps_inner import ( + ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner, +) + class ManagedWorkerList200ResponseRowsInnerBuildConfig(BaseModel): """ ManagedWorkerList200ResponseRowsInnerBuildConfig - """ # noqa: E501 + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata - github_installation_id: Annotated[str, Field(min_length=36, strict=True, max_length=36)] = Field(alias="githubInstallationId") - github_repository: GithubAppListRepos200ResponseInner = Field(alias="githubRepository") + github_installation_id: Annotated[ + str, Field(min_length=36, strict=True, max_length=36) + ] = Field(alias="githubInstallationId") + github_repository: GithubAppListRepos200ResponseInner = Field( + alias="githubRepository" + ) github_repository_branch: StrictStr = Field(alias="githubRepositoryBranch") - steps: Optional[List[ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner]] = None - __properties: ClassVar[List[str]] = ["metadata", "githubInstallationId", "githubRepository", "githubRepositoryBranch", "steps"] + steps: Optional[ + List[ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner] + ] = None + __properties: ClassVar[List[str]] = [ + "metadata", + "githubInstallationId", + "githubRepository", + "githubRepositoryBranch", + "steps", + ] model_config = ConfigDict( populate_by_name=True, @@ -43,7 +63,6 @@ class ManagedWorkerList200ResponseRowsInnerBuildConfig(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -68,8 +87,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -78,17 +96,17 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of github_repository if self.github_repository: - _dict['githubRepository'] = self.github_repository.to_dict() + _dict["githubRepository"] = self.github_repository.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in steps (list) _items = [] if self.steps: for _item in self.steps: if _item: _items.append(_item.to_dict()) - _dict['steps'] = _items + _dict["steps"] = _items return _dict @classmethod @@ -100,13 +118,34 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "githubInstallationId": obj.get("githubInstallationId"), - "githubRepository": GithubAppListRepos200ResponseInner.from_dict(obj["githubRepository"]) if obj.get("githubRepository") is not None else None, - "githubRepositoryBranch": obj.get("githubRepositoryBranch"), - "steps": [ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "githubInstallationId": obj.get("githubInstallationId"), + "githubRepository": ( + GithubAppListRepos200ResponseInner.from_dict( + obj["githubRepository"] + ) + if obj.get("githubRepository") is not None + else None + ), + "githubRepositoryBranch": obj.get("githubRepositoryBranch"), + "steps": ( + [ + ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner.from_dict( + _item + ) + for _item in obj["steps"] + ] + if obj.get("steps") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py index 23404c75..6581f902 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py @@ -13,23 +13,33 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) + + class ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner(BaseModel): """ ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner - """ # noqa: E501 + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata - build_dir: StrictStr = Field(description="The relative path to the build directory", alias="buildDir") - dockerfile_path: StrictStr = Field(description="The relative path from the build dir to the Dockerfile", alias="dockerfilePath") + build_dir: StrictStr = Field( + description="The relative path to the build directory", alias="buildDir" + ) + dockerfile_path: StrictStr = Field( + description="The relative path from the build dir to the Dockerfile", + alias="dockerfilePath", + ) __properties: ClassVar[List[str]] = ["metadata", "buildDir", "dockerfilePath"] model_config = ConfigDict( @@ -38,7 +48,6 @@ class ManagedWorkerList200ResponseRowsInnerBuildConfigStepsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +72,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -73,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -85,11 +93,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "buildDir": obj.get("buildDir"), - "dockerfilePath": obj.get("dockerfilePath") - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "buildDir": obj.get("buildDir"), + "dockerfilePath": obj.get("dockerfilePath"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py index 57d19105..945aa793 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py @@ -13,34 +13,91 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import GithubAppListInstallations200ResponseRowsInnerMetadata -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.github_app_list_installations200_response_rows_inner_metadata import ( + GithubAppListInstallations200ResponseRowsInnerMetadata, +) + + class ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner(BaseModel): """ ManagedWorkerList200ResponseRowsInnerRuntimeConfigsInner - """ # noqa: E501 + """ # noqa: E501 + metadata: GithubAppListInstallations200ResponseRowsInnerMetadata num_replicas: StrictInt = Field(alias="numReplicas") - cpu_kind: StrictStr = Field(description="The kind of CPU to use for the worker", alias="cpuKind") + cpu_kind: StrictStr = Field( + description="The kind of CPU to use for the worker", alias="cpuKind" + ) cpus: StrictInt = Field(description="The number of CPUs to use for the worker") - memory_mb: StrictInt = Field(description="The amount of memory in MB to use for the worker", alias="memoryMb") + memory_mb: StrictInt = Field( + description="The amount of memory in MB to use for the worker", alias="memoryMb" + ) region: StrictStr = Field(description="The region that the worker is deployed to") - actions: Optional[List[StrictStr]] = Field(default=None, description="A list of actions this runtime config corresponds to") - __properties: ClassVar[List[str]] = ["metadata", "numReplicas", "cpuKind", "cpus", "memoryMb", "region", "actions"] - - @field_validator('region') + actions: Optional[List[StrictStr]] = Field( + default=None, description="A list of actions this runtime config corresponds to" + ) + __properties: ClassVar[List[str]] = [ + "metadata", + "numReplicas", + "cpuKind", + "cpus", + "memoryMb", + "region", + "actions", + ] + + @field_validator("region") def region_validate_enum(cls, value): """Validates the enum""" - if value not in set(['ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz']): - raise ValueError("must be one of enum values ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')") + if value not in set( + [ + "ams", + "arn", + "atl", + "bog", + "bos", + "cdg", + "den", + "dfw", + "ewr", + "eze", + "gdl", + "gig", + "gru", + "hkg", + "iad", + "jnb", + "lax", + "lhr", + "mad", + "mia", + "nrt", + "ord", + "otp", + "phx", + "qro", + "scl", + "sea", + "sin", + "sjc", + "syd", + "waw", + "yul", + "yyz", + ] + ): + raise ValueError( + "must be one of enum values ('ams', 'arn', 'atl', 'bog', 'bos', 'cdg', 'den', 'dfw', 'ewr', 'eze', 'gdl', 'gig', 'gru', 'hkg', 'iad', 'jnb', 'lax', 'lhr', 'mad', 'mia', 'nrt', 'ord', 'otp', 'phx', 'qro', 'scl', 'sea', 'sin', 'sjc', 'syd', 'waw', 'yul', 'yyz')" + ) return value model_config = ConfigDict( @@ -49,7 +106,6 @@ def region_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -74,8 +130,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -84,7 +139,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: - _dict['metadata'] = self.metadata.to_dict() + _dict["metadata"] = self.metadata.to_dict() return _dict @classmethod @@ -96,15 +151,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "metadata": GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, - "numReplicas": obj.get("numReplicas"), - "cpuKind": obj.get("cpuKind"), - "cpus": obj.get("cpus"), - "memoryMb": obj.get("memoryMb"), - "region": obj.get("region"), - "actions": obj.get("actions") - }) + _obj = cls.model_validate( + { + "metadata": ( + GithubAppListInstallations200ResponseRowsInnerMetadata.from_dict( + obj["metadata"] + ) + if obj.get("metadata") is not None + else None + ), + "numReplicas": obj.get("numReplicas"), + "cpuKind": obj.get("cpuKind"), + "cpus": obj.get("cpus"), + "memoryMb": obj.get("memoryMb"), + "region": obj.get("region"), + "actions": obj.get("actions"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py b/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py index f77d5642..283c1795 100644 --- a/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py @@ -13,27 +13,48 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ManagedWorkerCreateRequestBuildConfig -from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ManagedWorkerCreateRequestRuntimeConfig -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_build_config import ( + ManagedWorkerCreateRequestBuildConfig, +) +from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( + ManagedWorkerCreateRequestRuntimeConfig, +) + + class ManagedWorkerUpdateRequest(BaseModel): """ ManagedWorkerUpdateRequest - """ # noqa: E501 + """ # noqa: E501 + name: Optional[StrictStr] = None - build_config: Optional[ManagedWorkerCreateRequestBuildConfig] = Field(default=None, alias="buildConfig") - env_vars: Optional[Dict[str, StrictStr]] = Field(default=None, description="A map of environment variables to set for the worker", alias="envVars") + build_config: Optional[ManagedWorkerCreateRequestBuildConfig] = Field( + default=None, alias="buildConfig" + ) + env_vars: Optional[Dict[str, StrictStr]] = Field( + default=None, + description="A map of environment variables to set for the worker", + alias="envVars", + ) is_iac: Optional[StrictBool] = Field(default=None, alias="isIac") - runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field(default=None, alias="runtimeConfig") - __properties: ClassVar[List[str]] = ["name", "buildConfig", "envVars", "isIac", "runtimeConfig"] + runtime_config: Optional[ManagedWorkerCreateRequestRuntimeConfig] = Field( + default=None, alias="runtimeConfig" + ) + __properties: ClassVar[List[str]] = [ + "name", + "buildConfig", + "envVars", + "isIac", + "runtimeConfig", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +62,6 @@ class ManagedWorkerUpdateRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +86,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -76,10 +95,10 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of build_config if self.build_config: - _dict['buildConfig'] = self.build_config.to_dict() + _dict["buildConfig"] = self.build_config.to_dict() # override the default output from pydantic by calling `to_dict()` of runtime_config if self.runtime_config: - _dict['runtimeConfig'] = self.runtime_config.to_dict() + _dict["runtimeConfig"] = self.runtime_config.to_dict() return _dict @classmethod @@ -91,12 +110,22 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "buildConfig": ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) if obj.get("buildConfig") is not None else None, - "isIac": obj.get("isIac"), - "runtimeConfig": ManagedWorkerCreateRequestRuntimeConfig.from_dict(obj["runtimeConfig"]) if obj.get("runtimeConfig") is not None else None - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "buildConfig": ( + ManagedWorkerCreateRequestBuildConfig.from_dict(obj["buildConfig"]) + if obj.get("buildConfig") is not None + else None + ), + "isIac": obj.get("isIac"), + "runtimeConfig": ( + ManagedWorkerCreateRequestRuntimeConfig.from_dict( + obj["runtimeConfig"] + ) + if obj.get("runtimeConfig") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py index f44ffcaa..f714f598 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py @@ -13,22 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class MetadataGet200Response(BaseModel): """ MetadataGet200Response - """ # noqa: E501 - can_bill: Optional[StrictBool] = Field(default=None, description="whether the tenant can be billed", alias="canBill") - can_link_github: Optional[StrictBool] = Field(default=None, description="whether the tenant can link to GitHub", alias="canLinkGithub") - metrics_enabled: Optional[StrictBool] = Field(default=None, description="whether metrics are enabled for the tenant", alias="metricsEnabled") + """ # noqa: E501 + + can_bill: Optional[StrictBool] = Field( + default=None, description="whether the tenant can be billed", alias="canBill" + ) + can_link_github: Optional[StrictBool] = Field( + default=None, + description="whether the tenant can link to GitHub", + alias="canLinkGithub", + ) + metrics_enabled: Optional[StrictBool] = Field( + default=None, + description="whether metrics are enabled for the tenant", + alias="metricsEnabled", + ) __properties: ClassVar[List[str]] = ["canBill", "canLinkGithub", "metricsEnabled"] model_config = ConfigDict( @@ -37,7 +49,6 @@ class MetadataGet200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,11 +91,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "canBill": obj.get("canBill"), - "canLinkGithub": obj.get("canLinkGithub"), - "metricsEnabled": obj.get("metricsEnabled") - }) + _obj = cls.model_validate( + { + "canBill": obj.get("canBill"), + "canLinkGithub": obj.get("canLinkGithub"), + "metricsEnabled": obj.get("metricsEnabled"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py index dd552bf3..a456a027 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response_errors_inner import MetadataGet400ResponseErrorsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.metadata_get400_response_errors_inner import ( + MetadataGet400ResponseErrorsInner, +) + + class MetadataGet400Response(BaseModel): """ MetadataGet400Response - """ # noqa: E501 + """ # noqa: E501 + errors: List[MetadataGet400ResponseErrorsInner] __properties: ClassVar[List[str]] = ["errors"] @@ -36,7 +41,6 @@ class MetadataGet400Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.errors: if _item: _items.append(_item.to_dict()) - _dict['errors'] = _items + _dict["errors"] = _items return _dict @classmethod @@ -87,9 +90,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "errors": [MetadataGet400ResponseErrorsInner.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None - }) + _obj = cls.model_validate( + { + "errors": ( + [ + MetadataGet400ResponseErrorsInner.from_dict(_item) + for _item in obj["errors"] + ] + if obj.get("errors") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py index 6e40fe0f..8d2808d5 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py @@ -13,23 +13,34 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class MetadataGet400ResponseErrorsInner(BaseModel): """ MetadataGet400ResponseErrorsInner - """ # noqa: E501 - code: Optional[StrictInt] = Field(default=None, description="a custom Hatchet error code") - var_field: Optional[StrictStr] = Field(default=None, description="the field that this error is associated with, if applicable", alias="field") + """ # noqa: E501 + + code: Optional[StrictInt] = Field( + default=None, description="a custom Hatchet error code" + ) + var_field: Optional[StrictStr] = Field( + default=None, + description="the field that this error is associated with, if applicable", + alias="field", + ) description: StrictStr = Field(description="a description for this error") - docs_link: Optional[StrictStr] = Field(default=None, description="a link to the documentation for this error, if it exists") + docs_link: Optional[StrictStr] = Field( + default=None, + description="a link to the documentation for this error, if it exists", + ) __properties: ClassVar[List[str]] = ["code", "field", "description", "docs_link"] model_config = ConfigDict( @@ -38,7 +49,6 @@ class MetadataGet400ResponseErrorsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "code": obj.get("code"), - "field": obj.get("field"), - "description": obj.get("description"), - "docs_link": obj.get("docs_link") - }) + _obj = cls.model_validate( + { + "code": obj.get("code"), + "field": obj.get("field"), + "description": obj.get("description"), + "docs_link": obj.get("docs_link"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py index 40918823..67bff649 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner import MetricsCpuGet200ResponseInnerHistogramsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInner, +) + + class MetricsCpuGet200ResponseInner(BaseModel): """ MetricsCpuGet200ResponseInner - """ # noqa: E501 + """ # noqa: E501 + metric: Optional[Dict[str, StrictStr]] = None values: Optional[List[List[StrictStr]]] = None histograms: Optional[List[MetricsCpuGet200ResponseInnerHistogramsInner]] = None @@ -38,7 +43,6 @@ class MetricsCpuGet200ResponseInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +67,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.histograms: if _item: _items.append(_item.to_dict()) - _dict['histograms'] = _items + _dict["histograms"] = _items return _dict @classmethod @@ -89,10 +92,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "values": obj.get("values"), - "histograms": [MetricsCpuGet200ResponseInnerHistogramsInner.from_dict(_item) for _item in obj["histograms"]] if obj.get("histograms") is not None else None - }) + _obj = cls.model_validate( + { + "values": obj.get("values"), + "histograms": ( + [ + MetricsCpuGet200ResponseInnerHistogramsInner.from_dict(_item) + for _item in obj["histograms"] + ] + if obj.get("histograms") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py index 14c82abc..bddc25c0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram import MetricsCpuGet200ResponseInnerHistogramsInnerHistogram -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogram, +) + + class MetricsCpuGet200ResponseInnerHistogramsInner(BaseModel): """ MetricsCpuGet200ResponseInnerHistogramsInner - """ # noqa: E501 + """ # noqa: E501 + timestamp: Optional[StrictInt] = None histogram: Optional[MetricsCpuGet200ResponseInnerHistogramsInnerHistogram] = None __properties: ClassVar[List[str]] = ["timestamp", "histogram"] @@ -37,7 +42,6 @@ class MetricsCpuGet200ResponseInnerHistogramsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -62,8 +66,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -72,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: ) # override the default output from pydantic by calling `to_dict()` of histogram if self.histogram: - _dict['histogram'] = self.histogram.to_dict() + _dict["histogram"] = self.histogram.to_dict() return _dict @classmethod @@ -84,10 +87,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "histogram": MetricsCpuGet200ResponseInnerHistogramsInnerHistogram.from_dict(obj["histogram"]) if obj.get("histogram") is not None else None - }) + _obj = cls.model_validate( + { + "timestamp": obj.get("timestamp"), + "histogram": ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogram.from_dict( + obj["histogram"] + ) + if obj.get("histogram") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py index ffcf789a..4ea774f4 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py @@ -13,23 +13,30 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner import MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner import ( + MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner, +) + + class MetricsCpuGet200ResponseInnerHistogramsInnerHistogram(BaseModel): """ MetricsCpuGet200ResponseInnerHistogramsInnerHistogram - """ # noqa: E501 + """ # noqa: E501 + count: Optional[Union[StrictFloat, StrictInt]] = None sum: Optional[Union[StrictFloat, StrictInt]] = None - buckets: Optional[List[MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner]] = None + buckets: Optional[ + List[MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner] + ] = None __properties: ClassVar[List[str]] = ["count", "sum", "buckets"] model_config = ConfigDict( @@ -38,7 +45,6 @@ class MetricsCpuGet200ResponseInnerHistogramsInnerHistogram(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +69,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -77,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.buckets: if _item: _items.append(_item.to_dict()) - _dict['buckets'] = _items + _dict["buckets"] = _items return _dict @classmethod @@ -89,11 +94,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "count": obj.get("count"), - "sum": obj.get("sum"), - "buckets": [MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner.from_dict(_item) for _item in obj["buckets"]] if obj.get("buckets") is not None else None - }) + _obj = cls.model_validate( + { + "count": obj.get("count"), + "sum": obj.get("sum"), + "buckets": ( + [ + MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner.from_dict( + _item + ) + for _item in obj["buckets"] + ] + if obj.get("buckets") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py index 96919b2c..18a3ae3b 100644 --- a/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set from typing_extensions import Self + class MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner(BaseModel): """ MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner - """ # noqa: E501 + """ # noqa: E501 + boundaries: Optional[StrictInt] = None lower: Optional[Union[StrictFloat, StrictInt]] = None upper: Optional[Union[StrictFloat, StrictInt]] = None @@ -38,7 +40,6 @@ class MetricsCpuGet200ResponseInnerHistogramsInnerHistogramBucketsInner(BaseMode protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +82,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "boundaries": obj.get("boundaries"), - "lower": obj.get("lower"), - "upper": obj.get("upper"), - "count": obj.get("count") - }) + _obj = cls.model_validate( + { + "boundaries": obj.get("boundaries"), + "lower": obj.get("lower"), + "upper": obj.get("upper"), + "count": obj.get("count"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py b/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py index 5c10ff38..257b3a58 100644 --- a/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py @@ -13,19 +13,21 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class RuntimeConfigListActions200Response(BaseModel): """ RuntimeConfigListActions200Response - """ # noqa: E501 + """ # noqa: E501 + actions: List[StrictStr] __properties: ClassVar[List[str]] = ["actions"] @@ -35,7 +37,6 @@ class RuntimeConfigListActions200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -60,8 +61,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "actions": obj.get("actions") - }) + _obj = cls.model_validate({"actions": obj.get("actions")}) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py index 5ba0d227..42b4cf18 100644 --- a/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py @@ -13,33 +13,46 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class SubscriptionUpsert200Response(BaseModel): """ SubscriptionUpsert200Response - """ # noqa: E501 - plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") - period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") - status: Optional[StrictStr] = Field(default=None, description="The status of the tenant subscription.") - note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") + """ # noqa: E501 + + plan: Optional[StrictStr] = Field( + default=None, + description="The plan code associated with the tenant subscription.", + ) + period: Optional[StrictStr] = Field( + default=None, description="The period associated with the tenant subscription." + ) + status: Optional[StrictStr] = Field( + default=None, description="The status of the tenant subscription." + ) + note: Optional[StrictStr] = Field( + default=None, description="A note associated with the tenant subscription." + ) __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] - @field_validator('status') + @field_validator("status") def status_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['active', 'pending', 'terminated', 'canceled']): - raise ValueError("must be one of enum values ('active', 'pending', 'terminated', 'canceled')") + if value not in set(["active", "pending", "terminated", "canceled"]): + raise ValueError( + "must be one of enum values ('active', 'pending', 'terminated', 'canceled')" + ) return value model_config = ConfigDict( @@ -48,7 +61,6 @@ def status_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,8 +85,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -92,12 +103,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan": obj.get("plan"), - "period": obj.get("period"), - "status": obj.get("status"), - "note": obj.get("note") - }) + _obj = cls.model_validate( + { + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py index d6688c23..0750aced 100644 --- a/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +++ b/hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py @@ -13,21 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class SubscriptionUpsertRequest(BaseModel): """ SubscriptionUpsertRequest - """ # noqa: E501 + """ # noqa: E501 + plan: Optional[StrictStr] = Field(default=None, description="The code of the plan.") - period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") + period: Optional[StrictStr] = Field( + default=None, description="The period of the plan." + ) __properties: ClassVar[List[str]] = ["plan", "period"] model_config = ConfigDict( @@ -36,7 +40,6 @@ class SubscriptionUpsertRequest(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +64,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -80,10 +82,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan": obj.get("plan"), - "period": obj.get("period") - }) + _obj = cls.model_validate( + {"plan": obj.get("plan"), "period": obj.get("period")} + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py index d2b55e05..93ae32dd 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py @@ -13,28 +13,50 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_coupons_inner import TenantBillingStateGet200ResponseCouponsInner -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_payment_methods_inner import TenantBillingStateGet200ResponsePaymentMethodsInner -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_plans_inner import TenantBillingStateGet200ResponsePlansInner -from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_subscription import TenantBillingStateGet200ResponseSubscription -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_coupons_inner import ( + TenantBillingStateGet200ResponseCouponsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_payment_methods_inner import ( + TenantBillingStateGet200ResponsePaymentMethodsInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_plans_inner import ( + TenantBillingStateGet200ResponsePlansInner, +) +from hatchet_sdk.clients.cloud_rest.models.tenant_billing_state_get200_response_subscription import ( + TenantBillingStateGet200ResponseSubscription, +) + + class TenantBillingStateGet200Response(BaseModel): """ TenantBillingStateGet200Response - """ # noqa: E501 - payment_methods: Optional[List[TenantBillingStateGet200ResponsePaymentMethodsInner]] = Field(default=None, alias="paymentMethods") + """ # noqa: E501 + + payment_methods: Optional[ + List[TenantBillingStateGet200ResponsePaymentMethodsInner] + ] = Field(default=None, alias="paymentMethods") subscription: TenantBillingStateGet200ResponseSubscription - plans: Optional[List[TenantBillingStateGet200ResponsePlansInner]] = Field(default=None, description="A list of plans available for the tenant.") - coupons: Optional[List[TenantBillingStateGet200ResponseCouponsInner]] = Field(default=None, description="A list of coupons applied to the tenant.") - __properties: ClassVar[List[str]] = ["paymentMethods", "subscription", "plans", "coupons"] + plans: Optional[List[TenantBillingStateGet200ResponsePlansInner]] = Field( + default=None, description="A list of plans available for the tenant." + ) + coupons: Optional[List[TenantBillingStateGet200ResponseCouponsInner]] = Field( + default=None, description="A list of coupons applied to the tenant." + ) + __properties: ClassVar[List[str]] = [ + "paymentMethods", + "subscription", + "plans", + "coupons", + ] model_config = ConfigDict( populate_by_name=True, @@ -42,7 +64,6 @@ class TenantBillingStateGet200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -67,8 +88,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -81,24 +101,24 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.payment_methods: if _item: _items.append(_item.to_dict()) - _dict['paymentMethods'] = _items + _dict["paymentMethods"] = _items # override the default output from pydantic by calling `to_dict()` of subscription if self.subscription: - _dict['subscription'] = self.subscription.to_dict() + _dict["subscription"] = self.subscription.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in plans (list) _items = [] if self.plans: for _item in self.plans: if _item: _items.append(_item.to_dict()) - _dict['plans'] = _items + _dict["plans"] = _items # override the default output from pydantic by calling `to_dict()` of each item in coupons (list) _items = [] if self.coupons: for _item in self.coupons: if _item: _items.append(_item.to_dict()) - _dict['coupons'] = _items + _dict["coupons"] = _items return _dict @classmethod @@ -110,12 +130,41 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "paymentMethods": [TenantBillingStateGet200ResponsePaymentMethodsInner.from_dict(_item) for _item in obj["paymentMethods"]] if obj.get("paymentMethods") is not None else None, - "subscription": TenantBillingStateGet200ResponseSubscription.from_dict(obj["subscription"]) if obj.get("subscription") is not None else None, - "plans": [TenantBillingStateGet200ResponsePlansInner.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None, - "coupons": [TenantBillingStateGet200ResponseCouponsInner.from_dict(_item) for _item in obj["coupons"]] if obj.get("coupons") is not None else None - }) + _obj = cls.model_validate( + { + "paymentMethods": ( + [ + TenantBillingStateGet200ResponsePaymentMethodsInner.from_dict( + _item + ) + for _item in obj["paymentMethods"] + ] + if obj.get("paymentMethods") is not None + else None + ), + "subscription": ( + TenantBillingStateGet200ResponseSubscription.from_dict( + obj["subscription"] + ) + if obj.get("subscription") is not None + else None + ), + "plans": ( + [ + TenantBillingStateGet200ResponsePlansInner.from_dict(_item) + for _item in obj["plans"] + ] + if obj.get("plans") is not None + else None + ), + "coupons": ( + [ + TenantBillingStateGet200ResponseCouponsInner.from_dict(_item) + for _item in obj["coupons"] + ] + if obj.get("coupons") is not None + else None + ), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py index af6d1434..288654e0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py @@ -13,33 +13,64 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) from typing_extensions import Self + class TenantBillingStateGet200ResponseCouponsInner(BaseModel): """ TenantBillingStateGet200ResponseCouponsInner - """ # noqa: E501 + """ # noqa: E501 + name: StrictStr = Field(description="The name of the coupon.") - amount_cents: Optional[StrictInt] = Field(default=None, description="The amount off of the coupon.") - amount_cents_remaining: Optional[StrictInt] = Field(default=None, description="The amount remaining on the coupon.") - amount_currency: Optional[StrictStr] = Field(default=None, description="The currency of the coupon.") + amount_cents: Optional[StrictInt] = Field( + default=None, description="The amount off of the coupon." + ) + amount_cents_remaining: Optional[StrictInt] = Field( + default=None, description="The amount remaining on the coupon." + ) + amount_currency: Optional[StrictStr] = Field( + default=None, description="The currency of the coupon." + ) frequency: StrictStr = Field(description="The frequency of the coupon.") - frequency_duration: Optional[StrictInt] = Field(default=None, description="The frequency duration of the coupon.") - frequency_duration_remaining: Optional[StrictInt] = Field(default=None, description="The frequency duration remaining of the coupon.") - percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The percentage off of the coupon.") - __properties: ClassVar[List[str]] = ["name", "amount_cents", "amount_cents_remaining", "amount_currency", "frequency", "frequency_duration", "frequency_duration_remaining", "percent"] - - @field_validator('frequency') + frequency_duration: Optional[StrictInt] = Field( + default=None, description="The frequency duration of the coupon." + ) + frequency_duration_remaining: Optional[StrictInt] = Field( + default=None, description="The frequency duration remaining of the coupon." + ) + percent: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="The percentage off of the coupon." + ) + __properties: ClassVar[List[str]] = [ + "name", + "amount_cents", + "amount_cents_remaining", + "amount_currency", + "frequency", + "frequency_duration", + "frequency_duration_remaining", + "percent", + ] + + @field_validator("frequency") def frequency_validate_enum(cls, value): """Validates the enum""" - if value not in set(['once', 'recurring']): + if value not in set(["once", "recurring"]): raise ValueError("must be one of enum values ('once', 'recurring')") return value @@ -49,7 +80,6 @@ def frequency_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -74,8 +104,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -93,16 +122,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "name": obj.get("name"), - "amount_cents": obj.get("amount_cents"), - "amount_cents_remaining": obj.get("amount_cents_remaining"), - "amount_currency": obj.get("amount_currency"), - "frequency": obj.get("frequency"), - "frequency_duration": obj.get("frequency_duration"), - "frequency_duration_remaining": obj.get("frequency_duration_remaining"), - "percent": obj.get("percent") - }) + _obj = cls.model_validate( + { + "name": obj.get("name"), + "amount_cents": obj.get("amount_cents"), + "amount_cents_remaining": obj.get("amount_cents_remaining"), + "amount_currency": obj.get("amount_currency"), + "frequency": obj.get("frequency"), + "frequency_duration": obj.get("frequency_duration"), + "frequency_duration_remaining": obj.get("frequency_duration_remaining"), + "percent": obj.get("percent"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py index b97207b9..d654f4e8 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py @@ -13,23 +13,31 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TenantBillingStateGet200ResponsePaymentMethodsInner(BaseModel): """ TenantBillingStateGet200ResponsePaymentMethodsInner - """ # noqa: E501 + """ # noqa: E501 + brand: StrictStr = Field(description="The brand of the payment method.") - last4: Optional[StrictStr] = Field(default=None, description="The last 4 digits of the card.") - expiration: Optional[StrictStr] = Field(default=None, description="The expiration date of the card.") - description: Optional[StrictStr] = Field(default=None, description="The description of the payment method.") + last4: Optional[StrictStr] = Field( + default=None, description="The last 4 digits of the card." + ) + expiration: Optional[StrictStr] = Field( + default=None, description="The expiration date of the card." + ) + description: Optional[StrictStr] = Field( + default=None, description="The description of the payment method." + ) __properties: ClassVar[List[str]] = ["brand", "last4", "expiration", "description"] model_config = ConfigDict( @@ -38,7 +46,6 @@ class TenantBillingStateGet200ResponsePaymentMethodsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -63,8 +70,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -82,12 +88,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "brand": obj.get("brand"), - "last4": obj.get("last4"), - "expiration": obj.get("expiration"), - "description": obj.get("description") - }) + _obj = cls.model_validate( + { + "brand": obj.get("brand"), + "last4": obj.get("last4"), + "expiration": obj.get("expiration"), + "description": obj.get("description"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py index ddf50b4b..f98c70da 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py @@ -13,25 +13,35 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TenantBillingStateGet200ResponsePlansInner(BaseModel): """ TenantBillingStateGet200ResponsePlansInner - """ # noqa: E501 + """ # noqa: E501 + plan_code: StrictStr = Field(description="The code of the plan.") name: StrictStr = Field(description="The name of the plan.") description: StrictStr = Field(description="The description of the plan.") amount_cents: StrictInt = Field(description="The price of the plan.") - period: Optional[StrictStr] = Field(default=None, description="The period of the plan.") - __properties: ClassVar[List[str]] = ["plan_code", "name", "description", "amount_cents", "period"] + period: Optional[StrictStr] = Field( + default=None, description="The period of the plan." + ) + __properties: ClassVar[List[str]] = [ + "plan_code", + "name", + "description", + "amount_cents", + "period", + ] model_config = ConfigDict( populate_by_name=True, @@ -39,7 +49,6 @@ class TenantBillingStateGet200ResponsePlansInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -64,8 +73,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -83,13 +91,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan_code": obj.get("plan_code"), - "name": obj.get("name"), - "description": obj.get("description"), - "amount_cents": obj.get("amount_cents"), - "period": obj.get("period") - }) + _obj = cls.model_validate( + { + "plan_code": obj.get("plan_code"), + "name": obj.get("name"), + "description": obj.get("description"), + "amount_cents": obj.get("amount_cents"), + "period": obj.get("period"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py index 8ab1649b..a92d16d0 100644 --- a/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +++ b/hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py @@ -13,33 +13,46 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set from typing_extensions import Self + class TenantBillingStateGet200ResponseSubscription(BaseModel): """ The subscription associated with this policy. - """ # noqa: E501 - plan: Optional[StrictStr] = Field(default=None, description="The plan code associated with the tenant subscription.") - period: Optional[StrictStr] = Field(default=None, description="The period associated with the tenant subscription.") - status: Optional[StrictStr] = Field(default=None, description="The status of the tenant subscription.") - note: Optional[StrictStr] = Field(default=None, description="A note associated with the tenant subscription.") + """ # noqa: E501 + + plan: Optional[StrictStr] = Field( + default=None, + description="The plan code associated with the tenant subscription.", + ) + period: Optional[StrictStr] = Field( + default=None, description="The period associated with the tenant subscription." + ) + status: Optional[StrictStr] = Field( + default=None, description="The status of the tenant subscription." + ) + note: Optional[StrictStr] = Field( + default=None, description="A note associated with the tenant subscription." + ) __properties: ClassVar[List[str]] = ["plan", "period", "status", "note"] - @field_validator('status') + @field_validator("status") def status_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['active', 'pending', 'terminated', 'canceled']): - raise ValueError("must be one of enum values ('active', 'pending', 'terminated', 'canceled')") + if value not in set(["active", "pending", "terminated", "canceled"]): + raise ValueError( + "must be one of enum values ('active', 'pending', 'terminated', 'canceled')" + ) return value model_config = ConfigDict( @@ -48,7 +61,6 @@ def status_validate_enum(cls, value): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -73,8 +85,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -92,12 +103,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "plan": obj.get("plan"), - "period": obj.get("period"), - "status": obj.get("status"), - "note": obj.get("note") - }) + _obj = cls.model_validate( + { + "plan": obj.get("plan"), + "period": obj.get("period"), + "status": obj.get("status"), + "note": obj.get("note"), + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py index 98a19c0f..ae8c9758 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py @@ -13,20 +13,25 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response_results_inner import WorkflowRunEventsGetMetrics200ResponseResultsInner -from typing import Optional, Set from typing_extensions import Self +from hatchet_sdk.clients.cloud_rest.models.workflow_run_events_get_metrics200_response_results_inner import ( + WorkflowRunEventsGetMetrics200ResponseResultsInner, +) + + class WorkflowRunEventsGetMetrics200Response(BaseModel): """ WorkflowRunEventsGetMetrics200Response - """ # noqa: E501 + """ # noqa: E501 + results: Optional[List[WorkflowRunEventsGetMetrics200ResponseResultsInner]] = None __properties: ClassVar[List[str]] = ["results"] @@ -36,7 +41,6 @@ class WorkflowRunEventsGetMetrics200Response(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -61,8 +65,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -75,7 +78,7 @@ def to_dict(self) -> Dict[str, Any]: for _item in self.results: if _item: _items.append(_item.to_dict()) - _dict['results'] = _items + _dict["results"] = _items return _dict @classmethod @@ -87,9 +90,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "results": [WorkflowRunEventsGetMetrics200ResponseResultsInner.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None - }) + _obj = cls.model_validate( + { + "results": ( + [ + WorkflowRunEventsGetMetrics200ResponseResultsInner.from_dict( + _item + ) + for _item in obj["results"] + ] + if obj.get("results") is not None + else None + ) + } + ) return _obj - - diff --git a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py index c4ea1cf1..93ded820 100644 --- a/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +++ b/hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py @@ -13,27 +13,36 @@ from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set from typing_extensions import Self + class WorkflowRunEventsGetMetrics200ResponseResultsInner(BaseModel): """ WorkflowRunEventsGetMetrics200ResponseResultsInner - """ # noqa: E501 + """ # noqa: E501 + time: datetime pending: StrictInt = Field(alias="PENDING") running: StrictInt = Field(alias="RUNNING") succeeded: StrictInt = Field(alias="SUCCEEDED") failed: StrictInt = Field(alias="FAILED") queued: StrictInt = Field(alias="QUEUED") - __properties: ClassVar[List[str]] = ["time", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "QUEUED"] + __properties: ClassVar[List[str]] = [ + "time", + "PENDING", + "RUNNING", + "SUCCEEDED", + "FAILED", + "QUEUED", + ] model_config = ConfigDict( populate_by_name=True, @@ -41,7 +50,6 @@ class WorkflowRunEventsGetMetrics200ResponseResultsInner(BaseModel): protected_namespaces=(), ) - def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) @@ -66,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: were set at model initialization. Other fields with value `None` are ignored. """ - excluded_fields: Set[str] = set([ - ]) + excluded_fields: Set[str] = set([]) _dict = self.model_dump( by_alias=True, @@ -85,14 +92,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "time": obj.get("time"), - "PENDING": obj.get("PENDING"), - "RUNNING": obj.get("RUNNING"), - "SUCCEEDED": obj.get("SUCCEEDED"), - "FAILED": obj.get("FAILED"), - "QUEUED": obj.get("QUEUED") - }) + _obj = cls.model_validate( + { + "time": obj.get("time"), + "PENDING": obj.get("PENDING"), + "RUNNING": obj.get("RUNNING"), + "SUCCEEDED": obj.get("SUCCEEDED"), + "FAILED": obj.get("FAILED"), + "QUEUED": obj.get("QUEUED"), + } + ) return _obj - - diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 28b675cf..32a621e0 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -3,18 +3,18 @@ from typing import Any, Callable, Dict, List from hatchet_sdk.client import Client - -from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import InfraAsCodeCreateRequest +from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import ( + InfraAsCodeCreateRequest, +) from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request_runtime_config import ( ManagedWorkerCreateRequestRuntimeConfig, ) +from hatchet_sdk.compute.configs import Compute +from hatchet_sdk.logger import logger # TODO why is this not generating # from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import ManagedWorkerRegion -from hatchet_sdk.compute.configs import Compute -from hatchet_sdk.logger import logger - class ManagedCompute: def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): diff --git a/hatchet_sdk/loader.py b/hatchet_sdk/loader.py index 95d5a238..ec1a30f0 100644 --- a/hatchet_sdk/loader.py +++ b/hatchet_sdk/loader.py @@ -38,7 +38,9 @@ def __init__( logger: Logger = None, grpc_max_recv_message_length: int = 4 * 1024 * 1024, # 4MB grpc_max_send_message_length: int = 4 * 1024 * 1024, # 4MB - runnable_actions: list[str] = None, # list of action names that are runnable, defaults to all actions + runnable_actions: list[ + str + ] = None, # list of action names that are runnable, defaults to all actions ): self.tenant_id = tenant_id self.tls_config = tls_config @@ -63,7 +65,12 @@ def __init__( self.listener_v2_timeout = listener_v2_timeout - self.runnable_actions: list[str] | None = [ self.namespace + action for action in runnable_actions] if runnable_actions else None + self.runnable_actions: list[str] | None = ( + [self.namespace + action for action in runnable_actions] + if runnable_actions + else None + ) + class ConfigLoader: def __init__(self, directory: str): @@ -129,8 +136,12 @@ def get_config_value(key, env_var): tls_config = self._load_tls_config(config_data["tls"], host_port) - raw_runnable_actions = get_config_value("runnable_actions", "HATCHET_CLOUD_ACTIONS") - runnable_actions = raw_runnable_actions.split(",") if raw_runnable_actions else None + raw_runnable_actions = get_config_value( + "runnable_actions", "HATCHET_CLOUD_ACTIONS" + ) + runnable_actions = ( + raw_runnable_actions.split(",") if raw_runnable_actions else None + ) return ClientConfig( tenant_id=tenant_id, diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index ca611e28..97689353 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -9,7 +9,6 @@ from typing import Any, Callable, Dict, Optional from hatchet_sdk.client import Client, new_client_raw - from hatchet_sdk.compute.managed_compute import ManagedCompute from hatchet_sdk.context import Context from hatchet_sdk.contracts.workflows_pb2 import CreateWorkflowVersionOpts @@ -101,7 +100,10 @@ def action_function(context): return action_function for action_name, action_func in workflow.get_actions(namespace): - if self.client.config.runnable_actions and action_name not in self.client.config.runnable_actions: + if ( + self.client.config.runnable_actions + and action_name not in self.client.config.runnable_actions + ): logger.debug(f"skipping action: {action_name} not in runnable actions") continue From d88e171d99a1eb0659ff500eed730fc6f4875a3a Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:54:29 -0400 Subject: [PATCH 15/33] feat: slots --- hatchet_sdk/compute/managed_compute.py | 5 ++++- hatchet_sdk/worker/worker.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 32a621e0..83d67338 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -17,9 +17,10 @@ class ManagedCompute: - def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client): + def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client, max_runs: int = 1): self.actions = actions self.client = client + self.max_runs = max_runs self.configs = self.get_compute_configs(self.actions) self.cloud_register_enabled = os.environ.get("HATCHET_CLOUD_REGISTER_ID") @@ -68,6 +69,7 @@ def get_compute_configs( cpus=compute.cpus, memory_mb=compute.memory_mb, regions=compute.regions, + slots=self.max_runs, ) map[key].actions.append(action) @@ -77,6 +79,7 @@ def get_compute_configs( return [] async def cloud_register(self): + # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit if self.cloud_register_enabled is not None: logger.info( diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index 97689353..310c3d7b 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -165,7 +165,7 @@ async def async_start( if not _from_start: self.setup_loop(options.loop) - managed_compute = ManagedCompute(self.action_registry, self.client) + managed_compute = ManagedCompute(self.action_registry, self.client, self.max_runs) await managed_compute.cloud_register() self.action_listener_process = self._start_listener() From 673e2b228ace2b9d0fb545b00730b17346991b7a Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:59:56 -0400 Subject: [PATCH 16/33] git --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4f69d1e7..1711d1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -163,5 +163,5 @@ cython_debug/ openapitools.json -hatchet-cloud/ -hatchet/ +# hatchet-cloud/ +# hatchet/ From 8006f7017e99c3df3173d70b7267b8b0642954f1 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 14:59:59 -0400 Subject: [PATCH 17/33] rm --- hatchet | 1 - 1 file changed, 1 deletion(-) delete mode 160000 hatchet diff --git a/hatchet b/hatchet deleted file mode 160000 index 8a3c8b57..00000000 --- a/hatchet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8a3c8b573c2a800a7ce8018deab20a4c27d7e5d5 From 9a7eef4a7a7fbd82bcd9057026585a5577d13de3 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:00:07 -0400 Subject: [PATCH 18/33] git --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1711d1a3..4f69d1e7 100644 --- a/.gitignore +++ b/.gitignore @@ -163,5 +163,5 @@ cython_debug/ openapitools.json -# hatchet-cloud/ -# hatchet/ +hatchet-cloud/ +hatchet/ From b2b31bc10d1c25b98999e63961434e6039ae722a Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:02:58 -0400 Subject: [PATCH 19/33] release: 0.40.0a1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 23b3d69c..1dd0623e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.39.0a1" +version = "0.40.0a1" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 2834d9c9c8f6698add055140fa72507648d0208f Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:40:33 -0400 Subject: [PATCH 20/33] fix: merge --- .../clients/rest/api/rate_limits_api.py | 13 ------------- hatchet_sdk/clients/rest/api/tenant_api.py | 13 ------------- hatchet_sdk/clients/rest/api/workflow_api.py | 13 ------------- hatchet_sdk/clients/rest/api_client.py | 18 ------------------ .../rest/models/tenant_queue_metrics.py | 12 ------------ .../models/tenant_step_run_queue_metrics.py | 4 ---- 6 files changed, 73 deletions(-) diff --git a/hatchet_sdk/clients/rest/api/rate_limits_api.py b/hatchet_sdk/clients/rest/api/rate_limits_api.py index f02de01d..3445856c 100644 --- a/hatchet_sdk/clients/rest/api/rate_limits_api.py +++ b/hatchet_sdk/clients/rest/api/rate_limits_api.py @@ -365,13 +365,7 @@ def _rate_limit_list_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] -<<<<<<< HEAD _files: Dict[str, Union[str, bytes]] = {} -======= - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} ->>>>>>> main _body_params: Optional[bytes] = None # process the path parameters @@ -403,16 +397,9 @@ def _rate_limit_list_serialize( # process the body parameter # set the HTTP header `Accept` -<<<<<<< HEAD _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) -======= - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) ->>>>>>> main # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/tenant_api.py b/hatchet_sdk/clients/rest/api/tenant_api.py index f958622d..69de9ddd 100644 --- a/hatchet_sdk/clients/rest/api/tenant_api.py +++ b/hatchet_sdk/clients/rest/api/tenant_api.py @@ -1953,13 +1953,7 @@ def _tenant_get_step_run_queue_metrics_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] -<<<<<<< HEAD _files: Dict[str, Union[str, bytes]] = {} -======= - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} ->>>>>>> main _body_params: Optional[bytes] = None # process the path parameters @@ -1971,16 +1965,9 @@ def _tenant_get_step_run_queue_metrics_serialize( # process the body parameter # set the HTTP header `Accept` -<<<<<<< HEAD _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) -======= - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) ->>>>>>> main # authentication setting _auth_settings: List[str] = ["cookieAuth", "bearerAuth"] diff --git a/hatchet_sdk/clients/rest/api/workflow_api.py b/hatchet_sdk/clients/rest/api/workflow_api.py index af1fd2eb..1efe0652 100644 --- a/hatchet_sdk/clients/rest/api/workflow_api.py +++ b/hatchet_sdk/clients/rest/api/workflow_api.py @@ -3760,13 +3760,7 @@ def _workflow_update_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] -<<<<<<< HEAD _files: Dict[str, Union[str, bytes]] = {} -======= - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} ->>>>>>> main _body_params: Optional[bytes] = None # process the path parameters @@ -3780,16 +3774,9 @@ def _workflow_update_serialize( _body_params = workflow_update_request # set the HTTP header `Accept` -<<<<<<< HEAD _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] ) -======= - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) ->>>>>>> main # set the HTTP header `Content-Type` if _content_type: diff --git a/hatchet_sdk/clients/rest/api_client.py b/hatchet_sdk/clients/rest/api_client.py index 93daabf6..02af4d06 100644 --- a/hatchet_sdk/clients/rest/api_client.py +++ b/hatchet_sdk/clients/rest/api_client.py @@ -390,27 +390,9 @@ def deserialize(self, response_text, response_type): """ # fetch data from response object -<<<<<<< HEAD try: data = json.loads(response_text) except ValueError: -======= - if content_type is None: - try: - data = json.loads(response_text) - except ValueError: - data = response_text - elif re.match( - r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", - content_type, - re.IGNORECASE, - ): - if response_text == "": - data = "" - else: - data = json.loads(response_text) - elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): ->>>>>>> main data = response_text return self.__deserialize(data, response_type) diff --git a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py index 23b0600c..02807090 100644 --- a/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py @@ -95,18 +95,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if obj.get("total") is not None else None ), -<<<<<<< HEAD -======= - "workflow": ( - dict( - (_k, QueueMetrics.from_dict(_v)) - for _k, _v in obj["workflow"].items() - ) - if obj.get("workflow") is not None - else None - ), - "queues": obj.get("queues"), ->>>>>>> main } ) return _obj diff --git a/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py index a3a1685d..90f85ae6 100644 --- a/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +++ b/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py @@ -79,9 +79,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) -<<<<<<< HEAD _obj = cls.model_validate({}) -======= - _obj = cls.model_validate({"queues": obj.get("queues")}) ->>>>>>> main return _obj From 50ab4da05871419fbccbcaeb76e14ebbb1f5bb8f Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:40:45 -0400 Subject: [PATCH 21/33] release: 0.40.0a2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1dd0623e..1ee6870e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a1" +version = "0.40.0a2" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 04380029781f15d039eba0f8c6679f772d8a850d Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:42:33 -0400 Subject: [PATCH 22/33] chore: lint --- hatchet_sdk/compute/managed_compute.py | 4 +++- hatchet_sdk/worker/worker.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 83d67338..71084b1e 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -17,7 +17,9 @@ class ManagedCompute: - def __init__(self, actions: Dict[str, Callable[..., Any]], client: Client, max_runs: int = 1): + def __init__( + self, actions: Dict[str, Callable[..., Any]], client: Client, max_runs: int = 1 + ): self.actions = actions self.client = client self.max_runs = max_runs diff --git a/hatchet_sdk/worker/worker.py b/hatchet_sdk/worker/worker.py index 310c3d7b..7b8f51cb 100644 --- a/hatchet_sdk/worker/worker.py +++ b/hatchet_sdk/worker/worker.py @@ -165,7 +165,9 @@ async def async_start( if not _from_start: self.setup_loop(options.loop) - managed_compute = ManagedCompute(self.action_registry, self.client, self.max_runs) + managed_compute = ManagedCompute( + self.action_registry, self.client, self.max_runs + ) await managed_compute.cloud_register() self.action_listener_process = self._start_listener() From 6e556a8bbf8564e8f02bcb8d0c1ba3b26a5112a6 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:43:22 -0400 Subject: [PATCH 23/33] chore: fix --- hatchet_sdk/clients/rest/models/rate_limit_list.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hatchet_sdk/clients/rest/models/rate_limit_list.py b/hatchet_sdk/clients/rest/models/rate_limit_list.py index 405512a9..24df2f3a 100644 --- a/hatchet_sdk/clients/rest/models/rate_limit_list.py +++ b/hatchet_sdk/clients/rest/models/rate_limit_list.py @@ -78,15 +78,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in rows (list) _items = [] if self.rows: -<<<<<<< HEAD for _item in self.rows: if _item: _items.append(_item.to_dict()) -======= - for _item_rows in self.rows: - if _item_rows: - _items.append(_item_rows.to_dict()) ->>>>>>> main _dict["rows"] = _items return _dict From a4101dfa90432d8332eb871ef810d5740cee01e2 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 15:43:38 -0400 Subject: [PATCH 24/33] release: a3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1ee6870e..b3c8ba0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a2" +version = "0.40.0a3" description = "" authors = ["Alexander Belanger "] readme = "README.md" From c2636213de6b149bbbeb0e933eb28b0b39010656 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:04:21 -0400 Subject: [PATCH 25/33] fix: ai junk --- hatchet_sdk/compute/managed_compute.py | 3 +-- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 71084b1e..09a0be36 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -99,8 +99,7 @@ async def cloud_register(self): res = ( await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=self.cloud_register_enabled, - infra_as_code_request2=req, + infra_as_code_request=req, _request_timeout=10, ) ) diff --git a/pyproject.toml b/pyproject.toml index b3c8ba0c..38efa5d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a3" +version = "0.40.0a4" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 91012f095e060fc0d81c06572f55d84455649c87 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:25:16 -0400 Subject: [PATCH 26/33] fix: request --- hatchet_sdk/compute/managed_compute.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 09a0be36..940f6151 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -83,7 +83,7 @@ def get_compute_configs( async def cloud_register(self): # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit - if self.cloud_register_enabled is not None: + if self.cloud_register_enabled is None: logger.info( f"Registering cloud compute plan with ID: {self.cloud_register_enabled}" ) @@ -99,7 +99,8 @@ async def cloud_register(self): res = ( await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=req, + infra_as_code_request=self.cloud_register_enabled, + infra_as_code_create_request=req, _request_timeout=10, ) ) From 2d95dc42e5423130c5e3b15ff807313182175ce9 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:25:26 -0400 Subject: [PATCH 27/33] release: 0.40.0a5 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 38efa5d2..0a17228c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a4" +version = "0.40.0a5" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 704064bfc53034bf76118959a886a8bf7f694412 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:27:01 -0400 Subject: [PATCH 28/33] fix: condition --- hatchet_sdk/compute/managed_compute.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 940f6151..a194d46d 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -32,7 +32,7 @@ def __init__( ) return - if self.cloud_register_enabled is None: + if self.cloud_register_enabled is not None: logger.warning("managed cloud compute plan:") for compute in self.configs: logger.warning(f" ----------------------------") @@ -99,7 +99,6 @@ async def cloud_register(self): res = ( await self.client.rest.aio.managed_worker_api.infra_as_code_create( - infra_as_code_request=self.cloud_register_enabled, infra_as_code_create_request=req, _request_timeout=10, ) From 2f2887adc4d966e2e8d62212fded49bc1640ec2b Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:27:12 -0400 Subject: [PATCH 29/33] release: a6 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0a17228c..bdbb495a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a5" +version = "0.40.0a6" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 9bc4ab734cd657cb13ddfc293cd5cccfbbd7b112 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:38:58 -0400 Subject: [PATCH 30/33] fix: none --- hatchet_sdk/compute/managed_compute.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index a194d46d..6fc46e66 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -32,7 +32,7 @@ def __init__( ) return - if self.cloud_register_enabled is not None: + if self.cloud_register_enabled is None: logger.warning("managed cloud compute plan:") for compute in self.configs: logger.warning(f" ----------------------------") @@ -83,7 +83,7 @@ def get_compute_configs( async def cloud_register(self): # if the environment variable HATCHET_CLOUD_REGISTER_ID is set, use it and exit - if self.cloud_register_enabled is None: + if self.cloud_register_enabled is not None: logger.info( f"Registering cloud compute plan with ID: {self.cloud_register_enabled}" ) diff --git a/pyproject.toml b/pyproject.toml index bdbb495a..44f875d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a6" +version = "0.40.0a7" description = "" authors = ["Alexander Belanger "] readme = "README.md" From a904a53452c390ca266dab459637537c200f4928 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Mon, 28 Oct 2024 17:56:56 -0400 Subject: [PATCH 31/33] fix --- hatchet_sdk/compute/managed_compute.py | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index 6fc46e66..b5e9efa3 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -99,6 +99,7 @@ async def cloud_register(self): res = ( await self.client.rest.aio.managed_worker_api.infra_as_code_create( + infra_as_code_request=self.cloud_register_enabled, infra_as_code_create_request=req, _request_timeout=10, ) diff --git a/pyproject.toml b/pyproject.toml index 44f875d3..b6a6adfa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a7" +version = "0.40.0a8" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 15991b858db76eca6a05d16b9539a9528a7b6d99 Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Tue, 29 Oct 2024 10:13:25 -0400 Subject: [PATCH 32/33] fix: num rep --- hatchet_sdk/compute/managed_compute.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hatchet_sdk/compute/managed_compute.py b/hatchet_sdk/compute/managed_compute.py index b5e9efa3..4c2c0a25 100644 --- a/hatchet_sdk/compute/managed_compute.py +++ b/hatchet_sdk/compute/managed_compute.py @@ -66,7 +66,7 @@ def get_compute_configs( if key not in map: map[key] = ManagedWorkerCreateRequestRuntimeConfig( actions=[], - num_replicas=1, + num_replicas=compute.num_replicas, cpu_kind=compute.cpu_kind, cpus=compute.cpus, memory_mb=compute.memory_mb, diff --git a/pyproject.toml b/pyproject.toml index b6a6adfa..b4adea2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hatchet-sdk" -version = "0.40.0a8" +version = "0.40.0a9" description = "" authors = ["Alexander Belanger "] readme = "README.md" From 07168c9612388e44610786411ef3d580dc414e2c Mon Sep 17 00:00:00 2001 From: gabriel ruttner Date: Tue, 5 Nov 2024 14:35:22 -0500 Subject: [PATCH 33/33] chore: export compute --- examples/blocked_check/worker.py | 52 ++++++++++++++++++++++++++++++++ hatchet_sdk/compute/__init__.py | 3 ++ 2 files changed, 55 insertions(+) create mode 100644 examples/blocked_check/worker.py diff --git a/examples/blocked_check/worker.py b/examples/blocked_check/worker.py new file mode 100644 index 00000000..c70713c2 --- /dev/null +++ b/examples/blocked_check/worker.py @@ -0,0 +1,52 @@ +import asyncio +import time + +from dotenv import load_dotenv + +from hatchet_sdk import Context, Hatchet + +load_dotenv() + +hatchet = Hatchet(debug=True) + + +async def check_blocking_workers(context: Context): + start_time = time.time() + context.log("Starting blocking worker check") + + await asyncio.sleep(30) + + end_time = time.time() + elapsed_time = end_time - start_time + + if 25 <= elapsed_time <= 35: + context.log(f"Check completed in {elapsed_time:.2f} seconds") + else: + raise ValueError( + f"Blockage detected: Task took {elapsed_time:.2f} seconds, expected 25-35" + " seconds" + ) + + +@hatchet.workflow(on_crons=["*/5 * * * *"]) +class CheckBlockingWorkersWorkflow: + @hatchet.step(timeout="1m") + async def iter_1(self, context: Context): + await check_blocking_workers(context) + + @hatchet.step(parents=["iter_1"], timeout="1m") + async def iter_2(self, context): + await check_blocking_workers(context) + + @hatchet.step(parents=["iter_2"], timeout="1m") + async def iter_3(self, context): + await check_blocking_workers(context) + +def main(): + workflow = CheckBlockingWorkersWorkflow() + worker = hatchet.worker("test-worker", max_runs=1) + worker.register_workflow(workflow) + worker.start() + +if __name__ == "__main__": + main() diff --git a/hatchet_sdk/compute/__init__.py b/hatchet_sdk/compute/__init__.py index e69de29b..aaf6d8f4 100644 --- a/hatchet_sdk/compute/__init__.py +++ b/hatchet_sdk/compute/__init__.py @@ -0,0 +1,3 @@ +from hatchet_sdk.compute.configs import Compute + +__all__ = ["Compute"]