diff --git a/mypy.ini b/mypy.ini index 3e06fd5c..d3b36c12 100644 --- a/mypy.ini +++ b/mypy.ini @@ -16,7 +16,6 @@ plugins = pydantic.mypy exclude = (?x)( ^src/askui/models/ui_tars_ep/ui_tars_api\.py$ | ^src/askui/tools/askui/askui_ui_controller_grpc/.*$ - | ^src/askui/tools/askui/askui_workspaces/.*$ ) mypy_path = src:tests explicit_package_bases = true diff --git a/pyproject.toml b/pyproject.toml index 0f35433c..2cca01f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -183,7 +183,6 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" "src/askui/web_agent.py" = ["E501"] "src/askui/models/shared/android_agent.py" = ["E501"] "src/askui/chat/*" = ["E501", "F401", "F403"] -"src/askui/tools/askui/askui_workspaces/*" = ["ALL"] "src/askui/tools/askui/askui_ui_controller_grpc/*" = ["ALL"] "src/askui/locators/locators.py" = ["E501"] "src/askui/locators/relatable.py" = ["E501", "SLF001"] diff --git a/src/askui/tools/askui/askui_hub.py b/src/askui/tools/askui/askui_hub.py deleted file mode 100644 index 8b7eef51..00000000 --- a/src/askui/tools/askui/askui_hub.py +++ /dev/null @@ -1,253 +0,0 @@ -import base64 -from pathlib import Path -from typing import Optional, Union -from urllib.parse import urlencode, urljoin -from uuid import UUID - -import requests -from pydantic import BaseModel, Field, HttpUrl -from pydantic_settings import BaseSettings, SettingsConfigDict -from tenacity import retry, stop_after_attempt, wait_exponential - -from askui.tools.askui.askui_workspaces.models.extract_data_command import ( - ExtractDataCommand, -) -from askui.tools.askui.askui_workspaces.models.extract_data_response import ( - ExtractDataResponse, -) - -from .askui_workspaces import ( - Agent, - AgentExecution, - AgentExecutionsApi, - AgentExecutionStateCanceled, - AgentExecutionStateConfirmed, - AgentExecutionStateDeliveredToDestinationInput, - AgentExecutionStatePendingReview, - AgentExecutionUpdateCommand, - AgentsApi, - ApiClient, - Configuration, - CreateScheduleRequestDto, - CreateScheduleResponseDto, - SchedulesApi, - State1, - ToolsApi, -) - - -class AskUIHubSettings(BaseSettings): - model_config = SettingsConfigDict( - env_prefix="ASKUI_", - ) - workspace_id: str | None = Field(default=None) - token: str | None = Field(default=None) - workspaces_endpoint: HttpUrl | None = Field( - default=HttpUrl("https://workspaces.askui.com") - ) - - @property - def workspaces_host(self) -> str: - if self.workspaces_endpoint is None: - error_msg = "Workspaces endpoint is not set" - raise ValueError(error_msg) - return self.workspaces_endpoint.unicode_string().rstrip("/") - - @property - def authenticated(self) -> bool: - return self.workspace_id is not None and self.token is not None - - @property - def token_base64(self) -> str: - if self.token is None: - error_msg = "Token is not set" - raise ValueError(error_msg) - return base64.b64encode(self.token.encode()).decode() - - @property - def files_base_url(self) -> str: - return urljoin(self.workspaces_host, "/api/v1/files") - - @property - def authorization_header_value(self) -> str: - return f"Basic {self.token_base64}" - - -ScheduleRunCommand = CreateScheduleRequestDto -ScheduleRunResponse = CreateScheduleResponseDto - - -class FileDto(BaseModel): - name: str - path: str - url: str - - -class FilesListResponseDto(BaseModel): - data: list[FileDto] - next_continuation_token: Optional[str] = Field(default=None) - - -REQUEST_TIMEOUT_IN_S = 60 -UPLOAD_REQUEST_TIMEOUT_IN_S = 3600 # allows for uploading large files -EXTRACT_DATA_REQUEST_TIMEOUT_IN_S = 300.0 - - -class AskUIHub: - def __init__(self) -> None: - self._settings = AskUIHubSettings() - self.disabled = False - if not self._settings.authenticated: - self.disabled = True - return - - api_client_config = Configuration( - host=self._settings.workspaces_host, - api_key={"Basic": self._settings.authorization_header_value}, - ) - api_client = ApiClient(api_client_config) - self._agents_api = AgentsApi(api_client) - self._agent_executions_api = AgentExecutionsApi(api_client) - self._schedules_api = SchedulesApi(api_client) - self._tools_api = ToolsApi(api_client) - - def retrieve_agent(self, agent_id: UUID | str) -> Agent: - response = self._agents_api.list_agents_api_v1_agents_get( - agent_id=[str(agent_id)] - ) - if not response.data: - error_msg = f"Agent {agent_id} not found" - raise ValueError(error_msg) - return response.data[0] - - def retrieve_agent_execution( - self, agent_execution_id: UUID | str - ) -> AgentExecution: - response = self._agent_executions_api.list_agent_executions_api_v1_agent_executions_get( # noqa: E501 - agent_execution_id=[str(agent_execution_id)] - ) - if not response.data: - error_msg = f"Agent execution {agent_execution_id} not found" - raise ValueError(error_msg) - return response.data[0] - - def update_agent_execution( - self, - agent_execution_id: UUID | str, - state: Union[ - AgentExecutionStateCanceled, - AgentExecutionStateConfirmed, - AgentExecutionStatePendingReview, - AgentExecutionStateDeliveredToDestinationInput, - ], - ) -> AgentExecution: - command = AgentExecutionUpdateCommand(state=State1(state.model_dump())) - return self._agent_executions_api.update_agent_execution_api_v1_agent_executions_agent_execution_id_patch( # noqa: E501 - agent_execution_id=str(agent_execution_id), - agent_execution_update_command=command, - ) - - def schedule_run(self, command: ScheduleRunCommand) -> ScheduleRunResponse: - if self._settings.workspace_id is None: - error_msg = "`ASKUI_WORKSPACE_ID` environment variable is not set" - raise ValueError(error_msg) - return self._schedules_api.create_schedule_api_v1_workspaces_workspace_id_schedules_post( # noqa: E501 - workspace_id=self._settings.workspace_id, - create_schedule_request_dto=command, - ) - - def extract_data(self, command: ExtractDataCommand) -> ExtractDataResponse: - return self._tools_api.extract_data_api_v1_tools_extract_data_post( - extract_data_command=command, - _request_timeout=EXTRACT_DATA_REQUEST_TIMEOUT_IN_S, - ) - - @retry(stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True) - def _upload_file(self, local_file_path: str, remote_file_path: str) -> None: - with Path(local_file_path).open("rb") as f: - url = urljoin( - base=self._settings.files_base_url, - url=remote_file_path, - ) - with requests.put( - url, - files={"file": f}, - headers={"Authorization": self._settings.authorization_header_value}, - timeout=UPLOAD_REQUEST_TIMEOUT_IN_S, - stream=True, - ) as response: - if response.status_code != 200: - response.raise_for_status() - - def _upload_dir(self, local_dir_path: str, remote_dir_path: str) -> None: - """Upload directory to remote device.""" - for file_path in Path(local_dir_path).rglob("*"): - if file_path.is_file(): - relative_file_path = file_path.relative_to(local_dir_path) - remote_file_path = ( - f"{remote_dir_path}/{'/' if remote_dir_path else ''}" - f"{'/'.join(relative_file_path.parts)}" - ) - self._upload_file(str(file_path), remote_file_path) - - def upload(self, local_path: str, remote_dir_path: str = "") -> None: - """Upload file or directory to remote device.""" - r_dir_path = remote_dir_path.rstrip("/") - local_path_obj = Path(local_path) - if local_path_obj.is_dir(): - self._upload_dir(local_path, r_dir_path) - else: - self._upload_file(local_path, f"{r_dir_path}/{local_path_obj.name}") - - @retry(stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True) - def _download_file(self, url: str, local_file_path: str) -> None: - response = requests.get( - url, - headers={"Authorization": self._settings.authorization_header_value}, - timeout=REQUEST_TIMEOUT_IN_S, - stream=True, - ) - if response.status_code != 200: - response.raise_for_status() - with Path(local_file_path).open("wb") as f: - for chunk in response.iter_content(chunk_size=1024): - if chunk: - f.write(chunk) - - @retry(stop=stop_after_attempt(5), wait=wait_exponential(), reraise=True) - def _list_objects( - self, prefix: str, continuation_token: str | None = None - ) -> FilesListResponseDto: - params = {"prefix": prefix, "limit": 100, "expand": "url"} - if continuation_token is not None: - params["continuation_token"] = continuation_token - list_url = f"{self._settings.files_base_url}?{urlencode(params)}" - response = requests.get( - list_url, - headers={"Authorization": self._settings.authorization_header_value}, - timeout=REQUEST_TIMEOUT_IN_S, - ) - if response.status_code != 200: - response.raise_for_status() - return FilesListResponseDto(**response.json()) - - def download(self, local_dir_path: str, remote_path: str = "") -> None: - continuation_token = None - prefix = remote_path.lstrip("/") - while True: - list_objects_response = self._list_objects(prefix, continuation_token) - for content in list_objects_response.data: - if prefix == content.path: # is a file - relative_remote_path = content.name - else: # is a prefix, e.g., folder - relative_remote_path = content.path[len(prefix) :].lstrip("/") - local_file_path = Path.joinpath( - Path(local_dir_path), *relative_remote_path.split("/") - ) - Path.mkdir( - Path.parent(Path(local_file_path)), parents=True, exist_ok=True - ) - self._download_file(content.url, str(local_file_path)) - continuation_token = list_objects_response.next_continuation_token - if continuation_token is None: - break diff --git a/src/askui/tools/askui/askui_workspaces/__init__.py b/src/askui/tools/askui/askui_workspaces/__init__.py deleted file mode 100644 index 521b1f2a..00000000 --- a/src/askui/tools/askui/askui_workspaces/__init__.py +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -__version__ = "0.1.2" - -# import apis into sdk package -from askui.tools.askui.askui_workspaces.api.access_tokens_api import AccessTokensApi -from askui.tools.askui.askui_workspaces.api.agent_executions_api import ( - AgentExecutionsApi, -) -from askui.tools.askui.askui_workspaces.api.agents_api import AgentsApi -from askui.tools.askui.askui_workspaces.api.billing_api import BillingApi -from askui.tools.askui.askui_workspaces.api.files_api import FilesApi -from askui.tools.askui.askui_workspaces.api.runner_jobs_api import RunnerJobsApi -from askui.tools.askui.askui_workspaces.api.runs_api import RunsApi -from askui.tools.askui.askui_workspaces.api.schedules_api import SchedulesApi -from askui.tools.askui.askui_workspaces.api.tools_api import ToolsApi -from askui.tools.askui.askui_workspaces.api.usage_api import UsageApi -from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import ( - WorkspaceMembershipsApi, -) -from askui.tools.askui.askui_workspaces.api.workspaces_api import WorkspacesApi - -# import ApiClient -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.api_client import ApiClient -from askui.tools.askui.askui_workspaces.configuration import Configuration -from askui.tools.askui.askui_workspaces.exceptions import OpenApiException -from askui.tools.askui.askui_workspaces.exceptions import ApiTypeError -from askui.tools.askui.askui_workspaces.exceptions import ApiValueError -from askui.tools.askui.askui_workspaces.exceptions import ApiKeyError -from askui.tools.askui.askui_workspaces.exceptions import ApiAttributeError -from askui.tools.askui.askui_workspaces.exceptions import ApiException - -# import models into sdk package -from askui.tools.askui.askui_workspaces.models.access_token_response_dto import ( - AccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.agent import Agent -from askui.tools.askui.askui_workspaces.models.agent_create_command import ( - AgentCreateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import ( - AgentCreateCommandDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import ( - AgentDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution -from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import ( - AgentExecutionCancel, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import ( - AgentExecutionConfirm, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import ( - AgentExecutionPendingReview, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import ( - AgentExecutionStateCanceled, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import ( - AgentExecutionStateConfirmed, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import ( - AgentExecutionStateDeliveredToDestinationInput, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import ( - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import ( - AgentExecutionStateDeliveredToDestinationOutput, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import ( - AgentExecutionStatePendingDataExtraction, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import ( - AgentExecutionStatePendingInputs, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import ( - AgentExecutionStatePendingReview, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import ( - AgentExecutionUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import ( - AgentExecutionsListResponse, -) -from askui.tools.askui.askui_workspaces.models.agent_update_command import ( - AgentUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agents_list_response import ( - AgentsListResponse, -) -from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost -from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import ( - CompleteRunnerJobRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import ( - CreateCustomerPortalSessionRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import ( - CreateCustomerPortalSessionResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import ( - CreateScheduleRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import ( - CreateScheduleResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import ( - CreateSubjectAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import ( - CreateSubjectAccessTokenResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import ( - CreateSubjectAccessTokenResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import ( - CreateWorkspaceAccessTokenRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import ( - CreateWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import ( - CreateWorkspaceMembershipRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import ( - CreateWorkspaceMembershipResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import ( - CreateWorkspaceRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import ( - CreateWorkspaceResponseDto, -) -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import ( - DataDestinationAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import ( - DataDestinationAskUiWorkflowCreate, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import ( - DataDestinationDeliveryAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import ( - DataDestinationDeliveryWebhook, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook import ( - DataDestinationWebhook, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import ( - DataDestinationWebhookCreate, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger import ( - EmailAgentTrigger, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import ( - EmailAgentTriggerCreate, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import ( - EmailAgentTriggerUpdate, -) -from askui.tools.askui.askui_workspaces.models.extract_data_command import ( - ExtractDataCommand, -) -from askui.tools.askui.askui_workspaces.models.extract_data_response import ( - ExtractDataResponse, -) -from askui.tools.askui.askui_workspaces.models.file_dto import FileDto -from askui.tools.askui.askui_workspaces.models.files_list_response_dto import ( - FilesListResponseDto, -) -from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import ( - FilesListResponseDtoDataInner, -) -from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto -from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import ( - GenerateSignedCookiesCommand, -) -from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import ( - GetSubscriptionResponseDto, -) -from askui.tools.askui.askui_workspaces.models.http_validation_error import ( - HTTPValidationError, -) -from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import ( - LeaseRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import ( - LeaseRunnerJobResponseDtoData, -) -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import ( - LeaseRunnerJobResponseDtoDataCredentials, -) -from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ( - ListAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ( - ListRunsResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ( - ListSubjectAccessTokensResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import ( - ListSubjectAccessTokensResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import ( - LookupAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import ( - LookupAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import ( - LookupWorkspaceAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import ( - LookupWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import ( - PingRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto -from askui.tools.askui.askui_workspaces.models.run_status import RunStatus -from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate -from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment -from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost -from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus -from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ( - ScheduleReponseDto, -) -from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus -from askui.tools.askui.askui_workspaces.models.state import State -from askui.tools.askui.askui_workspaces.models.state1 import State1 -from askui.tools.askui.askui_workspaces.models.string_error_response import ( - StringErrorResponse, -) -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import ( - SubjectAccessTokenResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import ( - SubjectAccessTokenResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import ( - UpdateWorkspaceNameRequestDto, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import ( - UpdateWorkspaceNameResponseDto, -) -from askui.tools.askui.askui_workspaces.models.upload_file_response import ( - UploadFileResponse, -) -from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent -from askui.tools.askui.askui_workspaces.models.usage_events_list_response import ( - UsageEventsListResponse, -) -from askui.tools.askui.askui_workspaces.models.user_dto import UserDto -from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError -from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ( - ValidationErrorLocInner, -) -from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse -from askui.tools.askui.askui_workspaces.models.workspace_access_token import ( - WorkspaceAccessToken, -) -from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto -from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import ( - WorkspaceMembershipsListResponse, -) -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto, -) -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto, -) -from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import ( - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto, -) diff --git a/src/askui/tools/askui/askui_workspaces/api/__init__.py b/src/askui/tools/askui/askui_workspaces/api/__init__.py deleted file mode 100644 index 4fd127ff..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# flake8: noqa - -# import apis into api package -from askui.tools.askui.askui_workspaces.api.access_tokens_api import AccessTokensApi -from askui.tools.askui.askui_workspaces.api.agent_executions_api import ( - AgentExecutionsApi, -) -from askui.tools.askui.askui_workspaces.api.agents_api import AgentsApi -from askui.tools.askui.askui_workspaces.api.billing_api import BillingApi -from askui.tools.askui.askui_workspaces.api.files_api import FilesApi -from askui.tools.askui.askui_workspaces.api.runner_jobs_api import RunnerJobsApi -from askui.tools.askui.askui_workspaces.api.runs_api import RunsApi -from askui.tools.askui.askui_workspaces.api.schedules_api import SchedulesApi -from askui.tools.askui.askui_workspaces.api.tools_api import ToolsApi -from askui.tools.askui.askui_workspaces.api.usage_api import UsageApi -from askui.tools.askui.askui_workspaces.api.workspace_memberships_api import ( - WorkspaceMembershipsApi, -) -from askui.tools.askui.askui_workspaces.api.workspaces_api import WorkspacesApi diff --git a/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py b/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py deleted file mode 100644 index 3a427691..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/access_tokens_api.py +++ /dev/null @@ -1,2163 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import ( - CreateSubjectAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import ( - CreateSubjectAccessTokenResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import ( - CreateWorkspaceAccessTokenRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import ( - CreateWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ( - ListAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ( - ListSubjectAccessTokensResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import ( - LookupAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import ( - LookupAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import ( - LookupWorkspaceAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import ( - LookupWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class AccessTokensApi: - """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 - def create_access_token_api_v1_access_tokens_post( - self, - create_subject_access_token_command: CreateSubjectAccessTokenCommand, - _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, - ) -> CreateSubjectAccessTokenResponseDtoInput: - """Create Access Token - - - :param create_subject_access_token_command: (required) - :type create_subject_access_token_command: CreateSubjectAccessTokenCommand - :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._create_access_token_api_v1_access_tokens_post_serialize( - create_subject_access_token_command=create_subject_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateSubjectAccessTokenResponseDtoInput", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_access_token_api_v1_access_tokens_post_with_http_info( - self, - create_subject_access_token_command: CreateSubjectAccessTokenCommand, - _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[CreateSubjectAccessTokenResponseDtoInput]: - """Create Access Token - - - :param create_subject_access_token_command: (required) - :type create_subject_access_token_command: CreateSubjectAccessTokenCommand - :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._create_access_token_api_v1_access_tokens_post_serialize( - create_subject_access_token_command=create_subject_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateSubjectAccessTokenResponseDtoInput", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_access_token_api_v1_access_tokens_post_without_preload_content( - self, - create_subject_access_token_command: CreateSubjectAccessTokenCommand, - _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 Access Token - - - :param create_subject_access_token_command: (required) - :type create_subject_access_token_command: CreateSubjectAccessTokenCommand - :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._create_access_token_api_v1_access_tokens_post_serialize( - create_subject_access_token_command=create_subject_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateSubjectAccessTokenResponseDtoInput", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_access_token_api_v1_access_tokens_post_serialize( - self, - create_subject_access_token_command, - _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 - if create_subject_access_token_command is not None: - _body_params = create_subject_access_token_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/access-tokens", - 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 - def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post( - self, - workspace_id: StrictStr, - create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto, - _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, - ) -> CreateWorkspaceAccessTokenResponseDto: - """Create Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param create_workspace_access_token_request_dto: (required) - :type create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto - :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._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize( - workspace_id=workspace_id, - create_workspace_access_token_request_dto=create_workspace_access_token_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceAccessTokenResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_with_http_info( - self, - workspace_id: StrictStr, - create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto, - _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[CreateWorkspaceAccessTokenResponseDto]: - """Create Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param create_workspace_access_token_request_dto: (required) - :type create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto - :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._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize( - workspace_id=workspace_id, - create_workspace_access_token_request_dto=create_workspace_access_token_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceAccessTokenResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_without_preload_content( - self, - workspace_id: StrictStr, - create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto, - _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 Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param create_workspace_access_token_request_dto: (required) - :type create_workspace_access_token_request_dto: CreateWorkspaceAccessTokenRequestDto - :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._create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize( - workspace_id=workspace_id, - create_workspace_access_token_request_dto=create_workspace_access_token_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceAccessTokenResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_access_token_api_v1_workspaces_workspace_id_access_tokens_post_serialize( - self, - workspace_id, - create_workspace_access_token_request_dto, - _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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_workspace_access_token_request_dto is not None: - _body_params = create_workspace_access_token_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces/{workspace_id}/access-tokens", - 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 - def delete_access_token_api_v1_access_tokens_token_id_delete( - self, - token_id: StrictStr, - _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: - """Delete Access Token - - - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_access_tokens_token_id_delete_serialize( - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_access_token_api_v1_access_tokens_token_id_delete_with_http_info( - self, - token_id: StrictStr, - _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]: - """Delete Access Token - - - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_access_tokens_token_id_delete_serialize( - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_access_token_api_v1_access_tokens_token_id_delete_without_preload_content( - self, - token_id: StrictStr, - _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 Access Token - - - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_access_tokens_token_id_delete_serialize( - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _delete_access_token_api_v1_access_tokens_token_id_delete_serialize( - self, - token_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 token_id is not None: - _path_params["token_id"] = token_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/access-tokens/{token_id}", - 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 - def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete( - self, - workspace_id: StrictStr, - token_id: StrictStr, - _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: - """Delete Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize( - workspace_id=workspace_id, - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_with_http_info( - self, - workspace_id: StrictStr, - token_id: StrictStr, - _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]: - """Delete Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize( - workspace_id=workspace_id, - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_without_preload_content( - self, - workspace_id: StrictStr, - token_id: StrictStr, - _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 Access Token - - - :param workspace_id: (required) - :type workspace_id: str - :param token_id: (required) - :type token_id: 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._delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize( - workspace_id=workspace_id, - token_id=token_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _delete_access_token_api_v1_workspaces_workspace_id_access_tokens_token_id_delete_serialize( - self, - workspace_id, - token_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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - if token_id is not None: - _path_params["token_id"] = token_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/workspaces/{workspace_id}/access-tokens/{token_id}", - 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 - def list_access_tokens_api_v1_access_tokens_get( - self, - subject_id: Optional[StrictStr] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = 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, - ) -> ListSubjectAccessTokensResponseDtoInput: - """List Access Tokens - - - :param subject_id: - :type subject_id: str - :param skip: - :type skip: int - :param limit: - :type limit: 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._list_access_tokens_api_v1_access_tokens_get_serialize( - subject_id=subject_id, - skip=skip, - limit=limit, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSubjectAccessTokensResponseDtoInput", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_access_tokens_api_v1_access_tokens_get_with_http_info( - self, - subject_id: Optional[StrictStr] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = 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[ListSubjectAccessTokensResponseDtoInput]: - """List Access Tokens - - - :param subject_id: - :type subject_id: str - :param skip: - :type skip: int - :param limit: - :type limit: 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._list_access_tokens_api_v1_access_tokens_get_serialize( - subject_id=subject_id, - skip=skip, - limit=limit, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSubjectAccessTokensResponseDtoInput", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_access_tokens_api_v1_access_tokens_get_without_preload_content( - self, - subject_id: Optional[StrictStr] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = 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 Access Tokens - - - :param subject_id: - :type subject_id: str - :param skip: - :type skip: int - :param limit: - :type limit: 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._list_access_tokens_api_v1_access_tokens_get_serialize( - subject_id=subject_id, - skip=skip, - limit=limit, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSubjectAccessTokensResponseDtoInput", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_access_tokens_api_v1_access_tokens_get_serialize( - self, - subject_id, - skip, - limit, - _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 - if subject_id is not None: - _query_params.append(("subject_id", subject_id)) - - if skip is not None: - _query_params.append(("skip", skip)) - - if limit is not None: - _query_params.append(("limit", limit)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/access-tokens", - 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 - def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get( - self, - workspace_id: StrictStr, - _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[ListAccessTokenResponseDto]: - """List Access Tokens - - - :param workspace_id: (required) - :type workspace_id: 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._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListAccessTokenResponseDto]", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_with_http_info( - self, - workspace_id: StrictStr, - _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[ListAccessTokenResponseDto]]: - """List Access Tokens - - - :param workspace_id: (required) - :type workspace_id: 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._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListAccessTokenResponseDto]", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_without_preload_content( - self, - workspace_id: StrictStr, - _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 Access Tokens - - - :param workspace_id: (required) - :type workspace_id: 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._list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListAccessTokenResponseDto]", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_access_tokens_api_v1_workspaces_workspace_id_access_tokens_get_serialize( - self, - workspace_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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workspaces/{workspace_id}/access-tokens", - 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 - def lookup_access_token_api_v1_access_tokens_lookup_post( - self, - lookup_access_token_command: LookupAccessTokenCommand, - _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, - ) -> LookupAccessTokenResponseDto: - """Lookup Global Access Token ID - - Converts a sensitive global-level access token into its stable identifier (access_token_id). The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param lookup_access_token_command: (required) - :type lookup_access_token_command: LookupAccessTokenCommand - :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._lookup_access_token_api_v1_access_tokens_lookup_post_serialize( - lookup_access_token_command=lookup_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupAccessTokenResponseDto", - "401": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def lookup_access_token_api_v1_access_tokens_lookup_post_with_http_info( - self, - lookup_access_token_command: LookupAccessTokenCommand, - _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[LookupAccessTokenResponseDto]: - """Lookup Global Access Token ID - - Converts a sensitive global-level access token into its stable identifier (access_token_id). The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param lookup_access_token_command: (required) - :type lookup_access_token_command: LookupAccessTokenCommand - :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._lookup_access_token_api_v1_access_tokens_lookup_post_serialize( - lookup_access_token_command=lookup_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupAccessTokenResponseDto", - "401": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def lookup_access_token_api_v1_access_tokens_lookup_post_without_preload_content( - self, - lookup_access_token_command: LookupAccessTokenCommand, - _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: - """Lookup Global Access Token ID - - Converts a sensitive global-level access token into its stable identifier (access_token_id). The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param lookup_access_token_command: (required) - :type lookup_access_token_command: LookupAccessTokenCommand - :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._lookup_access_token_api_v1_access_tokens_lookup_post_serialize( - lookup_access_token_command=lookup_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupAccessTokenResponseDto", - "401": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _lookup_access_token_api_v1_access_tokens_lookup_post_serialize( - self, - lookup_access_token_command, - _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 - if lookup_access_token_command is not None: - _body_params = lookup_access_token_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/access-tokens/lookup", - 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 - def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post( - self, - workspace_id: StrictStr, - lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand, - _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, - ) -> LookupWorkspaceAccessTokenResponseDto: - """Lookup Workspace Access Token ID - - Converts a sensitive workspace-level access token into its stable identifier (access_token_id) within the specified workspace. The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param workspace_id: (required) - :type workspace_id: str - :param lookup_workspace_access_token_command: (required) - :type lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand - :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._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize( - workspace_id=workspace_id, - lookup_workspace_access_token_command=lookup_workspace_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupWorkspaceAccessTokenResponseDto", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_with_http_info( - self, - workspace_id: StrictStr, - lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand, - _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[LookupWorkspaceAccessTokenResponseDto]: - """Lookup Workspace Access Token ID - - Converts a sensitive workspace-level access token into its stable identifier (access_token_id) within the specified workspace. The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param workspace_id: (required) - :type workspace_id: str - :param lookup_workspace_access_token_command: (required) - :type lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand - :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._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize( - workspace_id=workspace_id, - lookup_workspace_access_token_command=lookup_workspace_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupWorkspaceAccessTokenResponseDto", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_without_preload_content( - self, - workspace_id: StrictStr, - lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand, - _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: - """Lookup Workspace Access Token ID - - Converts a sensitive workspace-level access token into its stable identifier (access_token_id) within the specified workspace. The access token can be base64 encoded (similar to Authorization header) or passed raw. This enables clients to reference tokens without transmitting sensitive values, e.g., when trying to delete the token or retrieve usage for the token. - - :param workspace_id: (required) - :type workspace_id: str - :param lookup_workspace_access_token_command: (required) - :type lookup_workspace_access_token_command: LookupWorkspaceAccessTokenCommand - :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._lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize( - workspace_id=workspace_id, - lookup_workspace_access_token_command=lookup_workspace_access_token_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LookupWorkspaceAccessTokenResponseDto", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _lookup_workspace_access_token_api_v1_workspaces_workspace_id_access_tokens_lookup_post_serialize( - self, - workspace_id, - lookup_workspace_access_token_command, - _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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if lookup_workspace_access_token_command is not None: - _body_params = lookup_workspace_access_token_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces/{workspace_id}/access-tokens/lookup", - 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/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py b/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py deleted file mode 100644 index cc486540..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/agent_executions_api.py +++ /dev/null @@ -1,957 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import ( - Field, - StrictBytes, - StrictFloat, - StrictInt, - StrictStr, - validate_call, -) -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution -from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import ( - AgentExecutionUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import ( - AgentExecutionsListResponse, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class AgentExecutionsApi: - """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 - def create_agent_execution_api_v1_agent_executions_post( - self, - agent_id: StrictStr, - input_files: Annotated[ - List[Union[StrictBytes, StrictStr]], - Field( - min_length=1, - description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.", - ), - ], - _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, - ) -> AgentExecution: - """Create Agent Execution - - - :param agent_id: (required) - :type agent_id: str - :param input_files: Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files. (required) - :type input_files: List[bytearray] - :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._create_agent_execution_api_v1_agent_executions_post_serialize( - agent_id=agent_id, - input_files=input_files, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_agent_execution_api_v1_agent_executions_post_with_http_info( - self, - agent_id: StrictStr, - input_files: Annotated[ - List[Union[StrictBytes, StrictStr]], - Field( - min_length=1, - description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.", - ), - ], - _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[AgentExecution]: - """Create Agent Execution - - - :param agent_id: (required) - :type agent_id: str - :param input_files: Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files. (required) - :type input_files: List[bytearray] - :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._create_agent_execution_api_v1_agent_executions_post_serialize( - agent_id=agent_id, - input_files=input_files, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_agent_execution_api_v1_agent_executions_post_without_preload_content( - self, - agent_id: StrictStr, - input_files: Annotated[ - List[Union[StrictBytes, StrictStr]], - Field( - min_length=1, - description="Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files.", - ), - ], - _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 Agent Execution - - - :param agent_id: (required) - :type agent_id: str - :param input_files: Files to extract data from. Supported file extensions: {'.gif', '.eml', '.webp', '.png', '.jpeg', '.pdf', '.jpg', '.txt'}. Maximum total size: 100 MiB. We process the .eml files as text files, i.e., we don't process non-textual attachments and content properly. For that, extract them from the .eml files separating them into different files. (required) - :type input_files: List[bytearray] - :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._create_agent_execution_api_v1_agent_executions_post_serialize( - agent_id=agent_id, - input_files=input_files, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_agent_execution_api_v1_agent_executions_post_serialize( - self, - agent_id, - input_files, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "input_files": "csv", - } - - _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 - if agent_id is not None: - _query_params.append(("agent_id", agent_id)) - - # process the header parameters - # process the form parameters - if input_files is not None: - _files["input_files"] = input_files - # 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"] - ) - - # 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( - ["multipart/form-data"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/agent-executions", - 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 - def list_agent_executions_api_v1_agent_executions_get( - self, - agent_execution_id: Optional[List[StrictStr]] = None, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agent executions that match the query, only accurate up to 100." - ), - ] = 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, - ) -> AgentExecutionsListResponse: - """List Agent Executions - - List all agent executions matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_execution_id: - :type agent_execution_id: List[str] - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agent executions that match the query, only accurate up to 100. - :type expand: 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._list_agent_executions_api_v1_agent_executions_get_serialize( - agent_execution_id=agent_execution_id, - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecutionsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_agent_executions_api_v1_agent_executions_get_with_http_info( - self, - agent_execution_id: Optional[List[StrictStr]] = None, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agent executions that match the query, only accurate up to 100." - ), - ] = 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[AgentExecutionsListResponse]: - """List Agent Executions - - List all agent executions matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_execution_id: - :type agent_execution_id: List[str] - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agent executions that match the query, only accurate up to 100. - :type expand: 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._list_agent_executions_api_v1_agent_executions_get_serialize( - agent_execution_id=agent_execution_id, - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecutionsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_agent_executions_api_v1_agent_executions_get_without_preload_content( - self, - agent_execution_id: Optional[List[StrictStr]] = None, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agent executions that match the query, only accurate up to 100." - ), - ] = 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 Agent Executions - - List all agent executions matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_execution_id: - :type agent_execution_id: List[str] - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agent executions that match the query, only accurate up to 100. - :type expand: 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._list_agent_executions_api_v1_agent_executions_get_serialize( - agent_execution_id=agent_execution_id, - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecutionsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_agent_executions_api_v1_agent_executions_get_serialize( - self, - agent_execution_id, - agent_id, - workspace_id, - status, - skip, - limit, - expand, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "agent_execution_id": "multi", - "agent_id": "multi", - "workspace_id": "multi", - "status": "multi", - "expand": "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 - # process the query parameters - if agent_execution_id is not None: - _query_params.append(("agent_execution_id", agent_execution_id)) - - if agent_id is not None: - _query_params.append(("agent_id", agent_id)) - - if workspace_id is not None: - _query_params.append(("workspace_id", workspace_id)) - - if status is not None: - _query_params.append(("status", status)) - - if skip is not None: - _query_params.append(("skip", skip)) - - if limit is not None: - _query_params.append(("limit", limit)) - - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/agent-executions", - 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 - def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch( - self, - agent_execution_id: StrictStr, - agent_execution_update_command: AgentExecutionUpdateCommand, - _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, - ) -> AgentExecution: - """Update Agent Execution - - - :param agent_execution_id: (required) - :type agent_execution_id: str - :param agent_execution_update_command: (required) - :type agent_execution_update_command: AgentExecutionUpdateCommand - :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._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize( - agent_execution_id=agent_execution_id, - agent_execution_update_command=agent_execution_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_with_http_info( - self, - agent_execution_id: StrictStr, - agent_execution_update_command: AgentExecutionUpdateCommand, - _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[AgentExecution]: - """Update Agent Execution - - - :param agent_execution_id: (required) - :type agent_execution_id: str - :param agent_execution_update_command: (required) - :type agent_execution_update_command: AgentExecutionUpdateCommand - :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._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize( - agent_execution_id=agent_execution_id, - agent_execution_update_command=agent_execution_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_without_preload_content( - self, - agent_execution_id: StrictStr, - agent_execution_update_command: AgentExecutionUpdateCommand, - _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 Agent Execution - - - :param agent_execution_id: (required) - :type agent_execution_id: str - :param agent_execution_update_command: (required) - :type agent_execution_update_command: AgentExecutionUpdateCommand - :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._update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize( - agent_execution_id=agent_execution_id, - agent_execution_update_command=agent_execution_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentExecution", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _update_agent_execution_api_v1_agent_executions_agent_execution_id_patch_serialize( - self, - agent_execution_id, - agent_execution_update_command, - _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 agent_execution_id is not None: - _path_params["agent_execution_id"] = agent_execution_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if agent_execution_update_command is not None: - _body_params = agent_execution_update_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/agent-executions/{agent_execution_id}", - 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/src/askui/tools/askui/askui_workspaces/api/agents_api.py b/src/askui/tools/askui/askui_workspaces/api/agents_api.py deleted file mode 100644 index 8df7dcc3..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/agents_api.py +++ /dev/null @@ -1,900 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.agent import Agent -from askui.tools.askui.askui_workspaces.models.agent_create_command import ( - AgentCreateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_update_command import ( - AgentUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agents_list_response import ( - AgentsListResponse, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class AgentsApi: - """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 - def create_agent_api_v1_agents_post( - self, - agent_create_command: AgentCreateCommand, - _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, - ) -> Agent: - """Create Agent - - - :param agent_create_command: (required) - :type agent_create_command: AgentCreateCommand - :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._create_agent_api_v1_agents_post_serialize( - agent_create_command=agent_create_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_agent_api_v1_agents_post_with_http_info( - self, - agent_create_command: AgentCreateCommand, - _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[Agent]: - """Create Agent - - - :param agent_create_command: (required) - :type agent_create_command: AgentCreateCommand - :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._create_agent_api_v1_agents_post_serialize( - agent_create_command=agent_create_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_agent_api_v1_agents_post_without_preload_content( - self, - agent_create_command: AgentCreateCommand, - _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 Agent - - - :param agent_create_command: (required) - :type agent_create_command: AgentCreateCommand - :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._create_agent_api_v1_agents_post_serialize( - agent_create_command=agent_create_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_agent_api_v1_agents_post_serialize( - self, - agent_create_command, - _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 - if agent_create_command is not None: - _body_params = agent_create_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/agents", - 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 - def list_agents_api_v1_agents_get( - self, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agents that match the query, only accurate up to 100." - ), - ] = 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, - ) -> AgentsListResponse: - """List Agents - - List all agents matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agents that match the query, only accurate up to 100. - :type expand: 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._list_agents_api_v1_agents_get_serialize( - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_agents_api_v1_agents_get_with_http_info( - self, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agents that match the query, only accurate up to 100." - ), - ] = 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[AgentsListResponse]: - """List Agents - - List all agents matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agents that match the query, only accurate up to 100. - :type expand: 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._list_agents_api_v1_agents_get_serialize( - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_agents_api_v1_agents_get_without_preload_content( - self, - agent_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - status: Optional[List[StrictStr]] = None, - skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="total_count: Include the total number of agents that match the query, only accurate up to 100." - ), - ] = 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 Agents - - List all agents matching the query parameters sorted anti-chronologically by when they were last updated (`updated_at`). - - :param agent_id: - :type agent_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param status: - :type status: List[str] - :param skip: - :type skip: int - :param limit: - :type limit: int - :param expand: total_count: Include the total number of agents that match the query, only accurate up to 100. - :type expand: 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._list_agents_api_v1_agents_get_serialize( - agent_id=agent_id, - workspace_id=workspace_id, - status=status, - skip=skip, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "AgentsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_agents_api_v1_agents_get_serialize( - self, - agent_id, - workspace_id, - status, - skip, - limit, - expand, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "agent_id": "multi", - "workspace_id": "multi", - "status": "multi", - "expand": "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 - # process the query parameters - if agent_id is not None: - _query_params.append(("agent_id", agent_id)) - - if workspace_id is not None: - _query_params.append(("workspace_id", workspace_id)) - - if status is not None: - _query_params.append(("status", status)) - - if skip is not None: - _query_params.append(("skip", skip)) - - if limit is not None: - _query_params.append(("limit", limit)) - - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/agents", - 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 - def update_agent_api_v1_agents_agent_id_patch( - self, - agent_id: StrictStr, - agent_update_command: AgentUpdateCommand, - _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, - ) -> Agent: - """Update Agent - - - :param agent_id: (required) - :type agent_id: str - :param agent_update_command: (required) - :type agent_update_command: AgentUpdateCommand - :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._update_agent_api_v1_agents_agent_id_patch_serialize( - agent_id=agent_id, - agent_update_command=agent_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_agent_api_v1_agents_agent_id_patch_with_http_info( - self, - agent_id: StrictStr, - agent_update_command: AgentUpdateCommand, - _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[Agent]: - """Update Agent - - - :param agent_id: (required) - :type agent_id: str - :param agent_update_command: (required) - :type agent_update_command: AgentUpdateCommand - :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._update_agent_api_v1_agents_agent_id_patch_serialize( - agent_id=agent_id, - agent_update_command=agent_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def update_agent_api_v1_agents_agent_id_patch_without_preload_content( - self, - agent_id: StrictStr, - agent_update_command: AgentUpdateCommand, - _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 Agent - - - :param agent_id: (required) - :type agent_id: str - :param agent_update_command: (required) - :type agent_update_command: AgentUpdateCommand - :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._update_agent_api_v1_agents_agent_id_patch_serialize( - agent_id=agent_id, - agent_update_command=agent_update_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Agent", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _update_agent_api_v1_agents_agent_id_patch_serialize( - self, - agent_id, - agent_update_command, - _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 agent_id is not None: - _path_params["agent_id"] = agent_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if agent_update_command is not None: - _body_params = agent_update_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/agents/{agent_id}", - 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/src/askui/tools/askui/askui_workspaces/api/billing_api.py b/src/askui/tools/askui/askui_workspaces/api/billing_api.py deleted file mode 100644 index 064d24f5..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/billing_api.py +++ /dev/null @@ -1,549 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import ( - CreateCustomerPortalSessionRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import ( - CreateCustomerPortalSessionResponseDto, -) -from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import ( - GetSubscriptionResponseDto, -) -from askui.tools.askui.askui_workspaces.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 - def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post( - self, - workspace_id: StrictStr, - create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto, - _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, - ) -> CreateCustomerPortalSessionResponseDto: - """Create Customer Portal Session - - - :param workspace_id: (required) - :type workspace_id: str - :param create_customer_portal_session_request_dto: (required) - :type create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto - :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._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize( - workspace_id=workspace_id, - create_customer_portal_session_request_dto=create_customer_portal_session_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCustomerPortalSessionResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_with_http_info( - self, - workspace_id: StrictStr, - create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto, - _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[CreateCustomerPortalSessionResponseDto]: - """Create Customer Portal Session - - - :param workspace_id: (required) - :type workspace_id: str - :param create_customer_portal_session_request_dto: (required) - :type create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto - :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._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize( - workspace_id=workspace_id, - create_customer_portal_session_request_dto=create_customer_portal_session_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCustomerPortalSessionResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_without_preload_content( - self, - workspace_id: StrictStr, - create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto, - _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 Customer Portal Session - - - :param workspace_id: (required) - :type workspace_id: str - :param create_customer_portal_session_request_dto: (required) - :type create_customer_portal_session_request_dto: CreateCustomerPortalSessionRequestDto - :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._create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize( - workspace_id=workspace_id, - create_customer_portal_session_request_dto=create_customer_portal_session_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateCustomerPortalSessionResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_customer_portal_session_api_v1_workspaces_workspace_id_billing_customer_portal_session_post_serialize( - self, - workspace_id, - create_customer_portal_session_request_dto, - _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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_customer_portal_session_request_dto is not None: - _body_params = create_customer_portal_session_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces/{workspace_id}/billing/customer-portal-session", - 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 - def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get( - self, - workspace_id: StrictStr, - _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, - ) -> GetSubscriptionResponseDto: - """Get Workspace Subscription - - - :param workspace_id: (required) - :type workspace_id: 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._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_with_http_info( - self, - workspace_id: StrictStr, - _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[GetSubscriptionResponseDto]: - """Get Workspace Subscription - - - :param workspace_id: (required) - :type workspace_id: 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._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_without_preload_content( - self, - workspace_id: StrictStr, - _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 Workspace Subscription - - - :param workspace_id: (required) - :type workspace_id: 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._get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "GetSubscriptionResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_workspace_subscription_api_v1_workspaces_workspace_id_billing_subscription_get_serialize( - self, - workspace_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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workspaces/{workspace_id}/billing/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/src/askui/tools/askui/askui_workspaces/api/files_api.py b/src/askui/tools/askui/askui_workspaces/api/files_api.py deleted file mode 100644 index 761aba44..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/files_api.py +++ /dev/null @@ -1,1219 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import ( - Field, - StrictBytes, - StrictFloat, - StrictInt, - StrictStr, - validate_call, -) -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.files_list_response_dto import ( - FilesListResponseDto, -) -from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import ( - GenerateSignedCookiesCommand, -) -from askui.tools.askui.askui_workspaces.models.upload_file_response import ( - UploadFileResponse, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class FilesApi: - """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 - def delete_file_api_v1_files_file_path_delete( - self, - file_path: StrictStr, - _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: - """Delete File - - Delete a file at the specified path. - Deletes only one file with the given file path. Not bulk deletion. - If there is no file at the specified path, the operation will be a no-op, i.e., it will still return a 204 status code. - - :param file_path: (required) - :type file_path: 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._delete_file_api_v1_files_file_path_delete_serialize( - file_path=file_path, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_file_api_v1_files_file_path_delete_with_http_info( - self, - file_path: StrictStr, - _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]: - """Delete File - - Delete a file at the specified path. - Deletes only one file with the given file path. Not bulk deletion. - If there is no file at the specified path, the operation will be a no-op, i.e., it will still return a 204 status code. - - :param file_path: (required) - :type file_path: 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._delete_file_api_v1_files_file_path_delete_serialize( - file_path=file_path, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_file_api_v1_files_file_path_delete_without_preload_content( - self, - file_path: StrictStr, - _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 File - - Delete a file at the specified path. - Deletes only one file with the given file path. Not bulk deletion. - If there is no file at the specified path, the operation will be a no-op, i.e., it will still return a 204 status code. - - :param file_path: (required) - :type file_path: 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._delete_file_api_v1_files_file_path_delete_serialize( - file_path=file_path, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "404": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _delete_file_api_v1_files_file_path_delete_serialize( - self, - file_path, - _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 file_path is not None: - _path_params["file_path"] = file_path - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/files/{file_path}", - 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 - def list_files_api_v1_files_get( - self, - prefix: Annotated[ - Optional[StrictStr], - Field( - description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`." - ), - ] = None, - delimiter: Annotated[ - Optional[StrictStr], - Field( - description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response." - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field(description="Maximum number of files to return per page"), - ] = None, - continuation_token: Annotated[ - Optional[StrictStr], - Field( - description="Continuation token to get the next page of results (cursor-based pagination)" - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field(description="Expand the response with the signed URL to the file"), - ] = 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, - ) -> FilesListResponseDto: - """List Files - - List files. - To list files within a workspace, the `prefix` (query parameter) must start with `workspaces/{workspace_id}/` - Cannot list files across multiple workspaces, i.e., if the `prefix` does not start with `workspaces/{workspace_id}/`, it will return an empty list. - - :param prefix: Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`. - :type prefix: str - :param delimiter: Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response. - :type delimiter: str - :param limit: Maximum number of files to return per page - :type limit: int - :param continuation_token: Continuation token to get the next page of results (cursor-based pagination) - :type continuation_token: str - :param expand: Expand the response with the signed URL to the file - :type expand: 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._list_files_api_v1_files_get_serialize( - prefix=prefix, - delimiter=delimiter, - limit=limit, - continuation_token=continuation_token, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "FilesListResponseDto", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_files_api_v1_files_get_with_http_info( - self, - prefix: Annotated[ - Optional[StrictStr], - Field( - description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`." - ), - ] = None, - delimiter: Annotated[ - Optional[StrictStr], - Field( - description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response." - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field(description="Maximum number of files to return per page"), - ] = None, - continuation_token: Annotated[ - Optional[StrictStr], - Field( - description="Continuation token to get the next page of results (cursor-based pagination)" - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field(description="Expand the response with the signed URL to the file"), - ] = 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[FilesListResponseDto]: - """List Files - - List files. - To list files within a workspace, the `prefix` (query parameter) must start with `workspaces/{workspace_id}/` - Cannot list files across multiple workspaces, i.e., if the `prefix` does not start with `workspaces/{workspace_id}/`, it will return an empty list. - - :param prefix: Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`. - :type prefix: str - :param delimiter: Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response. - :type delimiter: str - :param limit: Maximum number of files to return per page - :type limit: int - :param continuation_token: Continuation token to get the next page of results (cursor-based pagination) - :type continuation_token: str - :param expand: Expand the response with the signed URL to the file - :type expand: 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._list_files_api_v1_files_get_serialize( - prefix=prefix, - delimiter=delimiter, - limit=limit, - continuation_token=continuation_token, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "FilesListResponseDto", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_files_api_v1_files_get_without_preload_content( - self, - prefix: Annotated[ - Optional[StrictStr], - Field( - description="Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`." - ), - ] = None, - delimiter: Annotated[ - Optional[StrictStr], - Field( - description="Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response." - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field(description="Maximum number of files to return per page"), - ] = None, - continuation_token: Annotated[ - Optional[StrictStr], - Field( - description="Continuation token to get the next page of results (cursor-based pagination)" - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field(description="Expand the response with the signed URL to the file"), - ] = 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 Files - - List files. - To list files within a workspace, the `prefix` (query parameter) must start with `workspaces/{workspace_id}/` - Cannot list files across multiple workspaces, i.e., if the `prefix` does not start with `workspaces/{workspace_id}/`, it will return an empty list. - - :param prefix: Prefix (path) to filter the files by. For folders it should end with `/`. Note that it is currently not possible to list files across workspaces but only within one workspace, i.e., which means that the prefix should start with `workspaces/{workspace_id}/`. - :type prefix: str - :param delimiter: Delimiter to group keys, e.g., `/` to group by folders, i.e., get files of the root folder or the folder identified by the prefix. If not provided, no folders are included in the response. - :type delimiter: str - :param limit: Maximum number of files to return per page - :type limit: int - :param continuation_token: Continuation token to get the next page of results (cursor-based pagination) - :type continuation_token: str - :param expand: Expand the response with the signed URL to the file - :type expand: 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._list_files_api_v1_files_get_serialize( - prefix=prefix, - delimiter=delimiter, - limit=limit, - continuation_token=continuation_token, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "FilesListResponseDto", - "401": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_files_api_v1_files_get_serialize( - self, - prefix, - delimiter, - limit, - continuation_token, - expand, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "expand": "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 - # process the query parameters - if prefix is not None: - _query_params.append(("prefix", prefix)) - - if delimiter is not None: - _query_params.append(("delimiter", delimiter)) - - if limit is not None: - _query_params.append(("limit", limit)) - - if continuation_token is not None: - _query_params.append(("continuation_token", continuation_token)) - - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/files", - 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 - def set_signed_cookies_api_v1_files_signed_cookies_post( - self, - generate_signed_cookies_command: GenerateSignedCookiesCommand, - _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, - ) -> object: - """Set Signed Cookies - - Set http-only, secure (signed) cookies for accessing (only READ access) files via AWS CloudFront across all accessible workspaces. If no workspace id is provided, no cookies will be set. - - :param generate_signed_cookies_command: (required) - :type generate_signed_cookies_command: GenerateSignedCookiesCommand - :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._set_signed_cookies_api_v1_files_signed_cookies_post_serialize( - generate_signed_cookies_command=generate_signed_cookies_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def set_signed_cookies_api_v1_files_signed_cookies_post_with_http_info( - self, - generate_signed_cookies_command: GenerateSignedCookiesCommand, - _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[object]: - """Set Signed Cookies - - Set http-only, secure (signed) cookies for accessing (only READ access) files via AWS CloudFront across all accessible workspaces. If no workspace id is provided, no cookies will be set. - - :param generate_signed_cookies_command: (required) - :type generate_signed_cookies_command: GenerateSignedCookiesCommand - :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._set_signed_cookies_api_v1_files_signed_cookies_post_serialize( - generate_signed_cookies_command=generate_signed_cookies_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def set_signed_cookies_api_v1_files_signed_cookies_post_without_preload_content( - self, - generate_signed_cookies_command: GenerateSignedCookiesCommand, - _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: - """Set Signed Cookies - - Set http-only, secure (signed) cookies for accessing (only READ access) files via AWS CloudFront across all accessible workspaces. If no workspace id is provided, no cookies will be set. - - :param generate_signed_cookies_command: (required) - :type generate_signed_cookies_command: GenerateSignedCookiesCommand - :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._set_signed_cookies_api_v1_files_signed_cookies_post_serialize( - generate_signed_cookies_command=generate_signed_cookies_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "object", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_signed_cookies_api_v1_files_signed_cookies_post_serialize( - self, - generate_signed_cookies_command, - _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 - if generate_signed_cookies_command is not None: - _body_params = generate_signed_cookies_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/files/signed-cookies", - 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 - def upload_file_api_v1_files_file_path_put( - self, - file_path: StrictStr, - file: Union[StrictBytes, StrictStr], - _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, - ) -> UploadFileResponse: - """Upload File - - Upload a file (max. 5 GB) to the specified path. - Specify the Content-Type header for accurate file type handling. - If Content-Type is omitted, the system will attempt to infer it. - For workspace-specific uploads, use path: `workspaces/{workspace_id}/...` - If a file with the same file path already exists, it will be overwritten. - If there are unsupported characters in the file path, they will be removed or replaced. - If the file path is longer than 1024 characters, the file path will be shortened starting from the end. - - :param file_path: (required) - :type file_path: str - :param file: (required) - :type file: bytearray - :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._upload_file_api_v1_files_file_path_put_serialize( - file_path=file_path, - file=file, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "UploadFileResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "413": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def upload_file_api_v1_files_file_path_put_with_http_info( - self, - file_path: StrictStr, - file: Union[StrictBytes, StrictStr], - _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[UploadFileResponse]: - """Upload File - - Upload a file (max. 5 GB) to the specified path. - Specify the Content-Type header for accurate file type handling. - If Content-Type is omitted, the system will attempt to infer it. - For workspace-specific uploads, use path: `workspaces/{workspace_id}/...` - If a file with the same file path already exists, it will be overwritten. - If there are unsupported characters in the file path, they will be removed or replaced. - If the file path is longer than 1024 characters, the file path will be shortened starting from the end. - - :param file_path: (required) - :type file_path: str - :param file: (required) - :type file: bytearray - :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._upload_file_api_v1_files_file_path_put_serialize( - file_path=file_path, - file=file, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "UploadFileResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "413": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def upload_file_api_v1_files_file_path_put_without_preload_content( - self, - file_path: StrictStr, - file: Union[StrictBytes, StrictStr], - _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: - """Upload File - - Upload a file (max. 5 GB) to the specified path. - Specify the Content-Type header for accurate file type handling. - If Content-Type is omitted, the system will attempt to infer it. - For workspace-specific uploads, use path: `workspaces/{workspace_id}/...` - If a file with the same file path already exists, it will be overwritten. - If there are unsupported characters in the file path, they will be removed or replaced. - If the file path is longer than 1024 characters, the file path will be shortened starting from the end. - - :param file_path: (required) - :type file_path: str - :param file: (required) - :type file: bytearray - :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._upload_file_api_v1_files_file_path_put_serialize( - file_path=file_path, - file=file, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "UploadFileResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "413": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _upload_file_api_v1_files_file_path_put_serialize( - self, - file_path, - file, - _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 file_path is not None: - _path_params["file_path"] = file_path - # process the query parameters - # process the header parameters - # process the form parameters - if file is not None: - _files["file"] = file - # 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"] - ) - - # 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( - ["multipart/form-data"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/files/{file_path}", - 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/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py b/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py deleted file mode 100644 index 189f4d6a..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/runner_jobs_api.py +++ /dev/null @@ -1,839 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import ( - CompleteRunnerJobRequestDto, -) -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import ( - LeaseRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import ( - PingRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class RunnerJobsApi: - """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 - def complete_api_v1_runner_jobs_complete_post( - self, - ack: StrictStr, - complete_runner_job_request_dto: CompleteRunnerJobRequestDto, - _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 - - - :param ack: (required) - :type ack: str - :param complete_runner_job_request_dto: (required) - :type complete_runner_job_request_dto: CompleteRunnerJobRequestDto - :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._complete_api_v1_runner_jobs_complete_post_serialize( - ack=ack, - complete_runner_job_request_dto=complete_runner_job_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def complete_api_v1_runner_jobs_complete_post_with_http_info( - self, - ack: StrictStr, - complete_runner_job_request_dto: CompleteRunnerJobRequestDto, - _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 - - - :param ack: (required) - :type ack: str - :param complete_runner_job_request_dto: (required) - :type complete_runner_job_request_dto: CompleteRunnerJobRequestDto - :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._complete_api_v1_runner_jobs_complete_post_serialize( - ack=ack, - complete_runner_job_request_dto=complete_runner_job_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def complete_api_v1_runner_jobs_complete_post_without_preload_content( - self, - ack: StrictStr, - complete_runner_job_request_dto: CompleteRunnerJobRequestDto, - _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 - - - :param ack: (required) - :type ack: str - :param complete_runner_job_request_dto: (required) - :type complete_runner_job_request_dto: CompleteRunnerJobRequestDto - :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._complete_api_v1_runner_jobs_complete_post_serialize( - ack=ack, - complete_runner_job_request_dto=complete_runner_job_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _complete_api_v1_runner_jobs_complete_post_serialize( - self, - ack, - complete_runner_job_request_dto, - _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 - if ack is not None: - _query_params.append(("ack", ack)) - - # process the header parameters - # process the form parameters - # process the body parameter - if complete_runner_job_request_dto is not None: - _body_params = complete_runner_job_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/runner-jobs/complete", - 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 - def lease_api_v1_runner_jobs_lease_post( - self, - runner_host: RunnerHost, - runner_id: StrictStr, - workspace_id: Optional[StrictStr] = None, - tags: Optional[List[Optional[StrictStr]]] = 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, - ) -> LeaseRunnerJobResponseDto: - """Lease - - - :param runner_host: (required) - :type runner_host: RunnerHost - :param runner_id: (required) - :type runner_id: str - :param workspace_id: - :type workspace_id: str - :param tags: - :type tags: List[Optional[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._lease_api_v1_runner_jobs_lease_post_serialize( - runner_host=runner_host, - runner_id=runner_id, - workspace_id=workspace_id, - tags=tags, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LeaseRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def lease_api_v1_runner_jobs_lease_post_with_http_info( - self, - runner_host: RunnerHost, - runner_id: StrictStr, - workspace_id: Optional[StrictStr] = None, - tags: Optional[List[Optional[StrictStr]]] = 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[LeaseRunnerJobResponseDto]: - """Lease - - - :param runner_host: (required) - :type runner_host: RunnerHost - :param runner_id: (required) - :type runner_id: str - :param workspace_id: - :type workspace_id: str - :param tags: - :type tags: List[Optional[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._lease_api_v1_runner_jobs_lease_post_serialize( - runner_host=runner_host, - runner_id=runner_id, - workspace_id=workspace_id, - tags=tags, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LeaseRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def lease_api_v1_runner_jobs_lease_post_without_preload_content( - self, - runner_host: RunnerHost, - runner_id: StrictStr, - workspace_id: Optional[StrictStr] = None, - tags: Optional[List[Optional[StrictStr]]] = 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: - """Lease - - - :param runner_host: (required) - :type runner_host: RunnerHost - :param runner_id: (required) - :type runner_id: str - :param workspace_id: - :type workspace_id: str - :param tags: - :type tags: List[Optional[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._lease_api_v1_runner_jobs_lease_post_serialize( - runner_host=runner_host, - runner_id=runner_id, - workspace_id=workspace_id, - tags=tags, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "LeaseRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _lease_api_v1_runner_jobs_lease_post_serialize( - self, - runner_host, - runner_id, - workspace_id, - tags, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "tags": "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 - # process the query parameters - if runner_host is not None: - _query_params.append(("runner_host", runner_host.value)) - - if runner_id is not None: - _query_params.append(("runner_id", runner_id)) - - if workspace_id is not None: - _query_params.append(("workspace_id", workspace_id)) - - if tags is not None: - _query_params.append(("tags", tags)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/runner-jobs/lease", - 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 - def ping_api_v1_runner_jobs_ping_post( - self, - ack: StrictStr, - _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, - ) -> PingRunnerJobResponseDto: - """Ping - - - :param ack: (required) - :type ack: 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._ping_api_v1_runner_jobs_ping_post_serialize( - ack=ack, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PingRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def ping_api_v1_runner_jobs_ping_post_with_http_info( - self, - ack: StrictStr, - _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[PingRunnerJobResponseDto]: - """Ping - - - :param ack: (required) - :type ack: 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._ping_api_v1_runner_jobs_ping_post_serialize( - ack=ack, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PingRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def ping_api_v1_runner_jobs_ping_post_without_preload_content( - self, - ack: StrictStr, - _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: - """Ping - - - :param ack: (required) - :type ack: 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._ping_api_v1_runner_jobs_ping_post_serialize( - ack=ack, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PingRunnerJobResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _ping_api_v1_runner_jobs_ping_post_serialize( - self, - ack, - _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 - if ack is not None: - _query_params.append(("ack", ack)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/runner-jobs/ping", - 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/src/askui/tools/askui/askui_workspaces/api/runs_api.py b/src/askui/tools/askui/askui_workspaces/api/runs_api.py deleted file mode 100644 index bae6fd6d..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/runs_api.py +++ /dev/null @@ -1,276 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ( - ListRunsResponseDto, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class RunsApi: - """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 - def list_runs_api_v1_workspaces_workspace_id_runs_get( - self, - workspace_id: StrictStr, - _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, - ) -> ListRunsResponseDto: - """List Runs - - - :param workspace_id: (required) - :type workspace_id: 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._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRunsResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_runs_api_v1_workspaces_workspace_id_runs_get_with_http_info( - self, - workspace_id: StrictStr, - _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[ListRunsResponseDto]: - """List Runs - - - :param workspace_id: (required) - :type workspace_id: 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._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRunsResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_runs_api_v1_workspaces_workspace_id_runs_get_without_preload_content( - self, - workspace_id: StrictStr, - _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 Runs - - - :param workspace_id: (required) - :type workspace_id: 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._list_runs_api_v1_workspaces_workspace_id_runs_get_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListRunsResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_runs_api_v1_workspaces_workspace_id_runs_get_serialize( - self, - workspace_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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workspaces/{workspace_id}/runs", - 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/src/askui/tools/askui/askui_workspaces/api/schedules_api.py b/src/askui/tools/askui/askui_workspaces/api/schedules_api.py deleted file mode 100644 index 1d9fdae0..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/schedules_api.py +++ /dev/null @@ -1,558 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import ( - CreateScheduleRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import ( - CreateScheduleResponseDto, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class SchedulesApi: - """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 - def create_schedule_api_v1_workspaces_workspace_id_schedules_post( - self, - workspace_id: StrictStr, - create_schedule_request_dto: CreateScheduleRequestDto, - _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, - ) -> CreateScheduleResponseDto: - """Create Schedule - - - :param workspace_id: (required) - :type workspace_id: str - :param create_schedule_request_dto: (required) - :type create_schedule_request_dto: CreateScheduleRequestDto - :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._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize( - workspace_id=workspace_id, - create_schedule_request_dto=create_schedule_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateScheduleResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_schedule_api_v1_workspaces_workspace_id_schedules_post_with_http_info( - self, - workspace_id: StrictStr, - create_schedule_request_dto: CreateScheduleRequestDto, - _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[CreateScheduleResponseDto]: - """Create Schedule - - - :param workspace_id: (required) - :type workspace_id: str - :param create_schedule_request_dto: (required) - :type create_schedule_request_dto: CreateScheduleRequestDto - :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._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize( - workspace_id=workspace_id, - create_schedule_request_dto=create_schedule_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateScheduleResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_schedule_api_v1_workspaces_workspace_id_schedules_post_without_preload_content( - self, - workspace_id: StrictStr, - create_schedule_request_dto: CreateScheduleRequestDto, - _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 Schedule - - - :param workspace_id: (required) - :type workspace_id: str - :param create_schedule_request_dto: (required) - :type create_schedule_request_dto: CreateScheduleRequestDto - :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._create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize( - workspace_id=workspace_id, - create_schedule_request_dto=create_schedule_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateScheduleResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_schedule_api_v1_workspaces_workspace_id_schedules_post_serialize( - self, - workspace_id, - create_schedule_request_dto, - _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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_schedule_request_dto is not None: - _body_params = create_schedule_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces/{workspace_id}/schedules", - 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 - def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post( - self, - schedule_id: StrictStr, - workspace_id: StrictStr, - _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: - """Suspend Schedule - - - :param schedule_id: (required) - :type schedule_id: str - :param workspace_id: (required) - :type workspace_id: 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._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize( - schedule_id=schedule_id, - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_with_http_info( - self, - schedule_id: StrictStr, - workspace_id: StrictStr, - _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]: - """Suspend Schedule - - - :param schedule_id: (required) - :type schedule_id: str - :param workspace_id: (required) - :type workspace_id: 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._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize( - schedule_id=schedule_id, - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_without_preload_content( - self, - schedule_id: StrictStr, - workspace_id: StrictStr, - _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: - """Suspend Schedule - - - :param schedule_id: (required) - :type schedule_id: str - :param workspace_id: (required) - :type workspace_id: 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._suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize( - schedule_id=schedule_id, - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _suspend_schedule_api_v1_workspaces_workspace_id_schedules_schedule_id_suspend_post_serialize( - self, - schedule_id, - workspace_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 schedule_id is not None: - _path_params["schedule_id"] = schedule_id - if workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces/{workspace_id}/schedules/{schedule_id}/suspend", - 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/src/askui/tools/askui/askui_workspaces/api/tools_api.py b/src/askui/tools/askui/askui_workspaces/api/tools_api.py deleted file mode 100644 index 0d9220de..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/tools_api.py +++ /dev/null @@ -1,304 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.extract_data_command import ( - ExtractDataCommand, -) -from askui.tools.askui.askui_workspaces.models.extract_data_response import ( - ExtractDataResponse, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class ToolsApi: - """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 - def extract_data_api_v1_tools_extract_data_post( - self, - extract_data_command: ExtractDataCommand, - _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, - ) -> ExtractDataResponse: - """Extract Data - - Extract data from files using a provided schema. Depending on the number of files, their size and type, and the complexity of the schema, it may take a while (up to multiple minutes) to complete so don't time out too early. - - :param extract_data_command: (required) - :type extract_data_command: ExtractDataCommand - :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._extract_data_api_v1_tools_extract_data_post_serialize( - extract_data_command=extract_data_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ExtractDataResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "409": "StringErrorResponse", - "422": "StringErrorResponse", - "500": "StringErrorResponse", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def extract_data_api_v1_tools_extract_data_post_with_http_info( - self, - extract_data_command: ExtractDataCommand, - _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[ExtractDataResponse]: - """Extract Data - - Extract data from files using a provided schema. Depending on the number of files, their size and type, and the complexity of the schema, it may take a while (up to multiple minutes) to complete so don't time out too early. - - :param extract_data_command: (required) - :type extract_data_command: ExtractDataCommand - :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._extract_data_api_v1_tools_extract_data_post_serialize( - extract_data_command=extract_data_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ExtractDataResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "409": "StringErrorResponse", - "422": "StringErrorResponse", - "500": "StringErrorResponse", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def extract_data_api_v1_tools_extract_data_post_without_preload_content( - self, - extract_data_command: ExtractDataCommand, - _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: - """Extract Data - - Extract data from files using a provided schema. Depending on the number of files, their size and type, and the complexity of the schema, it may take a while (up to multiple minutes) to complete so don't time out too early. - - :param extract_data_command: (required) - :type extract_data_command: ExtractDataCommand - :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._extract_data_api_v1_tools_extract_data_post_serialize( - extract_data_command=extract_data_command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ExtractDataResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "409": "StringErrorResponse", - "422": "StringErrorResponse", - "500": "StringErrorResponse", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _extract_data_api_v1_tools_extract_data_post_serialize( - self, - extract_data_command, - _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 - if extract_data_command is not None: - _body_params = extract_data_command - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/tools/extract-data", - 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/src/askui/tools/askui/askui_workspaces/api/usage_api.py b/src/askui/tools/askui/askui_workspaces/api/usage_api.py deleted file mode 100644 index 402305ab..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/usage_api.py +++ /dev/null @@ -1,529 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from datetime import datetime -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.usage_events_list_response import ( - UsageEventsListResponse, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class UsageApi: - """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 - def list_usage_events_api_v1_usage_events_get( - self, - workspace_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by workspace IDs") - ] = None, - user_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by user IDs") - ] = None, - access_token_id: Annotated[ - Optional[List[StrictStr]], - Field( - description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint." - ), - ] = None, - start_time: Annotated[ - Optional[datetime], - Field( - description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - end_time: Annotated[ - Optional[datetime], - Field( - description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - starting_after: Annotated[ - Optional[StrictStr], - Field( - description="Return events after this event ID; to be used for pagination, won't change the `total_count`" - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field( - description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)." - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events." - ), - ] = 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, - ) -> UsageEventsListResponse: - """List Usage Events - - List usage events sorted chronologically by timestamp. Events can be filtered by workspace, user, or access token. Filter combinations: - Multiple filters (e.g. workspace_id & user_id) use AND logic - Multiple values for same filter (e.g. workspace_id=123&workspace_id=456) use OR logic Pagination: - Use starting_after with event IDs for cursor-based navigation - has_more indicates if more events exist beyond limit - total_count (optional) shows total matching events up to 100,000 - - :param workspace_id: Filter by workspace IDs - :type workspace_id: List[str] - :param user_id: Filter by user IDs - :type user_id: List[str] - :param access_token_id: Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint. - :type access_token_id: List[str] - :param start_time: Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type start_time: datetime - :param end_time: Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type end_time: datetime - :param starting_after: Return events after this event ID; to be used for pagination, won't change the `total_count` - :type starting_after: str - :param limit: Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth). - :type limit: int - :param expand: Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events. - :type expand: 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._list_usage_events_api_v1_usage_events_get_serialize( - workspace_id=workspace_id, - user_id=user_id, - access_token_id=access_token_id, - start_time=start_time, - end_time=end_time, - starting_after=starting_after, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UsageEventsListResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_usage_events_api_v1_usage_events_get_with_http_info( - self, - workspace_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by workspace IDs") - ] = None, - user_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by user IDs") - ] = None, - access_token_id: Annotated[ - Optional[List[StrictStr]], - Field( - description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint." - ), - ] = None, - start_time: Annotated[ - Optional[datetime], - Field( - description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - end_time: Annotated[ - Optional[datetime], - Field( - description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - starting_after: Annotated[ - Optional[StrictStr], - Field( - description="Return events after this event ID; to be used for pagination, won't change the `total_count`" - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field( - description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)." - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events." - ), - ] = 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[UsageEventsListResponse]: - """List Usage Events - - List usage events sorted chronologically by timestamp. Events can be filtered by workspace, user, or access token. Filter combinations: - Multiple filters (e.g. workspace_id & user_id) use AND logic - Multiple values for same filter (e.g. workspace_id=123&workspace_id=456) use OR logic Pagination: - Use starting_after with event IDs for cursor-based navigation - has_more indicates if more events exist beyond limit - total_count (optional) shows total matching events up to 100,000 - - :param workspace_id: Filter by workspace IDs - :type workspace_id: List[str] - :param user_id: Filter by user IDs - :type user_id: List[str] - :param access_token_id: Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint. - :type access_token_id: List[str] - :param start_time: Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type start_time: datetime - :param end_time: Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type end_time: datetime - :param starting_after: Return events after this event ID; to be used for pagination, won't change the `total_count` - :type starting_after: str - :param limit: Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth). - :type limit: int - :param expand: Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events. - :type expand: 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._list_usage_events_api_v1_usage_events_get_serialize( - workspace_id=workspace_id, - user_id=user_id, - access_token_id=access_token_id, - start_time=start_time, - end_time=end_time, - starting_after=starting_after, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UsageEventsListResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_usage_events_api_v1_usage_events_get_without_preload_content( - self, - workspace_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by workspace IDs") - ] = None, - user_id: Annotated[ - Optional[List[StrictStr]], Field(description="Filter by user IDs") - ] = None, - access_token_id: Annotated[ - Optional[List[StrictStr]], - Field( - description="Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint." - ), - ] = None, - start_time: Annotated[ - Optional[datetime], - Field( - description="Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - end_time: Annotated[ - Optional[datetime], - Field( - description="Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z`" - ), - ] = None, - starting_after: Annotated[ - Optional[StrictStr], - Field( - description="Return events after this event ID; to be used for pagination, won't change the `total_count`" - ), - ] = None, - limit: Annotated[ - Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], - Field( - description="Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth)." - ), - ] = None, - expand: Annotated[ - Optional[List[StrictStr]], - Field( - description="Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events." - ), - ] = 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 Usage Events - - List usage events sorted chronologically by timestamp. Events can be filtered by workspace, user, or access token. Filter combinations: - Multiple filters (e.g. workspace_id & user_id) use AND logic - Multiple values for same filter (e.g. workspace_id=123&workspace_id=456) use OR logic Pagination: - Use starting_after with event IDs for cursor-based navigation - has_more indicates if more events exist beyond limit - total_count (optional) shows total matching events up to 100,000 - - :param workspace_id: Filter by workspace IDs - :type workspace_id: List[str] - :param user_id: Filter by user IDs - :type user_id: List[str] - :param access_token_id: Filter events by access token IDs **IMPORTANT**: This is not the same as the access token used in the authorization header of the request as this would be insecure but the id of the token. The id can be look up using the access token lookup endpoint. - :type access_token_id: List[str] - :param start_time: Include events starting from this time (inclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type start_time: datetime - :param end_time: Include events until this time (exclusive). Format: Unix timestamp, e.g., `1717689600`, or ISO 8601 with timezone, e.g., `2024-06-06T16:00:00Z` - :type end_time: datetime - :param starting_after: Return events after this event ID; to be used for pagination, won't change the `total_count` - :type starting_after: str - :param limit: Maximum number of events to return (in the response). The lower the faster the response time (less memory consumption or bandwidth). - :type limit: int - :param expand: Include additional fields in the response. - The total count represents all the number of events that match the query, not only the ones returned in the response, but is only accurate up to 100000 events. - :type expand: 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._list_usage_events_api_v1_usage_events_get_serialize( - workspace_id=workspace_id, - user_id=user_id, - access_token_id=access_token_id, - start_time=start_time, - end_time=end_time, - starting_after=starting_after, - limit=limit, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UsageEventsListResponse", - "401": "StringErrorResponse", - "403": "StringErrorResponse", - "500": "StringErrorResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_usage_events_api_v1_usage_events_get_serialize( - self, - workspace_id, - user_id, - access_token_id, - start_time, - end_time, - starting_after, - limit, - expand, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "workspace_id": "multi", - "user_id": "multi", - "access_token_id": "multi", - "expand": "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 - # process the query parameters - if workspace_id is not None: - _query_params.append(("workspace_id", workspace_id)) - - if user_id is not None: - _query_params.append(("user_id", user_id)) - - if access_token_id is not None: - _query_params.append(("access_token_id", access_token_id)) - - if start_time is not None: - if isinstance(start_time, datetime): - _query_params.append( - ( - "start_time", - start_time.strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append(("start_time", start_time)) - - if end_time is not None: - if isinstance(end_time, datetime): - _query_params.append( - ( - "end_time", - end_time.strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append(("end_time", end_time)) - - if starting_after is not None: - _query_params.append(("starting_after", starting_after)) - - if limit is not None: - _query_params.append(("limit", limit)) - - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/usage/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/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py b/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py deleted file mode 100644 index cff76c1d..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/workspace_memberships_api.py +++ /dev/null @@ -1,1099 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import ( - Field, - StrictFloat, - StrictInt, - StrictStr, - validate_call, -) -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import ( - CreateWorkspaceMembershipRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import ( - CreateWorkspaceMembershipResponseDto, -) -from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import ( - WorkspaceMembershipsListResponse, -) -from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import ( - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class WorkspaceMembershipsApi: - """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 - def create_workspace_membership_api_v1_workspace_memberships_post( - self, - create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto, - _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, - ) -> CreateWorkspaceMembershipResponseDto: - """Create Workspace Membership - - - :param create_workspace_membership_request_dto: (required) - :type create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto - :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._create_workspace_membership_api_v1_workspace_memberships_post_serialize( - create_workspace_membership_request_dto=create_workspace_membership_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateWorkspaceMembershipResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_workspace_membership_api_v1_workspace_memberships_post_with_http_info( - self, - create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto, - _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[CreateWorkspaceMembershipResponseDto]: - """Create Workspace Membership - - - :param create_workspace_membership_request_dto: (required) - :type create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto - :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._create_workspace_membership_api_v1_workspace_memberships_post_serialize( - create_workspace_membership_request_dto=create_workspace_membership_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateWorkspaceMembershipResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_workspace_membership_api_v1_workspace_memberships_post_without_preload_content( - self, - create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto, - _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 Workspace Membership - - - :param create_workspace_membership_request_dto: (required) - :type create_workspace_membership_request_dto: CreateWorkspaceMembershipRequestDto - :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._create_workspace_membership_api_v1_workspace_memberships_post_serialize( - create_workspace_membership_request_dto=create_workspace_membership_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "CreateWorkspaceMembershipResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_workspace_membership_api_v1_workspace_memberships_post_serialize( - self, - create_workspace_membership_request_dto, - _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 - if create_workspace_membership_request_dto is not None: - _body_params = create_workspace_membership_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspace-memberships", - 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 - def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete( - self, - workspace_membership_id: StrictStr, - _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: - """Delete Workspace Membership - - - :param workspace_membership_id: (required) - :type workspace_membership_id: 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._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize( - workspace_membership_id=workspace_membership_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "409": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_with_http_info( - self, - workspace_membership_id: StrictStr, - _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]: - """Delete Workspace Membership - - - :param workspace_membership_id: (required) - :type workspace_membership_id: 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._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize( - workspace_membership_id=workspace_membership_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "409": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_without_preload_content( - self, - workspace_membership_id: StrictStr, - _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 Workspace Membership - - - :param workspace_membership_id: (required) - :type workspace_membership_id: 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._delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize( - workspace_membership_id=workspace_membership_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "409": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _delete_workspace_membership_api_v1_workspace_memberships_workspace_membership_id_delete_serialize( - self, - workspace_membership_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 workspace_membership_id is not None: - _path_params["workspace_membership_id"] = workspace_membership_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/workspace-memberships/{workspace_membership_id}", - 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 - def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get( - self, - user_id: StrictStr, - expand: Optional[StrictStr] = 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[ - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto - ]: - """(Deprecated) List Workspace Membership - - - :param user_id: (required) - :type user_id: str - :param expand: - :type expand: 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 - warnings.warn( - "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", - DeprecationWarning, - ) - - _param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize( - user_id=user_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_with_http_info( - self, - user_id: StrictStr, - expand: Optional[StrictStr] = 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[ - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto - ] - ]: - """(Deprecated) List Workspace Membership - - - :param user_id: (required) - :type user_id: str - :param expand: - :type expand: 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 - warnings.warn( - "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", - DeprecationWarning, - ) - - _param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize( - user_id=user_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_without_preload_content( - self, - user_id: StrictStr, - expand: Optional[StrictStr] = 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: - """(Deprecated) List Workspace Membership - - - :param user_id: (required) - :type user_id: str - :param expand: - :type expand: 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 - warnings.warn( - "GET /api/v1/users/{user_id}/workspace-memberships is deprecated.", - DeprecationWarning, - ) - - _param = self._list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize( - user_id=user_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto]", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_workspace_membership_api_v1_users_user_id_workspace_memberships_get_serialize( - self, - user_id, - expand, - _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 user_id is not None: - _path_params["user_id"] = user_id - # process the query parameters - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/users/{user_id}/workspace-memberships", - 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 - def list_workspace_memberships_api_v1_workspace_memberships_get( - self, - user_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - expand: Optional[List[StrictStr]] = 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, - ) -> WorkspaceMembershipsListResponse: - """List Workspace Memberships - - - :param user_id: - :type user_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param expand: - :type expand: 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._list_workspace_memberships_api_v1_workspace_memberships_get_serialize( - user_id=user_id, - workspace_id=workspace_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkspaceMembershipsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def list_workspace_memberships_api_v1_workspace_memberships_get_with_http_info( - self, - user_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - expand: Optional[List[StrictStr]] = 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[WorkspaceMembershipsListResponse]: - """List Workspace Memberships - - - :param user_id: - :type user_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param expand: - :type expand: 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._list_workspace_memberships_api_v1_workspace_memberships_get_serialize( - user_id=user_id, - workspace_id=workspace_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkspaceMembershipsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def list_workspace_memberships_api_v1_workspace_memberships_get_without_preload_content( - self, - user_id: Optional[List[StrictStr]] = None, - workspace_id: Optional[List[StrictStr]] = None, - expand: Optional[List[StrictStr]] = 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 Workspace Memberships - - - :param user_id: - :type user_id: List[str] - :param workspace_id: - :type workspace_id: List[str] - :param expand: - :type expand: 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._list_workspace_memberships_api_v1_workspace_memberships_get_serialize( - user_id=user_id, - workspace_id=workspace_id, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "WorkspaceMembershipsListResponse", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _list_workspace_memberships_api_v1_workspace_memberships_get_serialize( - self, - user_id, - workspace_id, - expand, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None - - _collection_formats: Dict[str, str] = { - "user_id": "multi", - "workspace_id": "multi", - "expand": "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 - # process the query parameters - if user_id is not None: - _query_params.append(("user_id", user_id)) - - if workspace_id is not None: - _query_params.append(("workspace_id", workspace_id)) - - if expand is not None: - _query_params.append(("expand", expand)) - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/workspace-memberships", - 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/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py b/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py deleted file mode 100644 index 0b62346e..00000000 --- a/src/askui/tools/askui/askui_workspaces/api/workspaces_api.py +++ /dev/null @@ -1,823 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Dict, List, Optional, Tuple, Union - -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call -from typing_extensions import Annotated - -from askui.tools.askui.askui_workspaces.api_client import ApiClient, RequestSerialized -from askui.tools.askui.askui_workspaces.api_response import ApiResponse -from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import ( - CreateWorkspaceRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import ( - CreateWorkspaceResponseDto, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import ( - UpdateWorkspaceNameRequestDto, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import ( - UpdateWorkspaceNameResponseDto, -) -from askui.tools.askui.askui_workspaces.rest import RESTResponseType - - -class WorkspacesApi: - """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 - def create_workspace_api_v1_workspaces_post( - self, - create_workspace_request_dto: CreateWorkspaceRequestDto, - _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, - ) -> CreateWorkspaceResponseDto: - """Create Workspace - - - :param create_workspace_request_dto: (required) - :type create_workspace_request_dto: CreateWorkspaceRequestDto - :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._create_workspace_api_v1_workspaces_post_serialize( - create_workspace_request_dto=create_workspace_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def create_workspace_api_v1_workspaces_post_with_http_info( - self, - create_workspace_request_dto: CreateWorkspaceRequestDto, - _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[CreateWorkspaceResponseDto]: - """Create Workspace - - - :param create_workspace_request_dto: (required) - :type create_workspace_request_dto: CreateWorkspaceRequestDto - :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._create_workspace_api_v1_workspaces_post_serialize( - create_workspace_request_dto=create_workspace_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def create_workspace_api_v1_workspaces_post_without_preload_content( - self, - create_workspace_request_dto: CreateWorkspaceRequestDto, - _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 Workspace - - - :param create_workspace_request_dto: (required) - :type create_workspace_request_dto: CreateWorkspaceRequestDto - :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._create_workspace_api_v1_workspaces_post_serialize( - create_workspace_request_dto=create_workspace_request_dto, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateWorkspaceResponseDto", - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _create_workspace_api_v1_workspaces_post_serialize( - self, - create_workspace_request_dto, - _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 - if create_workspace_request_dto is not None: - _body_params = create_workspace_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/workspaces", - 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 - def delete_workspace_api_v1_workspaces_workspace_id_delete( - self, - workspace_id: StrictStr, - _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: - """Delete Workspace - - - :param workspace_id: (required) - :type workspace_id: 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._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def delete_workspace_api_v1_workspaces_workspace_id_delete_with_http_info( - self, - workspace_id: StrictStr, - _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]: - """Delete Workspace - - - :param workspace_id: (required) - :type workspace_id: 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._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def delete_workspace_api_v1_workspaces_workspace_id_delete_without_preload_content( - self, - workspace_id: StrictStr, - _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 Workspace - - - :param workspace_id: (required) - :type workspace_id: 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._delete_workspace_api_v1_workspaces_workspace_id_delete_serialize( - workspace_id=workspace_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _delete_workspace_api_v1_workspaces_workspace_id_delete_serialize( - self, - workspace_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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/api/v1/workspaces/{workspace_id}", - 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 - def update_workspace_name_api_v1_workspaces_workspace_id_patch( - self, - workspace_id: StrictStr, - update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto, - expand: Optional[StrictStr] = 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, - ) -> UpdateWorkspaceNameResponseDto: - """Update Workspace Name - - - :param workspace_id: (required) - :type workspace_id: str - :param update_workspace_name_request_dto: (required) - :type update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto - :param expand: - :type expand: 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._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize( - workspace_id=workspace_id, - update_workspace_name_request_dto=update_workspace_name_request_dto, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateWorkspaceNameResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - def update_workspace_name_api_v1_workspaces_workspace_id_patch_with_http_info( - self, - workspace_id: StrictStr, - update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto, - expand: Optional[StrictStr] = 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[UpdateWorkspaceNameResponseDto]: - """Update Workspace Name - - - :param workspace_id: (required) - :type workspace_id: str - :param update_workspace_name_request_dto: (required) - :type update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto - :param expand: - :type expand: 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._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize( - workspace_id=workspace_id, - update_workspace_name_request_dto=update_workspace_name_request_dto, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateWorkspaceNameResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - def update_workspace_name_api_v1_workspaces_workspace_id_patch_without_preload_content( - self, - workspace_id: StrictStr, - update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto, - expand: Optional[StrictStr] = 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 Workspace Name - - - :param workspace_id: (required) - :type workspace_id: str - :param update_workspace_name_request_dto: (required) - :type update_workspace_name_request_dto: UpdateWorkspaceNameRequestDto - :param expand: - :type expand: 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._update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize( - workspace_id=workspace_id, - update_workspace_name_request_dto=update_workspace_name_request_dto, - expand=expand, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateWorkspaceNameResponseDto", - "404": None, - "422": "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _update_workspace_name_api_v1_workspaces_workspace_id_patch_serialize( - self, - workspace_id, - update_workspace_name_request_dto, - expand, - _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 workspace_id is not None: - _path_params["workspace_id"] = workspace_id - # process the query parameters - if expand is not None: - _query_params.append(("expand", expand)) - - # process the header parameters - # process the form parameters - # process the body parameter - if update_workspace_name_request_dto is not None: - _body_params = update_workspace_name_request_dto - - # 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] = ["Basic", "Bearer"] - - return self.api_client.param_serialize( - method="PATCH", - resource_path="/api/v1/workspaces/{workspace_id}", - 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/src/askui/tools/askui/askui_workspaces/api_client.py b/src/askui/tools/askui/askui_workspaces/api_client.py deleted file mode 100644 index 6b98bffe..00000000 --- a/src/askui/tools/askui/askui_workspaces/api_client.py +++ /dev/null @@ -1,740 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -import datetime -import json -import mimetypes -import os -import re -import tempfile -import types -from enum import Enum -from pathlib import Path -from typing import Dict, List, Optional, Tuple, Type, Union -from urllib.parse import quote - -from dateutil.parser import parse -from pydantic import SecretStr - -import askui.tools.askui.askui_workspaces.models -from askui.tools.askui.askui_workspaces import rest -from askui.tools.askui.askui_workspaces.api_response import ( - ApiResponse, -) -from askui.tools.askui.askui_workspaces.api_response import ( - T as ApiResponseT, -) -from askui.tools.askui.askui_workspaces.configuration import Configuration -from askui.tools.askui.askui_workspaces.exceptions import ( - ApiException, - ApiValueError, -) - -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/0.1.2/python" - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__( - self, - exc_type: Type[BaseException] | None, - exc_value: BaseException | None, - traceback: types.TracebackType | None, - ) -> None: - pass - - @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 or self.configuration.ignore_operation_servers: - 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 - - 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 = 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) - return_data = self.deserialize( - response_text, response_type, content_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 - if isinstance(obj, Enum): - return obj.value - if isinstance(obj, SecretStr): - return obj.get_secret_value() - if isinstance(obj, self.PRIMITIVE_TYPES): - return obj - if isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] - if isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) - if isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if 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(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: str, response_type: str, content_type: Optional[str] - ): - """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"): - data = response_text - else: - raise ApiException( - status=0, reason="Unsupported content type: {0}".format(content_type) - ) - - 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(askui.tools.askui.askui_workspaces.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - if klass == object: - return self.__deserialize_object(data) - if klass == datetime.date: - return self.__deserialize_date(data) - if klass == datetime.datetime: - return self.__deserialize_datetime(data) - if issubclass(klass, Enum): - return self.__deserialize_enum(data, klass) - 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 Path.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(Path.parent(path), filename) - - with Path.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/src/askui/tools/askui/askui_workspaces/api_response.py b/src/askui/tools/askui/askui_workspaces/api_response.py deleted file mode 100644 index ca801da0..00000000 --- a/src/askui/tools/askui/askui_workspaces/api_response.py +++ /dev/null @@ -1,22 +0,0 @@ -"""API response object.""" - -from __future__ import annotations - -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 - """ - - 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/src/askui/tools/askui/askui_workspaces/configuration.py b/src/askui/tools/askui/askui_workspaces/configuration.py deleted file mode 100644 index e652f23e..00000000 --- a/src/askui/tools/askui/askui_workspaces/configuration.py +++ /dev/null @@ -1,504 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -import copy -import http.client as httplib -import logging -import multiprocessing -import sys -from logging import FileHandler -from typing import Optional - -import urllib3 - -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 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. - 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. - :param retries: Number of retries for API requests. - - :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 = askui.tools.askui.askui_workspaces.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, - 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 - """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.ignore_operation_servers = ignore_operation_servers - """Ignore operation servers - """ - 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( - "askui.tools.askui.askui_workspaces" - ) - 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 - """ - if debug is not None: - self.debug = debug - else: - 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 = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - 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 = retries - """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) - 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["Bearer"] = { - "type": "bearer", - "in": "header", - "key": "Authorization", - "value": "Bearer " + self.access_token, - } - if "Basic" in self.api_key: - auth["Basic"] = { - "type": "api_key", - "in": "header", - "key": "Authorization", - "value": self.get_api_key_with_prefix( - "Basic", - ), - } - 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: 0.1.30\n" - "SDK Package Version: 0.1.2".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/src/askui/tools/askui/askui_workspaces/exceptions.py b/src/askui/tools/askui/askui_workspaces/exceptions.py deleted file mode 100644 index 26599986..00000000 --- a/src/askui/tools/askui/askui_workspaces/exceptions.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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})\nReason: {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/src/askui/tools/askui/askui_workspaces/models/__init__.py b/src/askui/tools/askui/askui_workspaces/models/__init__.py deleted file mode 100644 index 9f46d386..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/__init__.py +++ /dev/null @@ -1,263 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -# import models into model package -from askui.tools.askui.askui_workspaces.models.access_token_response_dto import ( - AccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.agent import Agent -from askui.tools.askui.askui_workspaces.models.agent_create_command import ( - AgentCreateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import ( - AgentCreateCommandDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import ( - AgentDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution -from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import ( - AgentExecutionCancel, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import ( - AgentExecutionConfirm, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import ( - AgentExecutionPendingReview, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import ( - AgentExecutionStateCanceled, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import ( - AgentExecutionStateConfirmed, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import ( - AgentExecutionStateDeliveredToDestinationInput, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import ( - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import ( - AgentExecutionStateDeliveredToDestinationOutput, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import ( - AgentExecutionStatePendingDataExtraction, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import ( - AgentExecutionStatePendingInputs, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import ( - AgentExecutionStatePendingReview, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_update_command import ( - AgentExecutionUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agent_executions_list_response import ( - AgentExecutionsListResponse, -) -from askui.tools.askui.askui_workspaces.models.agent_update_command import ( - AgentUpdateCommand, -) -from askui.tools.askui.askui_workspaces.models.agents_list_response import ( - AgentsListResponse, -) -from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost -from askui.tools.askui.askui_workspaces.models.complete_runner_job_request_dto import ( - CompleteRunnerJobRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_request_dto import ( - CreateCustomerPortalSessionRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_customer_portal_session_response_dto import ( - CreateCustomerPortalSessionResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_schedule_request_dto import ( - CreateScheduleRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_schedule_response_dto import ( - CreateScheduleResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_command import ( - CreateSubjectAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_input import ( - CreateSubjectAccessTokenResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.create_subject_access_token_response_dto_output import ( - CreateSubjectAccessTokenResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_request_dto import ( - CreateWorkspaceAccessTokenRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_access_token_response_dto import ( - CreateWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_request_dto import ( - CreateWorkspaceMembershipRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_membership_response_dto import ( - CreateWorkspaceMembershipResponseDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_request_dto import ( - CreateWorkspaceRequestDto, -) -from askui.tools.askui.askui_workspaces.models.create_workspace_response_dto import ( - CreateWorkspaceResponseDto, -) -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import ( - DataDestinationAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import ( - DataDestinationAskUiWorkflowCreate, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import ( - DataDestinationDeliveryAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import ( - DataDestinationDeliveryWebhook, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook import ( - DataDestinationWebhook, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import ( - DataDestinationWebhookCreate, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger import ( - EmailAgentTrigger, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import ( - EmailAgentTriggerCreate, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import ( - EmailAgentTriggerUpdate, -) -from askui.tools.askui.askui_workspaces.models.extract_data_command import ( - ExtractDataCommand, -) -from askui.tools.askui.askui_workspaces.models.extract_data_response import ( - ExtractDataResponse, -) -from askui.tools.askui.askui_workspaces.models.file_dto import FileDto -from askui.tools.askui.askui_workspaces.models.files_list_response_dto import ( - FilesListResponseDto, -) -from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import ( - FilesListResponseDtoDataInner, -) -from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto -from askui.tools.askui.askui_workspaces.models.generate_signed_cookies_command import ( - GenerateSignedCookiesCommand, -) -from askui.tools.askui.askui_workspaces.models.get_subscription_response_dto import ( - GetSubscriptionResponseDto, -) -from askui.tools.askui.askui_workspaces.models.http_validation_error import ( - HTTPValidationError, -) -from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto import ( - LeaseRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import ( - LeaseRunnerJobResponseDtoData, -) -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import ( - LeaseRunnerJobResponseDtoDataCredentials, -) -from askui.tools.askui.askui_workspaces.models.list_access_token_response_dto import ( - ListAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_runs_response_dto import ( - ListRunsResponseDto, -) -from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_input import ( - ListSubjectAccessTokensResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.list_subject_access_tokens_response_dto_output import ( - ListSubjectAccessTokensResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_command import ( - LookupAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_access_token_response_dto import ( - LookupAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_command import ( - LookupWorkspaceAccessTokenCommand, -) -from askui.tools.askui.askui_workspaces.models.lookup_workspace_access_token_response_dto import ( - LookupWorkspaceAccessTokenResponseDto, -) -from askui.tools.askui.askui_workspaces.models.ping_runner_job_response_dto import ( - PingRunnerJobResponseDto, -) -from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto -from askui.tools.askui.askui_workspaces.models.run_status import RunStatus -from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate -from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment -from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost -from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus -from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ( - ScheduleReponseDto, -) -from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus -from askui.tools.askui.askui_workspaces.models.state import State -from askui.tools.askui.askui_workspaces.models.state1 import State1 -from askui.tools.askui.askui_workspaces.models.string_error_response import ( - StringErrorResponse, -) -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import ( - SubjectAccessTokenResponseDtoInput, -) -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import ( - SubjectAccessTokenResponseDtoOutput, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_request_dto import ( - UpdateWorkspaceNameRequestDto, -) -from askui.tools.askui.askui_workspaces.models.update_workspace_name_response_dto import ( - UpdateWorkspaceNameResponseDto, -) -from askui.tools.askui.askui_workspaces.models.upload_file_response import ( - UploadFileResponse, -) -from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent -from askui.tools.askui.askui_workspaces.models.usage_events_list_response import ( - UsageEventsListResponse, -) -from askui.tools.askui.askui_workspaces.models.user_dto import UserDto -from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError -from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ( - ValidationErrorLocInner, -) -from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse -from askui.tools.askui.askui_workspaces.models.workspace_access_token import ( - WorkspaceAccessToken, -) -from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto -from askui.tools.askui.askui_workspaces.models.workspace_memberships_list_response import ( - WorkspaceMembershipsListResponse, -) -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto, -) -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto, -) -from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import ( - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto, -) diff --git a/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py deleted file mode 100644 index 88f7067d..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/access_token_response_dto.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class AccessTokenResponseDto(BaseModel): - """ - AccessTokenResponseDto - """ # noqa: E501 - - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - id: StrictStr - name: StrictStr - expires_at: Optional[datetime] = Field(default=None, alias="expiresAt") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["createdAt", "id", "name", "expiresAt"] - - 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 AccessTokenResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccessTokenResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "createdAt": obj.get("createdAt"), - "id": obj.get("id"), - "name": obj.get("name"), - "expiresAt": obj.get("expiresAt"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent.py b/src/askui/tools/askui/askui_workspaces/models/agent.py deleted file mode 100644 index fafe6f55..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.agent_data_destinations_inner import ( - AgentDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger import ( - EmailAgentTrigger, -) -from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema - - -class Agent(BaseModel): - """ - Agent - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - name: Annotated[str, Field(strict=True)] = Field( - description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters." - ) - status: StrictStr - auto_confirm: StrictBool = Field( - description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.", - alias="autoConfirm", - ) - description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = "" - email_trigger: EmailAgentTrigger = Field(alias="emailTrigger") - data_schema: JsonSchema = Field( - description=' The data schema describes the data to extract in form of a [JSON schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes). Use the ["description" keyword](https://json-schema.org/understanding-json-schema/reference/annotations) of each property to provide additional information about the field, e.g., the prompt for extraction from sources. ', - alias="dataSchema", - ) - data_destinations: List[AgentDataDestinationsInner] = Field( - alias="dataDestinations" - ) - workspace_id: StrictStr = Field(alias="workspaceId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "name", - "status", - "autoConfirm", - "description", - "emailTrigger", - "dataSchema", - "dataDestinations", - "workspaceId", - ] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/" - ) - return value - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value not in set(["ACTIVE", "ARCHIVED"]): - raise ValueError("must be one of enum values ('ACTIVE', 'ARCHIVED')") - 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 Agent 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of email_trigger - if self.email_trigger: - _dict["emailTrigger"] = self.email_trigger.to_dict() - # override the default output from pydantic by calling `to_dict()` of data_schema - if self.data_schema: - _dict["dataSchema"] = self.data_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in data_destinations (list) - _items = [] - if self.data_destinations: - for _item in self.data_destinations: - if _item: - _items.append(_item.to_dict()) - _dict["dataDestinations"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Agent 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"), - "name": obj.get("name"), - "status": obj.get("status"), - "autoConfirm": obj.get("autoConfirm"), - "description": obj.get("description") - if obj.get("description") is not None - else "", - "emailTrigger": EmailAgentTrigger.from_dict(obj["emailTrigger"]) - if obj.get("emailTrigger") is not None - else None, - "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) - if obj.get("dataSchema") is not None - else None, - "dataDestinations": [ - AgentDataDestinationsInner.from_dict(_item) - for _item in obj["dataDestinations"] - ] - if obj.get("dataDestinations") is not None - else None, - "workspaceId": obj.get("workspaceId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py deleted file mode 100644 index 24bf09c2..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_create_command.py +++ /dev/null @@ -1,193 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.agent_create_command_data_destinations_inner import ( - AgentCreateCommandDataDestinationsInner, -) -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_create import ( - EmailAgentTriggerCreate, -) -from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema - - -class AgentCreateCommand(BaseModel): - """ - AgentCreateCommand - """ # noqa: E501 - - name: Annotated[str, Field(strict=True)] = Field( - description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters." - ) - description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = "" - data_schema: JsonSchema = Field( - description="The JSON schema of the data that the agent is going to extract from documents uploaded. The schema must comply with Draft 2020-12. The schema (root) must be an object with at least one property. The size of the schema must not exceed 15 MB.", - alias="dataSchema", - ) - auto_confirm: Optional[StrictBool] = Field( - default=False, - description="If true, the agent will automatically confirm the data extracted, i.e., no review is necessary.", - alias="autoConfirm", - ) - data_destinations: Optional[List[AgentCreateCommandDataDestinationsInner]] = Field( - default=None, alias="dataDestinations" - ) - parent_id: Optional[StrictStr] = Field(default=None, alias="parentId") - email_trigger: Optional[EmailAgentTriggerCreate] = Field( - default=None, alias="emailTrigger" - ) - workspace_id: StrictStr = Field(alias="workspaceId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "name", - "description", - "dataSchema", - "autoConfirm", - "dataDestinations", - "parentId", - "emailTrigger", - "workspaceId", - ] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/" - ) - 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 AgentCreateCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data_schema - if self.data_schema: - _dict["dataSchema"] = self.data_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in data_destinations (list) - _items = [] - if self.data_destinations: - for _item in self.data_destinations: - if _item: - _items.append(_item.to_dict()) - _dict["dataDestinations"] = _items - # override the default output from pydantic by calling `to_dict()` of email_trigger - if self.email_trigger: - _dict["emailTrigger"] = self.email_trigger.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if parent_id (nullable) is None - # and model_fields_set contains the field - if self.parent_id is None and "parent_id" in self.model_fields_set: - _dict["parentId"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentCreateCommand 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"), - "description": obj.get("description") - if obj.get("description") is not None - else "", - "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) - if obj.get("dataSchema") is not None - else None, - "autoConfirm": obj.get("autoConfirm") - if obj.get("autoConfirm") is not None - else False, - "dataDestinations": [ - AgentCreateCommandDataDestinationsInner.from_dict(_item) - for _item in obj["dataDestinations"] - ] - if obj.get("dataDestinations") is not None - else None, - "parentId": obj.get("parentId"), - "emailTrigger": EmailAgentTriggerCreate.from_dict(obj["emailTrigger"]) - if obj.get("emailTrigger") is not None - else None, - "workspaceId": obj.get("workspaceId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py deleted file mode 100644 index 3bc1c884..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_create_command_data_destinations_inner.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow_create import ( - DataDestinationAskUiWorkflowCreate, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook_create import ( - DataDestinationWebhookCreate, -) - -AGENTCREATECOMMANDDATADESTINATIONSINNER_ONE_OF_SCHEMAS = [ - "DataDestinationAskUiWorkflowCreate", - "DataDestinationWebhookCreate", -] - - -class AgentCreateCommandDataDestinationsInner(BaseModel): - """ - AgentCreateCommandDataDestinationsInner - """ - - # data type: DataDestinationAskUiWorkflowCreate - oneof_schema_1_validator: Optional[DataDestinationAskUiWorkflowCreate] = None - # data type: DataDestinationWebhookCreate - oneof_schema_2_validator: Optional[DataDestinationWebhookCreate] = None - actual_instance: Optional[ - Union[DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate] - ] = None - one_of_schemas: Set[str] = { - "DataDestinationAskUiWorkflowCreate", - "DataDestinationWebhookCreate", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = AgentCreateCommandDataDestinationsInner.model_construct() - error_messages = [] - match = 0 - # validate data type: DataDestinationAskUiWorkflowCreate - if not isinstance(v, DataDestinationAskUiWorkflowCreate): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflowCreate`" - ) - else: - match += 1 - # validate data type: DataDestinationWebhookCreate - if not isinstance(v, DataDestinationWebhookCreate): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationWebhookCreate`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("type") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `type` in the input." - ) - - # check if data type is `DataDestinationAskUiWorkflowCreate` - if _data_type == "ASKUI_WORKFLOW": - instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationWebhookCreate` - if _data_type == "WEBHOOK": - instance.actual_instance = DataDestinationWebhookCreate.from_json(json_str) - return instance - - # check if data type is `DataDestinationAskUiWorkflowCreate` - if _data_type == "DataDestinationAskUiWorkflowCreate": - instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationWebhookCreate` - if _data_type == "DataDestinationWebhookCreate": - instance.actual_instance = DataDestinationWebhookCreate.from_json(json_str) - return instance - - # deserialize data into DataDestinationAskUiWorkflowCreate - try: - instance.actual_instance = DataDestinationAskUiWorkflowCreate.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into DataDestinationWebhookCreate - try: - instance.actual_instance = DataDestinationWebhookCreate.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into AgentCreateCommandDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflowCreate, DataDestinationWebhookCreate. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - DataDestinationAskUiWorkflowCreate, - DataDestinationWebhookCreate, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py deleted file mode 100644 index 6fdfd525..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_data_destinations_inner.py +++ /dev/null @@ -1,206 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.data_destination_ask_ui_workflow import ( - DataDestinationAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_webhook import ( - DataDestinationWebhook, -) - -AGENTDATADESTINATIONSINNER_ONE_OF_SCHEMAS = [ - "DataDestinationAskUiWorkflow", - "DataDestinationWebhook", -] - - -class AgentDataDestinationsInner(BaseModel): - """ - AgentDataDestinationsInner - """ - - # data type: DataDestinationAskUiWorkflow - oneof_schema_1_validator: Optional[DataDestinationAskUiWorkflow] = None - # data type: DataDestinationWebhook - oneof_schema_2_validator: Optional[DataDestinationWebhook] = None - actual_instance: Optional[ - Union[DataDestinationAskUiWorkflow, DataDestinationWebhook] - ] = None - one_of_schemas: Set[str] = { - "DataDestinationAskUiWorkflow", - "DataDestinationWebhook", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = AgentDataDestinationsInner.model_construct() - error_messages = [] - match = 0 - # validate data type: DataDestinationAskUiWorkflow - if not isinstance(v, DataDestinationAskUiWorkflow): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationAskUiWorkflow`" - ) - else: - match += 1 - # validate data type: DataDestinationWebhook - if not isinstance(v, DataDestinationWebhook): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationWebhook`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("type") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `type` in the input." - ) - - # check if data type is `DataDestinationAskUiWorkflow` - if _data_type == "ASKUI_WORKFLOW": - instance.actual_instance = DataDestinationAskUiWorkflow.from_json(json_str) - return instance - - # check if data type is `DataDestinationWebhook` - if _data_type == "WEBHOOK": - instance.actual_instance = DataDestinationWebhook.from_json(json_str) - return instance - - # check if data type is `DataDestinationAskUiWorkflow` - if _data_type == "DataDestinationAskUiWorkflow": - instance.actual_instance = DataDestinationAskUiWorkflow.from_json(json_str) - return instance - - # check if data type is `DataDestinationWebhook` - if _data_type == "DataDestinationWebhook": - instance.actual_instance = DataDestinationWebhook.from_json(json_str) - return instance - - # deserialize data into DataDestinationAskUiWorkflow - try: - instance.actual_instance = DataDestinationAskUiWorkflow.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into DataDestinationWebhook - try: - instance.actual_instance = DataDestinationWebhook.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into AgentDataDestinationsInner with oneOf schemas: DataDestinationAskUiWorkflow, DataDestinationWebhook. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[Dict[str, Any], DataDestinationAskUiWorkflow, DataDestinationWebhook] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution.py deleted file mode 100644 index 72328ada..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.state import State - - -class AgentExecution(BaseModel): - """ - AgentExecution - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - agent_id: StrictStr = Field(alias="agentId") - workspace_id: StrictStr = Field(alias="workspaceId") - state: State - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "agentId", - "workspaceId", - "state", - ] - - 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 AgentExecution 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of state - if self.state: - _dict["state"] = self.state.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecution 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"), - "agentId": obj.get("agentId"), - "workspaceId": obj.get("workspaceId"), - "state": State.from_dict(obj["state"]) - if obj.get("state") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py deleted file mode 100644 index b12878f3..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_cancel.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr, field_validator -from typing_extensions import Self - - -class AgentExecutionCancel(BaseModel): - """ - AgentExecutionCancel - """ # noqa: E501 - - status: Optional[StrictStr] = "CANCELED" - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["CANCELED"]): - raise ValueError("must be one of enum values ('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 AgentExecutionCancel 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionCancel from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "CANCELED" - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py deleted file mode 100644 index fd42e1bb..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_confirm.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionConfirm(BaseModel): - """ - AgentExecutionConfirm - """ # noqa: E501 - - status: Optional[StrictStr] = "CONFIRMED" - data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "dataConfirmed"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["CONFIRMED"]): - raise ValueError("must be one of enum values ('CONFIRMED')") - 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 AgentExecutionConfirm 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionConfirm from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "CONFIRMED", - "dataConfirmed": obj.get("dataConfirmed"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py deleted file mode 100644 index ba123c7c..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_pending_review.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionPendingReview(BaseModel): - """ - AgentExecutionPendingReview - """ # noqa: E501 - - status: Optional[StrictStr] = "PENDING_REVIEW" - data_extracted: Dict[str, Any] = Field(alias="dataExtracted") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "dataExtracted"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["PENDING_REVIEW"]): - raise ValueError("must be one of enum values ('PENDING_REVIEW')") - 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 AgentExecutionPendingReview 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionPendingReview from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "PENDING_REVIEW", - "dataExtracted": obj.get("dataExtracted"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py deleted file mode 100644 index 3a220fd2..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_canceled.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionStateCanceled(BaseModel): - """ - AgentExecutionStateCanceled - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="CANCELED", description="The agent execution was canceled by the user." - ) - data_extracted: Optional[Dict[str, Any]] = Field( - default=None, alias="dataExtracted" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "dataExtracted"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["CANCELED"]): - raise ValueError("must be one of enum values ('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 AgentExecutionStateCanceled 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if data_extracted (nullable) is None - # and model_fields_set contains the field - if self.data_extracted is None and "data_extracted" in self.model_fields_set: - _dict["dataExtracted"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStateCanceled from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "CANCELED", - "dataExtracted": obj.get("dataExtracted"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py deleted file mode 100644 index 7f82c639..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_confirmed.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionStateConfirmed(BaseModel): - """ - AgentExecutionStateConfirmed - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="CONFIRMED", description="The user confirmed the extracted data." - ) - data_extracted: Dict[str, Any] = Field(alias="dataExtracted") - data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "dataExtracted", "dataConfirmed"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["CONFIRMED"]): - raise ValueError("must be one of enum values ('CONFIRMED')") - 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 AgentExecutionStateConfirmed 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStateConfirmed from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "CONFIRMED", - "dataExtracted": obj.get("dataExtracted"), - "dataConfirmed": obj.get("dataConfirmed"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py deleted file mode 100644 index 26b2194e..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.24 -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, field_validator -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_deliveries_inner import ( - AgentExecutionStateDeliveredToDestinationDeliveriesInner, -) - - -class AgentExecutionStateDeliveredToDestination(BaseModel): - """ - AgentExecutionStateDeliveredToDestination - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="DELIVERED_TO_DESTINATION", - description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.", - ) - data_extracted: Dict[str, Any] = Field(alias="dataExtracted") - data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed") - deliveries: Optional[ - List[AgentExecutionStateDeliveredToDestinationDeliveriesInner] - ] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "status", - "dataExtracted", - "dataConfirmed", - "deliveries", - ] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["DELIVERED_TO_DESTINATION"]): - raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')") - 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 AgentExecutionStateDeliveredToDestination 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 deliveries (list) - _items = [] - if self.deliveries: - for _item in self.deliveries: - if _item: - _items.append(_item.to_dict()) - _dict["deliveries"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStateDeliveredToDestination from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "DELIVERED_TO_DESTINATION", - "dataExtracted": obj.get("dataExtracted"), - "dataConfirmed": obj.get("dataConfirmed"), - "deliveries": [ - AgentExecutionStateDeliveredToDestinationDeliveriesInner.from_dict( - _item - ) - for _item in obj["deliveries"] - ] - if obj.get("deliveries") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py deleted file mode 100644 index 3e8b1d1d..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_deliveries_inner.py +++ /dev/null @@ -1,224 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.24 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import ( - DataDestinationDeliveryAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import ( - DataDestinationDeliveryWebhook, -) - -AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONDELIVERIESINNER_ONE_OF_SCHEMAS = [ - "DataDestinationDeliveryAskUiWorkflow", - "DataDestinationDeliveryWebhook", -] - - -class AgentExecutionStateDeliveredToDestinationDeliveriesInner(BaseModel): - """ - AgentExecutionStateDeliveredToDestinationDeliveriesInner - """ - - # data type: DataDestinationDeliveryAskUiWorkflow - oneof_schema_1_validator: Optional[DataDestinationDeliveryAskUiWorkflow] = None - # data type: DataDestinationDeliveryWebhook - oneof_schema_2_validator: Optional[DataDestinationDeliveryWebhook] = None - actual_instance: Optional[ - Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook] - ] = None - one_of_schemas: Set[str] = { - "DataDestinationDeliveryAskUiWorkflow", - "DataDestinationDeliveryWebhook", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = ( - AgentExecutionStateDeliveredToDestinationDeliveriesInner.model_construct() - ) - error_messages = [] - match = 0 - # validate data type: DataDestinationDeliveryAskUiWorkflow - if not isinstance(v, DataDestinationDeliveryAskUiWorkflow): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`" - ) - else: - match += 1 - # validate data type: DataDestinationDeliveryWebhook - if not isinstance(v, DataDestinationDeliveryWebhook): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("type") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `type` in the input." - ) - - # check if data type is `DataDestinationDeliveryAskUiWorkflow` - if _data_type == "ASKUI_WORKFLOW": - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryWebhook` - if _data_type == "WEBHOOK": - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryAskUiWorkflow` - if _data_type == "DataDestinationDeliveryAskUiWorkflow": - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryWebhook` - if _data_type == "DataDestinationDeliveryWebhook": - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - return instance - - # deserialize data into DataDestinationDeliveryAskUiWorkflow - try: - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into DataDestinationDeliveryWebhook - try: - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - DataDestinationDeliveryAskUiWorkflow, - DataDestinationDeliveryWebhook, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py deleted file mode 100644 index ac9d7276..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr, field_validator -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import ( - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner, -) - - -class AgentExecutionStateDeliveredToDestinationInput(BaseModel): - """ - AgentExecutionStateDeliveredToDestinationInput - """ # noqa: E501 - - status: Optional[StrictStr] = "DELIVERED_TO_DESTINATION" - deliveries: Optional[ - List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner] - ] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "deliveries"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["DELIVERED_TO_DESTINATION"]): - raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')") - 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 AgentExecutionStateDeliveredToDestinationInput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 deliveries (list) - _items = [] - if self.deliveries: - for _item in self.deliveries: - if _item: - _items.append(_item.to_dict()) - _dict["deliveries"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStateDeliveredToDestinationInput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "DELIVERED_TO_DESTINATION", - "deliveries": [ - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict( - _item - ) - for _item in obj["deliveries"] - ] - if obj.get("deliveries") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py deleted file mode 100644 index e3c436a3..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_input_deliveries_inner.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_ask_ui_workflow import ( - DataDestinationDeliveryAskUiWorkflow, -) -from askui.tools.askui.askui_workspaces.models.data_destination_delivery_webhook import ( - DataDestinationDeliveryWebhook, -) - -AGENTEXECUTIONSTATEDELIVEREDTODESTINATIONINPUTDELIVERIESINNER_ONE_OF_SCHEMAS = [ - "DataDestinationDeliveryAskUiWorkflow", - "DataDestinationDeliveryWebhook", -] - - -class AgentExecutionStateDeliveredToDestinationInputDeliveriesInner(BaseModel): - """ - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner - """ - - # data type: DataDestinationDeliveryAskUiWorkflow - oneof_schema_1_validator: Optional[DataDestinationDeliveryAskUiWorkflow] = None - # data type: DataDestinationDeliveryWebhook - oneof_schema_2_validator: Optional[DataDestinationDeliveryWebhook] = None - actual_instance: Optional[ - Union[DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook] - ] = None - one_of_schemas: Set[str] = { - "DataDestinationDeliveryAskUiWorkflow", - "DataDestinationDeliveryWebhook", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.model_construct() - error_messages = [] - match = 0 - # validate data type: DataDestinationDeliveryAskUiWorkflow - if not isinstance(v, DataDestinationDeliveryAskUiWorkflow): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryAskUiWorkflow`" - ) - else: - match += 1 - # validate data type: DataDestinationDeliveryWebhook - if not isinstance(v, DataDestinationDeliveryWebhook): - error_messages.append( - f"Error! Input type `{type(v)}` is not `DataDestinationDeliveryWebhook`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("type") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `type` in the input." - ) - - # check if data type is `DataDestinationDeliveryAskUiWorkflow` - if _data_type == "ASKUI_WORKFLOW": - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryWebhook` - if _data_type == "WEBHOOK": - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryAskUiWorkflow` - if _data_type == "DataDestinationDeliveryAskUiWorkflow": - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - return instance - - # check if data type is `DataDestinationDeliveryWebhook` - if _data_type == "DataDestinationDeliveryWebhook": - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - return instance - - # deserialize data into DataDestinationDeliveryAskUiWorkflow - try: - instance.actual_instance = DataDestinationDeliveryAskUiWorkflow.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into DataDestinationDeliveryWebhook - try: - instance.actual_instance = DataDestinationDeliveryWebhook.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into AgentExecutionStateDeliveredToDestinationInputDeliveriesInner with oneOf schemas: DataDestinationDeliveryAskUiWorkflow, DataDestinationDeliveryWebhook. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - DataDestinationDeliveryAskUiWorkflow, - DataDestinationDeliveryWebhook, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py deleted file mode 100644 index 1f4d1be1..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_delivered_to_destination_output.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input_deliveries_inner import ( - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner, -) - - -class AgentExecutionStateDeliveredToDestinationOutput(BaseModel): - """ - AgentExecutionStateDeliveredToDestinationOutput - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="DELIVERED_TO_DESTINATION", - description="The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.", - ) - data_extracted: Dict[str, Any] = Field(alias="dataExtracted") - data_confirmed: Dict[str, Any] = Field(alias="dataConfirmed") - deliveries: Optional[ - List[AgentExecutionStateDeliveredToDestinationInputDeliveriesInner] - ] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "status", - "dataExtracted", - "dataConfirmed", - "deliveries", - ] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["DELIVERED_TO_DESTINATION"]): - raise ValueError("must be one of enum values ('DELIVERED_TO_DESTINATION')") - 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 AgentExecutionStateDeliveredToDestinationOutput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 deliveries (list) - _items = [] - if self.deliveries: - for _item in self.deliveries: - if _item: - _items.append(_item.to_dict()) - _dict["deliveries"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStateDeliveredToDestinationOutput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "DELIVERED_TO_DESTINATION", - "dataExtracted": obj.get("dataExtracted"), - "dataConfirmed": obj.get("dataConfirmed"), - "deliveries": [ - AgentExecutionStateDeliveredToDestinationInputDeliveriesInner.from_dict( - _item - ) - for _item in obj["deliveries"] - ] - if obj.get("deliveries") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py deleted file mode 100644 index 4a748c73..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_data_extraction.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionStatePendingDataExtraction(BaseModel): - """ - AgentExecutionStatePendingDataExtraction - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="PENDING_DATA_EXTRACTION", - description="The agent has all inputs at hand and is about to or already extracting data from inputs. An agent may stay in this state in failure cases, e.g., if data extraction fails.", - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["PENDING_DATA_EXTRACTION"]): - raise ValueError("must be one of enum values ('PENDING_DATA_EXTRACTION')") - 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 AgentExecutionStatePendingDataExtraction 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStatePendingDataExtraction from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "PENDING_DATA_EXTRACTION" - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py deleted file mode 100644 index 74e8c1f5..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_inputs.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionStatePendingInputs(BaseModel): - """ - AgentExecutionStatePendingInputs - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="PENDING_INPUTS", - description="The agent is waiting for inputs, e.g., files to be uploaded. An agent may stay in this state in failure cases, e.g., if file upload fails.", - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["PENDING_INPUTS"]): - raise ValueError("must be one of enum values ('PENDING_INPUTS')") - 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 AgentExecutionStatePendingInputs 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStatePendingInputs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "PENDING_INPUTS" - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py deleted file mode 100644 index 043d4474..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_state_pending_review.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class AgentExecutionStatePendingReview(BaseModel): - """ - AgentExecutionStatePendingReview - """ # noqa: E501 - - status: Optional[StrictStr] = Field( - default="PENDING_REVIEW", - description="The agent is waiting for the user to review the extracted data. An agent may stay if the user never confirms the data or cancels the execution.", - ) - data_extracted: Dict[str, Any] = Field(alias="dataExtracted") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "dataExtracted"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["PENDING_REVIEW"]): - raise ValueError("must be one of enum values ('PENDING_REVIEW')") - 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 AgentExecutionStatePendingReview 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionStatePendingReview from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "status": obj.get("status") - if obj.get("status") is not None - else "PENDING_REVIEW", - "dataExtracted": obj.get("dataExtracted"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py deleted file mode 100644 index dc845579..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_execution_update_command.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.state1 import State1 - - -class AgentExecutionUpdateCommand(BaseModel): - """ - AgentExecutionUpdateCommand - """ # noqa: E501 - - state: State1 - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["state"] - - 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 AgentExecutionUpdateCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of state - if self.state: - _dict["state"] = self.state.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionUpdateCommand from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "state": State1.from_dict(obj["state"]) - if obj.get("state") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py b/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py deleted file mode 100644 index bbab6fb2..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_executions_list_response.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictBool, StrictInt -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution import AgentExecution - - -class AgentExecutionsListResponse(BaseModel): - """ - AgentExecutionsListResponse - """ # noqa: E501 - - data: List[AgentExecution] - has_more: Optional[StrictBool] = Field( - default=False, - description="Whether there are more agent executions that match the query that were not included in this response.", - alias="hasMore", - ) - total_count: Optional[StrictInt] = Field(default=None, alias="totalCount") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"] - - 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 AgentExecutionsListResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if total_count (nullable) is None - # and model_fields_set contains the field - if self.total_count is None and "total_count" in self.model_fields_set: - _dict["totalCount"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentExecutionsListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [AgentExecution.from_dict(_item) for _item in obj["data"]] - if obj.get("data") is not None - else None, - "hasMore": obj.get("hasMore") - if obj.get("hasMore") is not None - else False, - "totalCount": obj.get("totalCount"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py b/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py deleted file mode 100644 index 26ea8523..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agent_update_command.py +++ /dev/null @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.email_agent_trigger_update import ( - EmailAgentTriggerUpdate, -) - - -class AgentUpdateCommand(BaseModel): - """ - AgentUpdateCommand - """ # noqa: E501 - - name: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, - description="The name of the agent. The name must only contain the following characters: a-z, A-Z, 0-9, -, _, and space. The name must not be empty. The name must start and end with a letter or a number. The name must not be longer than 64 characters.", - ) - description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = "" - status: Optional[StrictStr] = None - email_trigger: Optional[EmailAgentTriggerUpdate] = Field( - default=None, alias="emailTrigger" - ) - auto_confirm: Optional[StrictBool] = Field(default=None, alias="autoConfirm") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "name", - "description", - "status", - "emailTrigger", - "autoConfirm", - ] - - @field_validator("name") - def name_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9]([a-zA-Z0-9-_.+ ]{0,62}[a-zA-Z0-9])?$/" - ) - return value - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["ACTIVE", "ARCHIVED"]): - raise ValueError("must be one of enum values ('ACTIVE', 'ARCHIVED')") - 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 AgentUpdateCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of email_trigger - if self.email_trigger: - _dict["emailTrigger"] = self.email_trigger.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict["name"] = None - - # set to None if description (nullable) is None - # and model_fields_set contains the field - if self.description is None and "description" in self.model_fields_set: - _dict["description"] = None - - # set to None if status (nullable) is None - # and model_fields_set contains the field - if self.status is None and "status" in self.model_fields_set: - _dict["status"] = None - - # set to None if email_trigger (nullable) is None - # and model_fields_set contains the field - if self.email_trigger is None and "email_trigger" in self.model_fields_set: - _dict["emailTrigger"] = None - - # set to None if auto_confirm (nullable) is None - # and model_fields_set contains the field - if self.auto_confirm is None and "auto_confirm" in self.model_fields_set: - _dict["autoConfirm"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentUpdateCommand 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"), - "description": obj.get("description") - if obj.get("description") is not None - else "", - "status": obj.get("status"), - "emailTrigger": EmailAgentTriggerUpdate.from_dict(obj["emailTrigger"]) - if obj.get("emailTrigger") is not None - else None, - "autoConfirm": obj.get("autoConfirm"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py b/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py deleted file mode 100644 index d280022c..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/agents_list_response.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictBool, StrictInt -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent import Agent - - -class AgentsListResponse(BaseModel): - """ - AgentsListResponse - """ # noqa: E501 - - data: List[Agent] - has_more: Optional[StrictBool] = Field( - default=False, - description="Whether there are more agents that match the query that were not included in this response.", - alias="hasMore", - ) - total_count: Optional[StrictInt] = Field(default=None, alias="totalCount") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"] - - 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 AgentsListResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if total_count (nullable) is None - # and model_fields_set contains the field - if self.total_count is None and "total_count" in self.model_fields_set: - _dict["totalCount"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AgentsListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [Agent.from_dict(_item) for _item in obj["data"]] - if obj.get("data") is not None - else None, - "hasMore": obj.get("hasMore") - if obj.get("hasMore") is not None - else False, - "totalCount": obj.get("totalCount"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py b/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py deleted file mode 100644 index 9ac36c0c..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/ask_ui_runner_host.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 AskUiRunnerHost(str, Enum): - """ - AskUiRunnerHost - """ - - """ - allowed enum values - """ - SELF = "SELF" - ASKUI = "ASKUI" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AskUiRunnerHost from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py deleted file mode 100644 index 58ff690b..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/complete_runner_job_request_dto.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr, field_validator -from typing_extensions import Self - - -class CompleteRunnerJobRequestDto(BaseModel): - """ - CompleteRunnerJobRequestDto - """ # noqa: E501 - - status: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status"] - - @field_validator("status") - def status_validate_enum(cls, value): - """Validates the enum""" - if value not in set(["CANCELED", "FAILED", "PASSED"]): - raise ValueError( - "must be one of enum values ('CANCELED', 'FAILED', 'PASSED')" - ) - 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 CompleteRunnerJobRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CompleteRunnerJobRequestDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"status": obj.get("status")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py deleted file mode 100644 index a267ef0d..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_request_dto.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Annotated, Self - - -class CreateCustomerPortalSessionRequestDto(BaseModel): - """ - CreateCustomerPortalSessionRequestDto - """ # noqa: E501 - - return_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = ( - Field(alias="returnUrl") - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["returnUrl"] - - 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 CreateCustomerPortalSessionRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateCustomerPortalSessionRequestDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"returnUrl": obj.get("returnUrl")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py deleted file mode 100644 index abbcaa87..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_customer_portal_session_response_dto.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Annotated, Self - - -class CreateCustomerPortalSessionResponseDto(BaseModel): - """ - CreateCustomerPortalSessionResponseDto - """ # noqa: E501 - - session_url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] = ( - Field(alias="sessionUrl") - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["sessionUrl"] - - 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 CreateCustomerPortalSessionResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateCustomerPortalSessionResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"sessionUrl": obj.get("sessionUrl")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py deleted file mode 100644 index df6f085c..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_schedule_request_dto.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost - - -class CreateScheduleRequestDto(BaseModel): - """ - CreateScheduleRequestDto - """ # noqa: E501 - - name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=63)]] = ( - "Unnamed" - ) - host: Optional[RunnerHost] = None - runner_ids: Optional[List[StrictStr]] = None - tags: Optional[List[StrictStr]] = None - started_at: Optional[datetime] = Field( - default=None, - description="Timestamp after which the schedule starts. If not specified, the schedule starts immediately.", - ) - ended_at: Optional[datetime] = None - ended_after: Optional[StrictInt] = None - schedule: Optional[StrictStr] = None - workflows: Optional[List[StrictStr]] = None - data: Optional[Dict[str, Any]] = Field( - default=None, - description="Arbitrary data to be stored with the schedule which is made available to the runner when executing AskUI workflows.", - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "name", - "host", - "runner_ids", - "tags", - "started_at", - "ended_at", - "ended_after", - "schedule", - "workflows", - "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 CreateScheduleRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if ended_at (nullable) is None - # and model_fields_set contains the field - if self.ended_at is None and "ended_at" in self.model_fields_set: - _dict["ended_at"] = None - - # set to None if ended_after (nullable) is None - # and model_fields_set contains the field - if self.ended_after is None and "ended_after" in self.model_fields_set: - _dict["ended_after"] = None - - # set to None if schedule (nullable) is None - # and model_fields_set contains the field - if self.schedule is None and "schedule" in self.model_fields_set: - _dict["schedule"] = None - - # set to None if workflows (nullable) is None - # and model_fields_set contains the field - if self.workflows is None and "workflows" in self.model_fields_set: - _dict["workflows"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScheduleRequestDto 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") if obj.get("name") is not None else "Unnamed", - "host": obj.get("host"), - "runner_ids": obj.get("runner_ids"), - "tags": obj.get("tags"), - "started_at": obj.get("started_at"), - "ended_at": obj.get("ended_at"), - "ended_after": obj.get("ended_after"), - "schedule": obj.get("schedule"), - "workflows": obj.get("workflows"), - "data": obj.get("data"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py deleted file mode 100644 index 5768ab01..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_schedule_response_dto.py +++ /dev/null @@ -1,157 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate -from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus - - -class CreateScheduleResponseDto(BaseModel): - """ - CreateScheduleResponseDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = None - name: StrictStr - status: Optional[ScheduleStatus] = None - started_at: datetime - ended_at: Optional[datetime] = None - schedule: Optional[StrictStr] = None - ended_after: Optional[StrictInt] = None - run_template: RunTemplate - runs_count: Optional[StrictInt] = 0 - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "name", - "status", - "started_at", - "ended_at", - "schedule", - "ended_after", - "run_template", - "runs_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 CreateScheduleResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of run_template - if self.run_template: - _dict["run_template"] = self.run_template.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if ended_at (nullable) is None - # and model_fields_set contains the field - if self.ended_at is None and "ended_at" in self.model_fields_set: - _dict["ended_at"] = None - - # set to None if schedule (nullable) is None - # and model_fields_set contains the field - if self.schedule is None and "schedule" in self.model_fields_set: - _dict["schedule"] = None - - # set to None if ended_after (nullable) is None - # and model_fields_set contains the field - if self.ended_after is None and "ended_after" in self.model_fields_set: - _dict["ended_after"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScheduleResponseDto 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"), - "created_at": obj.get("created_at"), - "name": obj.get("name"), - "status": obj.get("status"), - "started_at": obj.get("started_at"), - "ended_at": obj.get("ended_at"), - "schedule": obj.get("schedule"), - "ended_after": obj.get("ended_after"), - "run_template": RunTemplate.from_dict(obj["run_template"]) - if obj.get("run_template") is not None - else None, - "runs_count": obj.get("runs_count") - if obj.get("runs_count") is not None - else 0, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py deleted file mode 100644 index 77aa5c91..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_command.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - - -class CreateSubjectAccessTokenCommand(BaseModel): - """ - CreateSubjectAccessTokenCommand - """ # noqa: E501 - - name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] - expires_at: Optional[datetime] = Field(default=None, alias="expiresAt") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "expiresAt"] - - 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 CreateSubjectAccessTokenCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSubjectAccessTokenCommand 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"), "expiresAt": obj.get("expiresAt")} - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py deleted file mode 100644 index de0a68c3..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_input.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import ( - SubjectAccessTokenResponseDtoInput, -) - - -class CreateSubjectAccessTokenResponseDtoInput(BaseModel): - """ - CreateSubjectAccessTokenResponseDtoInput - """ # noqa: E501 - - token: SubjectAccessTokenResponseDtoInput - token_string: StrictStr = Field(alias="tokenString") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["token", "tokenString"] - - 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 CreateSubjectAccessTokenResponseDtoInput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of token - if self.token: - _dict["token"] = self.token.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSubjectAccessTokenResponseDtoInput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "token": SubjectAccessTokenResponseDtoInput.from_dict(obj["token"]) - if obj.get("token") is not None - else None, - "tokenString": obj.get("tokenString"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py deleted file mode 100644 index 2189cb95..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_subject_access_token_response_dto_output.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import ( - SubjectAccessTokenResponseDtoOutput, -) - - -class CreateSubjectAccessTokenResponseDtoOutput(BaseModel): - """ - CreateSubjectAccessTokenResponseDtoOutput - """ # noqa: E501 - - token: SubjectAccessTokenResponseDtoOutput - token_string: StrictStr = Field(alias="tokenString") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["token", "tokenString"] - - 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 CreateSubjectAccessTokenResponseDtoOutput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of token - if self.token: - _dict["token"] = self.token.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateSubjectAccessTokenResponseDtoOutput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "token": SubjectAccessTokenResponseDtoOutput.from_dict(obj["token"]) - if obj.get("token") is not None - else None, - "tokenString": obj.get("tokenString"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py deleted file mode 100644 index 30b32d74..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_request_dto.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field -from typing_extensions import Annotated, Self - - -class CreateWorkspaceAccessTokenRequestDto(BaseModel): - """ - CreateWorkspaceAccessTokenRequestDto - """ # noqa: E501 - - name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] - expires_at: Optional[datetime] = Field(default=None, alias="expiresAt") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "expiresAt"] - - 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 CreateWorkspaceAccessTokenRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceAccessTokenRequestDto 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"), "expiresAt": obj.get("expiresAt")} - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py deleted file mode 100644 index 691c185d..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_access_token_response_dto.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - -from askui.tools.askui.askui_workspaces.models.access_token_response_dto import ( - AccessTokenResponseDto, -) - - -class CreateWorkspaceAccessTokenResponseDto(BaseModel): - """ - CreateWorkspaceAccessTokenResponseDto - """ # noqa: E501 - - private_token: AccessTokenResponseDto = Field(alias="privateToken") - token_string: StrictStr = Field(alias="tokenString") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["privateToken", "tokenString"] - - 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 CreateWorkspaceAccessTokenResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of private_token - if self.private_token: - _dict["privateToken"] = self.private_token.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceAccessTokenResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "privateToken": AccessTokenResponseDto.from_dict(obj["privateToken"]) - if obj.get("privateToken") is not None - else None, - "tokenString": obj.get("tokenString"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py deleted file mode 100644 index 5689a788..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_request_dto.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) - - -class CreateWorkspaceMembershipRequestDto(BaseModel): - """ - CreateWorkspaceMembershipRequestDto - """ # noqa: E501 - - user_id: StrictStr = Field(alias="userId") - workspace_id: StrictStr = Field(alias="workspaceId") - privileges: Optional[Annotated[List[WorkspacePrivilege], Field(max_length=1)]] = ( - None - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["userId", "workspaceId", "privileges"] - - 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 CreateWorkspaceMembershipRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceMembershipRequestDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "userId": obj.get("userId"), - "workspaceId": obj.get("workspaceId"), - "privileges": obj.get("privileges"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py deleted file mode 100644 index 42ad2195..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_membership_response_dto.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspace_access_token import ( - WorkspaceAccessToken, -) -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) - - -class CreateWorkspaceMembershipResponseDto(BaseModel): - """ - CreateWorkspaceMembershipResponseDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - user_id: StrictStr = Field(alias="userId") - workspace_id: StrictStr = Field(alias="workspaceId") - privileges: List[WorkspacePrivilege] - access_tokens: Optional[List[WorkspaceAccessToken]] = Field( - default=None, alias="accessTokens" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "userId", - "workspaceId", - "privileges", - "accessTokens", - ] - - 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 CreateWorkspaceMembershipResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 access_tokens (list) - _items = [] - if self.access_tokens: - for _item in self.access_tokens: - if _item: - _items.append(_item.to_dict()) - _dict["accessTokens"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceMembershipResponseDto 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"), - "userId": obj.get("userId"), - "workspaceId": obj.get("workspaceId"), - "privileges": obj.get("privileges"), - "accessTokens": [ - WorkspaceAccessToken.from_dict(_item) - for _item in obj["accessTokens"] - ] - if obj.get("accessTokens") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py deleted file mode 100644 index dc9e1451..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_request_dto.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 - - -class CreateWorkspaceRequestDto(BaseModel): - """ - CreateWorkspaceRequestDto - """ # noqa: E501 - - name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] - first_member_id: Optional[StrictStr] = Field(default=None, alias="firstMemberId") - billing_account_email: StrictStr = Field(alias="billingAccountEmail") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "firstMemberId", "billingAccountEmail"] - - 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 CreateWorkspaceRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if first_member_id (nullable) is None - # and model_fields_set contains the field - if self.first_member_id is None and "first_member_id" in self.model_fields_set: - _dict["firstMemberId"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceRequestDto 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"), - "firstMemberId": obj.get("firstMemberId"), - "billingAccountEmail": obj.get("billingAccountEmail"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py deleted file mode 100644 index ea1ff87e..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/create_workspace_response_dto.py +++ /dev/null @@ -1,137 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto, -) - - -class CreateWorkspaceResponseDto(BaseModel): - """ - CreateWorkspaceResponseDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - name: StrictStr - memberships: List[ - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto - ] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "name", - "memberships", - ] - - 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 CreateWorkspaceResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 memberships (list) - _items = [] - if self.memberships: - for _item in self.memberships: - if _item: - _items.append(_item.to_dict()) - _dict["memberships"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateWorkspaceResponseDto 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"), - "name": obj.get("name"), - "memberships": [ - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto.from_dict( - _item - ) - for _item in obj["memberships"] - ] - if obj.get("memberships") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py deleted file mode 100644 index 9a7c5962..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost - - -class DataDestinationAskUiWorkflow(BaseModel): - """ - DataDestinationAskUiWorkflow - """ # noqa: E501 - - type: Optional[StrictStr] = "ASKUI_WORKFLOW" - host: AskUiRunnerHost - runner_tags: List[StrictStr] = Field(alias="runnerTags") - workflows: Annotated[List[StrictStr], Field(min_length=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "host", "runnerTags", "workflows"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["ASKUI_WORKFLOW"]): - raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')") - 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 DataDestinationAskUiWorkflow 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationAskUiWorkflow from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") - if obj.get("type") is not None - else "ASKUI_WORKFLOW", - "host": obj.get("host"), - "runnerTags": obj.get("runnerTags"), - "workflows": obj.get("workflows"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py deleted file mode 100644 index ef594bbc..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_ask_ui_workflow_create.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Annotated, Self - -from askui.tools.askui.askui_workspaces.models.ask_ui_runner_host import AskUiRunnerHost - - -class DataDestinationAskUiWorkflowCreate(BaseModel): - """ - DataDestinationAskUiWorkflowCreate - """ # noqa: E501 - - type: Optional[StrictStr] = "ASKUI_WORKFLOW" - host: Optional[AskUiRunnerHost] = None - runner_tags: Optional[List[StrictStr]] = Field(default=None, alias="runnerTags") - workflows: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "host", "runnerTags", "workflows"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["ASKUI_WORKFLOW"]): - raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')") - 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 DataDestinationAskUiWorkflowCreate 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationAskUiWorkflowCreate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") - if obj.get("type") is not None - else "ASKUI_WORKFLOW", - "host": obj.get("host"), - "runnerTags": obj.get("runnerTags"), - "workflows": obj.get("workflows"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py deleted file mode 100644 index 97559dc1..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_ask_ui_workflow.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Self - - -class DataDestinationDeliveryAskUiWorkflow(BaseModel): - """ - DataDestinationDeliveryAskUiWorkflow - """ # noqa: E501 - - type: Optional[StrictStr] = "ASKUI_WORKFLOW" - schedule_id: StrictStr = Field(alias="scheduleId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "scheduleId"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["ASKUI_WORKFLOW"]): - raise ValueError("must be one of enum values ('ASKUI_WORKFLOW')") - 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 DataDestinationDeliveryAskUiWorkflow 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationDeliveryAskUiWorkflow from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") - if obj.get("type") is not None - else "ASKUI_WORKFLOW", - "scheduleId": obj.get("scheduleId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py deleted file mode 100644 index 42777fb5..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_delivery_webhook.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr, field_validator -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.webhook_response import WebhookResponse - - -class DataDestinationDeliveryWebhook(BaseModel): - """ - DataDestinationDeliveryWebhook - """ # noqa: E501 - - type: Optional[StrictStr] = "WEBHOOK" - response: WebhookResponse - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "response"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["WEBHOOK"]): - raise ValueError("must be one of enum values ('WEBHOOK')") - 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 DataDestinationDeliveryWebhook 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of response - if self.response: - _dict["response"] = self.response.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationDeliveryWebhook from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK", - "response": WebhookResponse.from_dict(obj["response"]) - if obj.get("response") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py deleted file mode 100644 index ac36b2af..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Annotated, Self - - -class DataDestinationWebhook(BaseModel): - """ - DataDestinationWebhook - """ # noqa: E501 - - type: Optional[StrictStr] = "WEBHOOK" - url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] - headers: Dict[str, StrictStr] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "url", "headers"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["WEBHOOK"]): - raise ValueError("must be one of enum values ('WEBHOOK')") - 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 DataDestinationWebhook 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationWebhook from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK", - "url": obj.get("url"), - "headers": obj.get("headers"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py b/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py deleted file mode 100644 index e8f7565b..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/data_destination_webhook_create.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Annotated, Self - - -class DataDestinationWebhookCreate(BaseModel): - """ - DataDestinationWebhookCreate - """ # noqa: E501 - - type: Optional[StrictStr] = "WEBHOOK" - url: Annotated[str, Field(min_length=1, strict=True, max_length=2083)] - headers: Optional[Dict[str, StrictStr]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "url", "headers"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["WEBHOOK"]): - raise ValueError("must be one of enum values ('WEBHOOK')") - 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 DataDestinationWebhookCreate 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataDestinationWebhookCreate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") if obj.get("type") is not None else "WEBHOOK", - "url": obj.get("url"), - "headers": obj.get("headers"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py deleted file mode 100644 index d9a4efdb..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - - -class EmailAgentTrigger(BaseModel): - """ - EmailAgentTrigger - """ # noqa: E501 - - active: Optional[StrictBool] = Field( - default=True, description="If false, no emails can be send to trigger agent." - ) - allowed_senders: Optional[List[StrictStr]] = Field( - default=None, - description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.", - alias="allowedSenders", - ) - email: Annotated[str, Field(strict=True)] = Field( - description="The email address of the agent to send emails to to trigger the agent. The email address must be unique for each agent. The domain of the email address is fixed. The local part of the email address must be between 1 and 64 characters long and can only contain the following characters: a-z, A-Z, 0-9, -, _, . and +." - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["active", "allowedSenders", "email"] - - @field_validator("email") - def email_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[a-zA-Z0-9-_.+]+@.*$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9-_.+]+@.*$/" - ) - 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 EmailAgentTrigger 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EmailAgentTrigger from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "active": obj.get("active") if obj.get("active") is not None else True, - "allowedSenders": obj.get("allowedSenders"), - "email": obj.get("email"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py deleted file mode 100644 index 2e71f031..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_create.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - - -class EmailAgentTriggerCreate(BaseModel): - """ - EmailAgentTriggerCreate - """ # noqa: E501 - - active: Optional[StrictBool] = Field( - default=True, description="If false, no emails can be send to trigger agent." - ) - allowed_senders: Optional[List[StrictStr]] = Field( - default=None, - description="The email addresses that are allowed to send emails to trigger the agent. If empty, no emails can be send to trigger agent.", - alias="allowedSenders", - ) - local_part: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, alias="localPart" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["active", "allowedSenders", "localPart"] - - @field_validator("local_part") - def local_part_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[a-zA-Z0-9-_.+]+$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/" - ) - 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 EmailAgentTriggerCreate 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if local_part (nullable) is None - # and model_fields_set contains the field - if self.local_part is None and "local_part" in self.model_fields_set: - _dict["localPart"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EmailAgentTriggerCreate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "active": obj.get("active") if obj.get("active") is not None else True, - "allowedSenders": obj.get("allowedSenders"), - "localPart": obj.get("localPart"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py b/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py deleted file mode 100644 index 2136aec9..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/email_agent_trigger_update.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, - StrictBool, - StrictStr, - field_validator, -) -from typing_extensions import Annotated, Self - - -class EmailAgentTriggerUpdate(BaseModel): - """ - EmailAgentTriggerUpdate - """ # noqa: E501 - - active: Optional[StrictBool] = None - allowed_senders: Optional[List[StrictStr]] = Field( - default=None, alias="allowedSenders" - ) - local_part: Optional[Annotated[str, Field(strict=True)]] = Field( - default=None, alias="localPart" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["active", "allowedSenders", "localPart"] - - @field_validator("local_part") - def local_part_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[a-zA-Z0-9-_.+]+$", value): - raise ValueError( - r"must validate the regular expression /^[a-zA-Z0-9-_.+]+$/" - ) - 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 EmailAgentTriggerUpdate 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if active (nullable) is None - # and model_fields_set contains the field - if self.active is None and "active" in self.model_fields_set: - _dict["active"] = None - - # set to None if allowed_senders (nullable) is None - # and model_fields_set contains the field - if self.allowed_senders is None and "allowed_senders" in self.model_fields_set: - _dict["allowedSenders"] = None - - # set to None if local_part (nullable) is None - # and model_fields_set contains the field - if self.local_part is None and "local_part" in self.model_fields_set: - _dict["localPart"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EmailAgentTriggerUpdate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "active": obj.get("active"), - "allowedSenders": obj.get("allowedSenders"), - "localPart": obj.get("localPart"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py b/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py deleted file mode 100644 index ad80c61f..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/extract_data_command.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - -from askui.tools.askui.askui_workspaces.models.json_schema import JsonSchema - - -class ExtractDataCommand(BaseModel): - """ - ExtractDataCommand - """ # noqa: E501 - - file_paths: List[StrictStr] = Field(alias="filePaths") - data_schema: JsonSchema = Field(alias="dataSchema") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filePaths", "dataSchema"] - - 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 ExtractDataCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data_schema - if self.data_schema: - _dict["dataSchema"] = self.data_schema.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ExtractDataCommand from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "filePaths": obj.get("filePaths"), - "dataSchema": JsonSchema.from_dict(obj["dataSchema"]) - if obj.get("dataSchema") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py b/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py deleted file mode 100644 index 23a0df77..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/extract_data_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - - -class ExtractDataResponse(BaseModel): - """ - ExtractDataResponse - """ # noqa: E501 - - data: Dict[str, Any] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 ExtractDataResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ExtractDataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"data": obj.get("data")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/file_dto.py b/src/askui/tools/askui/askui_workspaces/models/file_dto.py deleted file mode 100644 index 79e9eb5b..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/file_dto.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing_extensions import Self - - -class FileDto(BaseModel): - """ - FileDto - """ # noqa: E501 - - type: Optional[StrictStr] = "file" - name: StrictStr - path: StrictStr = Field(description="Path to the file starting") - url: Optional[StrictStr] = None - size: StrictInt = Field(description="Size of the file in bytes") - last_modified: datetime = Field(alias="lastModified") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "type", - "name", - "path", - "url", - "size", - "lastModified", - ] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["file"]): - raise ValueError("must be one of enum values ('file')") - 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 FileDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if url (nullable) is None - # and model_fields_set contains the field - if self.url is None and "url" in self.model_fields_set: - _dict["url"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FileDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") if obj.get("type") is not None else "file", - "name": obj.get("name"), - "path": obj.get("path"), - "url": obj.get("url"), - "size": obj.get("size"), - "lastModified": obj.get("lastModified"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py deleted file mode 100644 index 1de92917..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - -from askui.tools.askui.askui_workspaces.models.files_list_response_dto_data_inner import ( - FilesListResponseDtoDataInner, -) - - -class FilesListResponseDto(BaseModel): - """ - FilesListResponseDto - """ # noqa: E501 - - data: List[FilesListResponseDtoDataInner] - next_continuation_token: Optional[StrictStr] = Field( - default=None, alias="nextContinuationToken" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data", "nextContinuationToken"] - - 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 FilesListResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if next_continuation_token (nullable) is None - # and model_fields_set contains the field - if ( - self.next_continuation_token is None - and "next_continuation_token" in self.model_fields_set - ): - _dict["nextContinuationToken"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FilesListResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [ - FilesListResponseDtoDataInner.from_dict(_item) - for _item in obj["data"] - ] - if obj.get("data") is not None - else None, - "nextContinuationToken": obj.get("nextContinuationToken"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py b/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py deleted file mode 100644 index 8f56ef89..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/files_list_response_dto_data_inner.py +++ /dev/null @@ -1,186 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.file_dto import FileDto -from askui.tools.askui.askui_workspaces.models.folder_dto import FolderDto - -FILESLISTRESPONSEDTODATAINNER_ONE_OF_SCHEMAS = ["FileDto", "FolderDto"] - - -class FilesListResponseDtoDataInner(BaseModel): - """ - FilesListResponseDtoDataInner - """ - - # data type: FileDto - oneof_schema_1_validator: Optional[FileDto] = None - # data type: FolderDto - oneof_schema_2_validator: Optional[FolderDto] = None - actual_instance: Optional[Union[FileDto, FolderDto]] = None - one_of_schemas: Set[str] = {"FileDto", "FolderDto"} - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = FilesListResponseDtoDataInner.model_construct() - error_messages = [] - match = 0 - # validate data type: FileDto - if not isinstance(v, FileDto): - error_messages.append(f"Error! Input type `{type(v)}` is not `FileDto`") - else: - match += 1 - # validate data type: FolderDto - if not isinstance(v, FolderDto): - error_messages.append(f"Error! Input type `{type(v)}` is not `FolderDto`") - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("type") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `type` in the input." - ) - - # check if data type is `FileDto` - if _data_type == "file": - instance.actual_instance = FileDto.from_json(json_str) - return instance - - # check if data type is `FolderDto` - if _data_type == "folder": - instance.actual_instance = FolderDto.from_json(json_str) - return instance - - # check if data type is `FileDto` - if _data_type == "FileDto": - instance.actual_instance = FileDto.from_json(json_str) - return instance - - # check if data type is `FolderDto` - if _data_type == "FolderDto": - instance.actual_instance = FolderDto.from_json(json_str) - return instance - - # deserialize data into FileDto - try: - instance.actual_instance = FileDto.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into FolderDto - try: - instance.actual_instance = FolderDto.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into FilesListResponseDtoDataInner with oneOf schemas: FileDto, FolderDto. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], FileDto, FolderDto]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/folder_dto.py b/src/askui/tools/askui/askui_workspaces/models/folder_dto.py deleted file mode 100644 index 286b9938..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/folder_dto.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr, field_validator -from typing_extensions import Self - - -class FolderDto(BaseModel): - """ - FolderDto - """ # noqa: E501 - - type: Optional[StrictStr] = "folder" - name: StrictStr - path: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "name", "path"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["folder"]): - raise ValueError("must be one of enum values ('folder')") - 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 FolderDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FolderDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "type": obj.get("type") if obj.get("type") is not None else "folder", - "name": obj.get("name"), - "path": obj.get("path"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py b/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py deleted file mode 100644 index cf5948f0..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/generate_signed_cookies_command.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - - -class GenerateSignedCookiesCommand(BaseModel): - """ - GenerateSignedCookiesCommand - """ # noqa: E501 - - workspace_id: Optional[StrictStr] = Field(alias="workspaceId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["workspaceId"] - - 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 GenerateSignedCookiesCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if workspace_id (nullable) is None - # and model_fields_set contains the field - if self.workspace_id is None and "workspace_id" in self.model_fields_set: - _dict["workspaceId"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GenerateSignedCookiesCommand from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"workspaceId": obj.get("workspaceId")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py deleted file mode 100644 index f0961222..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/get_subscription_response_dto.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing_extensions import Self - - -class GetSubscriptionResponseDto(BaseModel): - """ - GetSubscriptionResponseDto - """ # noqa: E501 - - id: StrictStr - max_usage_events_per_period: StrictInt = Field(alias="maxUsageEventsPerPeriod") - current_period_start: datetime = Field(alias="currentPeriodStart") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "maxUsageEventsPerPeriod", - "currentPeriodStart", - ] - - 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 GetSubscriptionResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetSubscriptionResponseDto 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"), - "maxUsageEventsPerPeriod": obj.get("maxUsageEventsPerPeriod"), - "currentPeriodStart": obj.get("currentPeriodStart"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py b/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py deleted file mode 100644 index ec3f038f..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/http_validation_error.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.validation_error import ValidationError - - -class HTTPValidationError(BaseModel): - """ - HTTPValidationError - """ # noqa: E501 - - detail: Optional[List[ValidationError]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["detail"] - - 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 HTTPValidationError 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 detail (list) - _items = [] - if self.detail: - for _item in self.detail: - if _item: - _items.append(_item.to_dict()) - _dict["detail"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HTTPValidationError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] - if obj.get("detail") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/json_schema.py b/src/askui/tools/askui/askui_workspaces/models/json_schema.py deleted file mode 100644 index a6980763..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/json_schema.py +++ /dev/null @@ -1,140 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, field_validator -from typing_extensions import Annotated, Self - - -class JsonSchema(BaseModel): - """ - JsonSchema - """ # noqa: E501 - - title: Optional[Annotated[str, Field(strict=True)]] = "DataToExtract" - description: Optional[StrictStr] = "" - type: Optional[StrictStr] = "object" - properties: Dict[str, Dict[str, Any]] - required: Optional[List[StrictStr]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "title", - "description", - "type", - "properties", - "required", - ] - - @field_validator("title") - def title_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[a-zA-Z0-9_-]+$", value): - raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_-]+$/") - return value - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(["object"]): - raise ValueError("must be one of enum values ('object')") - 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 JsonSchema 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of JsonSchema from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "title": obj.get("title") - if obj.get("title") is not None - else "DataToExtract", - "description": obj.get("description") - if obj.get("description") is not None - else "", - "type": obj.get("type") if obj.get("type") is not None else "object", - "properties": obj.get("properties"), - "required": obj.get("required"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py deleted file mode 100644 index f08d1971..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto.py +++ /dev/null @@ -1,133 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data import ( - LeaseRunnerJobResponseDtoData, -) -from askui.tools.askui.askui_workspaces.models.runner_job_status import RunnerJobStatus - - -class LeaseRunnerJobResponseDto(BaseModel): - """ - LeaseRunnerJobResponseDto - """ # noqa: E501 - - id: StrictStr - ack: StrictStr - status: RunnerJobStatus - visible: datetime - runner_id: StrictStr - tries: StrictInt - data: LeaseRunnerJobResponseDtoData - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "ack", - "status", - "visible", - "runner_id", - "tries", - "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 LeaseRunnerJobResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data - if self.data: - _dict["data"] = self.data.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LeaseRunnerJobResponseDto 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"), - "ack": obj.get("ack"), - "status": obj.get("status"), - "visible": obj.get("visible"), - "runner_id": obj.get("runner_id"), - "tries": obj.get("tries"), - "data": LeaseRunnerJobResponseDtoData.from_dict(obj["data"]) - if obj.get("data") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py deleted file mode 100644 index 1f33d6cc..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.lease_runner_job_response_dto_data_credentials import ( - LeaseRunnerJobResponseDtoDataCredentials, -) - - -class LeaseRunnerJobResponseDtoData(BaseModel): - """ - LeaseRunnerJobResponseDtoData - """ # noqa: E501 - - credentials: LeaseRunnerJobResponseDtoDataCredentials - workflows: Optional[List[StrictStr]] - schedule_results_api_url: StrictStr - results_api_url: StrictStr - workflows_api_url: StrictStr - inference_api_url: StrictStr - data: Optional[Dict[str, Any]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "credentials", - "workflows", - "schedule_results_api_url", - "results_api_url", - "workflows_api_url", - "inference_api_url", - "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 LeaseRunnerJobResponseDtoData 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of credentials - if self.credentials: - _dict["credentials"] = self.credentials.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if workflows (nullable) is None - # and model_fields_set contains the field - if self.workflows is None and "workflows" in self.model_fields_set: - _dict["workflows"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LeaseRunnerJobResponseDtoData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "credentials": LeaseRunnerJobResponseDtoDataCredentials.from_dict( - obj["credentials"] - ) - if obj.get("credentials") is not None - else None, - "workflows": obj.get("workflows"), - "schedule_results_api_url": obj.get("schedule_results_api_url"), - "results_api_url": obj.get("results_api_url"), - "workflows_api_url": obj.get("workflows_api_url"), - "inference_api_url": obj.get("inference_api_url"), - "data": obj.get("data"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py b/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py deleted file mode 100644 index 6639c8b7..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lease_runner_job_response_dto_data_credentials.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - - -class LeaseRunnerJobResponseDtoDataCredentials(BaseModel): - """ - LeaseRunnerJobResponseDtoDataCredentials - """ # noqa: E501 - - workspace_id: StrictStr - access_token: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["workspace_id", "access_token"] - - 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 LeaseRunnerJobResponseDtoDataCredentials 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LeaseRunnerJobResponseDtoDataCredentials from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "workspace_id": obj.get("workspace_id"), - "access_token": obj.get("access_token"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py deleted file mode 100644 index 6aa6a5a7..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/list_access_token_response_dto.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class ListAccessTokenResponseDto(BaseModel): - """ - ListAccessTokenResponseDto - """ # noqa: E501 - - id: StrictStr - name: StrictStr - created_at: datetime = Field(alias="createdAt") - expires_at: Optional[datetime] = Field(default=None, alias="expiresAt") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "name", "createdAt", "expiresAt"] - - 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 ListAccessTokenResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListAccessTokenResponseDto 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"), - "name": obj.get("name"), - "createdAt": obj.get("createdAt"), - "expiresAt": obj.get("expiresAt"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py deleted file mode 100644 index d93f8746..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/list_runs_response_dto.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.run_response_dto import RunResponseDto - - -class ListRunsResponseDto(BaseModel): - """ - ListRunsResponseDto - """ # noqa: E501 - - data: List[RunResponseDto] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 ListRunsResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListRunsResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [RunResponseDto.from_dict(_item) for _item in obj["data"]] - if obj.get("data") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py deleted file mode 100644 index 1f6f6cf9..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_input.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_input import ( - SubjectAccessTokenResponseDtoInput, -) - - -class ListSubjectAccessTokensResponseDtoInput(BaseModel): - """ - ListSubjectAccessTokensResponseDtoInput - """ # noqa: E501 - - data: List[SubjectAccessTokenResponseDtoInput] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 ListSubjectAccessTokensResponseDtoInput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListSubjectAccessTokensResponseDtoInput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [ - SubjectAccessTokenResponseDtoInput.from_dict(_item) - for _item in obj["data"] - ] - if obj.get("data") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py deleted file mode 100644 index 6b36098f..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/list_subject_access_tokens_response_dto_output.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.subject_access_token_response_dto_output import ( - SubjectAccessTokenResponseDtoOutput, -) - - -class ListSubjectAccessTokensResponseDtoOutput(BaseModel): - """ - ListSubjectAccessTokensResponseDtoOutput - """ # noqa: E501 - - data: List[SubjectAccessTokenResponseDtoOutput] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 ListSubjectAccessTokensResponseDtoOutput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListSubjectAccessTokensResponseDtoOutput from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [ - SubjectAccessTokenResponseDtoOutput.from_dict(_item) - for _item in obj["data"] - ] - if obj.get("data") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py deleted file mode 100644 index e4168c75..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_command.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Annotated, Self - - -class LookupAccessTokenCommand(BaseModel): - """ - LookupAccessTokenCommand - """ # noqa: E501 - - access_token: Annotated[str, Field(min_length=1, strict=True)] = Field( - alias="accessToken" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["accessToken"] - - 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 LookupAccessTokenCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupAccessTokenCommand from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"accessToken": obj.get("accessToken")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py deleted file mode 100644 index 77f7d4c7..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lookup_access_token_response_dto.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - - -class LookupAccessTokenResponseDto(BaseModel): - """ - LookupAccessTokenResponseDto - """ # noqa: E501 - - access_token_id: StrictStr = Field(alias="accessTokenId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["accessTokenId"] - - 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 LookupAccessTokenResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupAccessTokenResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"accessTokenId": obj.get("accessTokenId")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py deleted file mode 100644 index 745ac73c..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_command.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Annotated, Self - - -class LookupWorkspaceAccessTokenCommand(BaseModel): - """ - LookupWorkspaceAccessTokenCommand - """ # noqa: E501 - - access_token: Annotated[str, Field(min_length=1, strict=True)] = Field( - alias="accessToken" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["accessToken"] - - 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 LookupWorkspaceAccessTokenCommand 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupWorkspaceAccessTokenCommand from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"accessToken": obj.get("accessToken")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py deleted file mode 100644 index cb430407..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/lookup_workspace_access_token_response_dto.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - - -class LookupWorkspaceAccessTokenResponseDto(BaseModel): - """ - LookupWorkspaceAccessTokenResponseDto - """ # noqa: E501 - - access_token_id: StrictStr = Field(alias="accessTokenId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["accessTokenId"] - - 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 LookupWorkspaceAccessTokenResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of LookupWorkspaceAccessTokenResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"accessTokenId": obj.get("accessTokenId")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py deleted file mode 100644 index 96347627..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/ping_runner_job_response_dto.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictBool -from typing_extensions import Self - - -class PingRunnerJobResponseDto(BaseModel): - """ - PingRunnerJobResponseDto - """ # noqa: E501 - - visible: datetime - cancel_job: StrictBool - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["visible", "cancel_job"] - - 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 PingRunnerJobResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PingRunnerJobResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"visible": obj.get("visible"), "cancel_job": obj.get("cancel_job")} - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py deleted file mode 100644 index 10862d49..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/run_response_dto.py +++ /dev/null @@ -1,164 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.run_status import RunStatus -from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate -from askui.tools.askui.askui_workspaces.models.schedule_reponse_dto import ( - ScheduleReponseDto, -) - - -class RunResponseDto(BaseModel): - """ - RunResponseDto - """ # noqa: E501 - - version: Optional[StrictStr] = None - id: Optional[StrictStr] = None - created_at: Optional[datetime] = None - name: StrictStr - status: Optional[RunStatus] = None - to_be_started_at: datetime - started_at: Optional[datetime] = None - schedule_id: StrictStr - template: RunTemplate - ended_at: Optional[datetime] = None - no: StrictInt - schedule: ScheduleReponseDto - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "version", - "id", - "created_at", - "name", - "status", - "to_be_started_at", - "started_at", - "schedule_id", - "template", - "ended_at", - "no", - "schedule", - ] - - 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 RunResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of template - if self.template: - _dict["template"] = self.template.to_dict() - # override the default output from pydantic by calling `to_dict()` of schedule - if self.schedule: - _dict["schedule"] = self.schedule.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if started_at (nullable) is None - # and model_fields_set contains the field - if self.started_at is None and "started_at" in self.model_fields_set: - _dict["started_at"] = None - - # set to None if ended_at (nullable) is None - # and model_fields_set contains the field - if self.ended_at is None and "ended_at" in self.model_fields_set: - _dict["ended_at"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RunResponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "version": obj.get("version"), - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "name": obj.get("name"), - "status": obj.get("status"), - "to_be_started_at": obj.get("to_be_started_at"), - "started_at": obj.get("started_at"), - "schedule_id": obj.get("schedule_id"), - "template": RunTemplate.from_dict(obj["template"]) - if obj.get("template") is not None - else None, - "ended_at": obj.get("ended_at"), - "no": obj.get("no"), - "schedule": ScheduleReponseDto.from_dict(obj["schedule"]) - if obj.get("schedule") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/run_status.py b/src/askui/tools/askui/askui_workspaces/models/run_status.py deleted file mode 100644 index 25bca560..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/run_status.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 RunStatus(str, Enum): - """ - RunStatus - """ - - """ - allowed enum values - """ - UPCOMING = "UPCOMING" - PENDING = "PENDING" - RUNNING = "RUNNING" - SKIPPED = "SKIPPED" - SKIPPED_NOTHING_TO_RUN = "SKIPPED_NOTHING_TO_RUN" - PASSED_NOT_YET_REPORTED = "PASSED_NOT_YET_REPORTED" - FAILED_NOT_YET_REPORTED = "FAILED_NOT_YET_REPORTED" - PASSED = "PASSED" - FAILED = "FAILED" - CANCELED = "CANCELED" - SUSPENDED = "SUSPENDED" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of RunStatus from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/run_template.py b/src/askui/tools/askui/askui_workspaces/models/run_template.py deleted file mode 100644 index 312795a6..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/run_template.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment - - -class RunTemplate(BaseModel): - """ - RunTemplate - """ # noqa: E501 - - workspace_id: StrictStr - workflows: Optional[List[StrictStr]] = None - runner_assignment: RunnerAssignment - data: Optional[Dict[str, Any]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "workspace_id", - "workflows", - "runner_assignment", - "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 RunTemplate 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of runner_assignment - if self.runner_assignment: - _dict["runner_assignment"] = self.runner_assignment.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if workflows (nullable) is None - # and model_fields_set contains the field - if self.workflows is None and "workflows" in self.model_fields_set: - _dict["workflows"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RunTemplate from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "workspace_id": obj.get("workspace_id"), - "workflows": obj.get("workflows"), - "runner_assignment": RunnerAssignment.from_dict( - obj["runner_assignment"] - ) - if obj.get("runner_assignment") is not None - else None, - "data": obj.get("data"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/run_template_base.py b/src/askui/tools/askui/askui_workspaces/models/run_template_base.py deleted file mode 100644 index f5feb273..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/run_template_base.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.24 -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, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.runner_assignment import RunnerAssignment - - -class RunTemplateBase(BaseModel): - """ - RunTemplateBase - """ # noqa: E501 - - workspace_id: StrictStr - workflows: List[StrictStr] - runner_assignment: RunnerAssignment - data: Optional[Dict[str, Any]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "workspace_id", - "workflows", - "runner_assignment", - "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 RunTemplateBase 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of runner_assignment - if self.runner_assignment: - _dict["runner_assignment"] = self.runner_assignment.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RunTemplateBase from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "workspace_id": obj.get("workspace_id"), - "workflows": obj.get("workflows"), - "runner_assignment": RunnerAssignment.from_dict( - obj["runner_assignment"] - ) - if obj.get("runner_assignment") is not None - else None, - "data": obj.get("data"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py b/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py deleted file mode 100644 index e55a7f78..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/runner_assignment.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.runner_host import RunnerHost - - -class RunnerAssignment(BaseModel): - """ - RunnerAssignment - """ # noqa: E501 - - ids: Optional[List[StrictStr]] = None - host: RunnerHost - tags: Optional[List[StrictStr]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["ids", "host", "tags"] - - 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 RunnerAssignment 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RunnerAssignment from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"ids": obj.get("ids"), "host": obj.get("host"), "tags": obj.get("tags")} - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_host.py b/src/askui/tools/askui/askui_workspaces/models/runner_host.py deleted file mode 100644 index d44cc300..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/runner_host.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 RunnerHost(str, Enum): - """ - RunnerHost - """ - - """ - allowed enum values - """ - SELF = "SELF" - ASKUI = "ASKUI" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of RunnerHost from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py b/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py deleted file mode 100644 index 43190552..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/runner_job_status.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 RunnerJobStatus(str, Enum): - """ - RunnerJobStatus - """ - - """ - allowed enum values - """ - PENDING = "PENDING" - RUNNING = "RUNNING" - PASSED = "PASSED" - FAILED = "FAILED" - CANCELED = "CANCELED" - MAX_RETRIES_EXCEEDED = "MAX_RETRIES_EXCEEDED" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of RunnerJobStatus from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py b/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py deleted file mode 100644 index 1c898787..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/schedule_reponse_dto.py +++ /dev/null @@ -1,171 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.run_template import RunTemplate -from askui.tools.askui.askui_workspaces.models.schedule_status import ScheduleStatus - - -class ScheduleReponseDto(BaseModel): - """ - ScheduleReponseDto - """ # noqa: E501 - - version: Optional[StrictStr] = None - id: Optional[StrictStr] = None - created_at: Optional[datetime] = None - name: StrictStr - status: Optional[ScheduleStatus] = None - started_at: datetime - ended_at: Optional[datetime] = None - schedule: Optional[StrictStr] = None - ended_after: Optional[StrictInt] = None - run_template: RunTemplate - runs_count: Optional[StrictInt] = 0 - next_run_to_be_started_at: Optional[datetime] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "version", - "id", - "created_at", - "name", - "status", - "started_at", - "ended_at", - "schedule", - "ended_after", - "run_template", - "runs_count", - "next_run_to_be_started_at", - ] - - 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 ScheduleReponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of run_template - if self.run_template: - _dict["run_template"] = self.run_template.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if ended_at (nullable) is None - # and model_fields_set contains the field - if self.ended_at is None and "ended_at" in self.model_fields_set: - _dict["ended_at"] = None - - # set to None if schedule (nullable) is None - # and model_fields_set contains the field - if self.schedule is None and "schedule" in self.model_fields_set: - _dict["schedule"] = None - - # set to None if ended_after (nullable) is None - # and model_fields_set contains the field - if self.ended_after is None and "ended_after" in self.model_fields_set: - _dict["ended_after"] = None - - # set to None if next_run_to_be_started_at (nullable) is None - # and model_fields_set contains the field - if ( - self.next_run_to_be_started_at is None - and "next_run_to_be_started_at" in self.model_fields_set - ): - _dict["next_run_to_be_started_at"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScheduleReponseDto from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "version": obj.get("version"), - "id": obj.get("id"), - "created_at": obj.get("created_at"), - "name": obj.get("name"), - "status": obj.get("status"), - "started_at": obj.get("started_at"), - "ended_at": obj.get("ended_at"), - "schedule": obj.get("schedule"), - "ended_after": obj.get("ended_after"), - "run_template": RunTemplate.from_dict(obj["run_template"]) - if obj.get("run_template") is not None - else None, - "runs_count": obj.get("runs_count") - if obj.get("runs_count") is not None - else 0, - "next_run_to_be_started_at": obj.get("next_run_to_be_started_at"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/schedule_status.py b/src/askui/tools/askui/askui_workspaces/models/schedule_status.py deleted file mode 100644 index 65d6cd5f..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/schedule_status.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 ScheduleStatus(str, Enum): - """ - ScheduleStatus - """ - - """ - allowed enum values - """ - ACTIVE = "ACTIVE" - SUSPENDED = "SUSPENDED" - ENDED = "ENDED" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ScheduleStatus from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/state.py b/src/askui/tools/askui/askui_workspaces/models/state.py deleted file mode 100644 index c80054f0..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/state.py +++ /dev/null @@ -1,367 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution_state_canceled import ( - AgentExecutionStateCanceled, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_confirmed import ( - AgentExecutionStateConfirmed, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_output import ( - AgentExecutionStateDeliveredToDestinationOutput, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_data_extraction import ( - AgentExecutionStatePendingDataExtraction, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_inputs import ( - AgentExecutionStatePendingInputs, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_pending_review import ( - AgentExecutionStatePendingReview, -) - -STATE_ONE_OF_SCHEMAS = [ - "AgentExecutionStateCanceled", - "AgentExecutionStateConfirmed", - "AgentExecutionStateDeliveredToDestinationOutput", - "AgentExecutionStatePendingDataExtraction", - "AgentExecutionStatePendingInputs", - "AgentExecutionStatePendingReview", -] - - -class State(BaseModel): - """ - State - """ - - # data type: AgentExecutionStatePendingInputs - oneof_schema_1_validator: Optional[AgentExecutionStatePendingInputs] = None - # data type: AgentExecutionStatePendingDataExtraction - oneof_schema_2_validator: Optional[AgentExecutionStatePendingDataExtraction] = None - # data type: AgentExecutionStatePendingReview - oneof_schema_3_validator: Optional[AgentExecutionStatePendingReview] = None - # data type: AgentExecutionStateCanceled - oneof_schema_4_validator: Optional[AgentExecutionStateCanceled] = None - # data type: AgentExecutionStateConfirmed - oneof_schema_5_validator: Optional[AgentExecutionStateConfirmed] = None - # data type: AgentExecutionStateDeliveredToDestinationOutput - oneof_schema_6_validator: Optional[ - AgentExecutionStateDeliveredToDestinationOutput - ] = None - actual_instance: Optional[ - Union[ - AgentExecutionStateCanceled, - AgentExecutionStateConfirmed, - AgentExecutionStateDeliveredToDestinationOutput, - AgentExecutionStatePendingDataExtraction, - AgentExecutionStatePendingInputs, - AgentExecutionStatePendingReview, - ] - ] = None - one_of_schemas: Set[str] = { - "AgentExecutionStateCanceled", - "AgentExecutionStateConfirmed", - "AgentExecutionStateDeliveredToDestinationOutput", - "AgentExecutionStatePendingDataExtraction", - "AgentExecutionStatePendingInputs", - "AgentExecutionStatePendingReview", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = State.model_construct() - error_messages = [] - match = 0 - # validate data type: AgentExecutionStatePendingInputs - if not isinstance(v, AgentExecutionStatePendingInputs): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingInputs`" - ) - else: - match += 1 - # validate data type: AgentExecutionStatePendingDataExtraction - if not isinstance(v, AgentExecutionStatePendingDataExtraction): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingDataExtraction`" - ) - else: - match += 1 - # validate data type: AgentExecutionStatePendingReview - if not isinstance(v, AgentExecutionStatePendingReview): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStatePendingReview`" - ) - else: - match += 1 - # validate data type: AgentExecutionStateCanceled - if not isinstance(v, AgentExecutionStateCanceled): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStateCanceled`" - ) - else: - match += 1 - # validate data type: AgentExecutionStateConfirmed - if not isinstance(v, AgentExecutionStateConfirmed): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStateConfirmed`" - ) - else: - match += 1 - # validate data type: AgentExecutionStateDeliveredToDestinationOutput - if not isinstance(v, AgentExecutionStateDeliveredToDestinationOutput): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationOutput`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("status") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `status` in the input." - ) - - # check if data type is `AgentExecutionStateCanceled` - if _data_type == "CANCELED": - instance.actual_instance = AgentExecutionStateCanceled.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateConfirmed` - if _data_type == "CONFIRMED": - instance.actual_instance = AgentExecutionStateConfirmed.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateDeliveredToDestinationOutput` - if _data_type == "DELIVERED_TO_DESTINATION": - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str) - ) - return instance - - # check if data type is `AgentExecutionStatePendingDataExtraction` - if _data_type == "PENDING_DATA_EXTRACTION": - instance.actual_instance = ( - AgentExecutionStatePendingDataExtraction.from_json(json_str) - ) - return instance - - # check if data type is `AgentExecutionStatePendingInputs` - if _data_type == "PENDING_INPUTS": - instance.actual_instance = AgentExecutionStatePendingInputs.from_json( - json_str - ) - return instance - - # check if data type is `AgentExecutionStatePendingReview` - if _data_type == "PENDING_REVIEW": - instance.actual_instance = AgentExecutionStatePendingReview.from_json( - json_str - ) - return instance - - # check if data type is `AgentExecutionStateCanceled` - if _data_type == "AgentExecutionStateCanceled": - instance.actual_instance = AgentExecutionStateCanceled.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateConfirmed` - if _data_type == "AgentExecutionStateConfirmed": - instance.actual_instance = AgentExecutionStateConfirmed.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateDeliveredToDestinationOutput` - if _data_type == "AgentExecutionStateDeliveredToDestination-Output": - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str) - ) - return instance - - # check if data type is `AgentExecutionStatePendingDataExtraction` - if _data_type == "AgentExecutionStatePendingDataExtraction": - instance.actual_instance = ( - AgentExecutionStatePendingDataExtraction.from_json(json_str) - ) - return instance - - # check if data type is `AgentExecutionStatePendingInputs` - if _data_type == "AgentExecutionStatePendingInputs": - instance.actual_instance = AgentExecutionStatePendingInputs.from_json( - json_str - ) - return instance - - # check if data type is `AgentExecutionStatePendingReview` - if _data_type == "AgentExecutionStatePendingReview": - instance.actual_instance = AgentExecutionStatePendingReview.from_json( - json_str - ) - return instance - - # deserialize data into AgentExecutionStatePendingInputs - try: - instance.actual_instance = AgentExecutionStatePendingInputs.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStatePendingDataExtraction - try: - instance.actual_instance = ( - AgentExecutionStatePendingDataExtraction.from_json(json_str) - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStatePendingReview - try: - instance.actual_instance = AgentExecutionStatePendingReview.from_json( - json_str - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStateCanceled - try: - instance.actual_instance = AgentExecutionStateCanceled.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStateConfirmed - try: - instance.actual_instance = AgentExecutionStateConfirmed.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStateDeliveredToDestinationOutput - try: - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationOutput.from_json(json_str) - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into State with oneOf schemas: AgentExecutionStateCanceled, AgentExecutionStateConfirmed, AgentExecutionStateDeliveredToDestinationOutput, AgentExecutionStatePendingDataExtraction, AgentExecutionStatePendingInputs, AgentExecutionStatePendingReview. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - AgentExecutionStateCanceled, - AgentExecutionStateConfirmed, - AgentExecutionStateDeliveredToDestinationOutput, - AgentExecutionStatePendingDataExtraction, - AgentExecutionStatePendingInputs, - AgentExecutionStatePendingReview, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/state1.py b/src/askui/tools/askui/askui_workspaces/models/state1.py deleted file mode 100644 index a9cc60af..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/state1.py +++ /dev/null @@ -1,285 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -from __future__ import annotations - -import json -import pprint -from typing import Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ConfigDict, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.agent_execution_cancel import ( - AgentExecutionCancel, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_confirm import ( - AgentExecutionConfirm, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_pending_review import ( - AgentExecutionPendingReview, -) -from askui.tools.askui.askui_workspaces.models.agent_execution_state_delivered_to_destination_input import ( - AgentExecutionStateDeliveredToDestinationInput, -) - -STATE1_ONE_OF_SCHEMAS = [ - "AgentExecutionCancel", - "AgentExecutionConfirm", - "AgentExecutionPendingReview", - "AgentExecutionStateDeliveredToDestinationInput", -] - - -class State1(BaseModel): - """ - State1 - """ - - # data type: AgentExecutionPendingReview - oneof_schema_1_validator: Optional[AgentExecutionPendingReview] = None - # data type: AgentExecutionCancel - oneof_schema_2_validator: Optional[AgentExecutionCancel] = None - # data type: AgentExecutionConfirm - oneof_schema_3_validator: Optional[AgentExecutionConfirm] = None - # data type: AgentExecutionStateDeliveredToDestinationInput - oneof_schema_4_validator: Optional[ - AgentExecutionStateDeliveredToDestinationInput - ] = None - actual_instance: Optional[ - Union[ - AgentExecutionCancel, - AgentExecutionConfirm, - AgentExecutionPendingReview, - AgentExecutionStateDeliveredToDestinationInput, - ] - ] = None - one_of_schemas: Set[str] = { - "AgentExecutionCancel", - "AgentExecutionConfirm", - "AgentExecutionPendingReview", - "AgentExecutionStateDeliveredToDestinationInput", - } - - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) - - discriminator_value_class_map: Dict[str, str] = {} - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_oneof(cls, v): - instance = State1.model_construct() - error_messages = [] - match = 0 - # validate data type: AgentExecutionPendingReview - if not isinstance(v, AgentExecutionPendingReview): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionPendingReview`" - ) - else: - match += 1 - # validate data type: AgentExecutionCancel - if not isinstance(v, AgentExecutionCancel): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionCancel`" - ) - else: - match += 1 - # validate data type: AgentExecutionConfirm - if not isinstance(v, AgentExecutionConfirm): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionConfirm`" - ) - else: - match += 1 - # validate data type: AgentExecutionStateDeliveredToDestinationInput - if not isinstance(v, AgentExecutionStateDeliveredToDestinationInput): - error_messages.append( - f"Error! Input type `{type(v)}` is not `AgentExecutionStateDeliveredToDestinationInput`" - ) - else: - match += 1 - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when setting `actual_instance` in State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - match = 0 - - # use oneOf discriminator to lookup the data type - _data_type = json.loads(json_str).get("status") - if not _data_type: - raise ValueError( - "Failed to lookup data type from the field `status` in the input." - ) - - # check if data type is `AgentExecutionCancel` - if _data_type == "CANCELED": - instance.actual_instance = AgentExecutionCancel.from_json(json_str) - return instance - - # check if data type is `AgentExecutionConfirm` - if _data_type == "CONFIRMED": - instance.actual_instance = AgentExecutionConfirm.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateDeliveredToDestinationInput` - if _data_type == "DELIVERED_TO_DESTINATION": - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationInput.from_json(json_str) - ) - return instance - - # check if data type is `AgentExecutionPendingReview` - if _data_type == "PENDING_REVIEW": - instance.actual_instance = AgentExecutionPendingReview.from_json(json_str) - return instance - - # check if data type is `AgentExecutionCancel` - if _data_type == "AgentExecutionCancel": - instance.actual_instance = AgentExecutionCancel.from_json(json_str) - return instance - - # check if data type is `AgentExecutionConfirm` - if _data_type == "AgentExecutionConfirm": - instance.actual_instance = AgentExecutionConfirm.from_json(json_str) - return instance - - # check if data type is `AgentExecutionPendingReview` - if _data_type == "AgentExecutionPendingReview": - instance.actual_instance = AgentExecutionPendingReview.from_json(json_str) - return instance - - # check if data type is `AgentExecutionStateDeliveredToDestinationInput` - if _data_type == "AgentExecutionStateDeliveredToDestination-Input": - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationInput.from_json(json_str) - ) - return instance - - # deserialize data into AgentExecutionPendingReview - try: - instance.actual_instance = AgentExecutionPendingReview.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionCancel - try: - instance.actual_instance = AgentExecutionCancel.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionConfirm - try: - instance.actual_instance = AgentExecutionConfirm.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into AgentExecutionStateDeliveredToDestinationInput - try: - instance.actual_instance = ( - AgentExecutionStateDeliveredToDestinationInput.from_json(json_str) - ) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError( - "Multiple matches found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " - + ", ".join(error_messages) - ) - if match == 0: - # no match - raise ValueError( - "No match found when deserializing the JSON string into State1 with oneOf schemas: AgentExecutionCancel, AgentExecutionConfirm, AgentExecutionPendingReview, AgentExecutionStateDeliveredToDestinationInput. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - AgentExecutionCancel, - AgentExecutionConfirm, - AgentExecutionPendingReview, - AgentExecutionStateDeliveredToDestinationInput, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/string_error_response.py b/src/askui/tools/askui/askui_workspaces/models/string_error_response.py deleted file mode 100644 index a8a7c9f5..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/string_error_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - - -class StringErrorResponse(BaseModel): - """ - StringErrorResponse - """ # noqa: E501 - - detail: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["detail"] - - 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 StringErrorResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StringErrorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({"detail": obj.get("detail")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py deleted file mode 100644 index 249a7164..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_input.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class SubjectAccessTokenResponseDtoInput(BaseModel): - """ - SubjectAccessTokenResponseDtoInput - """ # noqa: E501 - - id: Optional[StrictStr] = Field(default=None, alias="_id") - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - name: StrictStr - expires_at: Optional[datetime] = Field(alias="expiresAt") - creator_id: StrictStr = Field(alias="creatorId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "_id", - "createdAt", - "name", - "expiresAt", - "creatorId", - ] - - 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 SubjectAccessTokenResponseDtoInput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SubjectAccessTokenResponseDtoInput 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"), - "name": obj.get("name"), - "expiresAt": obj.get("expiresAt"), - "creatorId": obj.get("creatorId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py b/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py deleted file mode 100644 index b59714fb..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/subject_access_token_response_dto_output.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class SubjectAccessTokenResponseDtoOutput(BaseModel): - """ - SubjectAccessTokenResponseDtoOutput - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - name: StrictStr - expires_at: Optional[datetime] = Field(alias="expiresAt") - creator_id: StrictStr = Field(alias="creatorId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "name", - "expiresAt", - "creatorId", - ] - - 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 SubjectAccessTokenResponseDtoOutput 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expiresAt"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SubjectAccessTokenResponseDtoOutput 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"), - "name": obj.get("name"), - "expiresAt": obj.get("expiresAt"), - "creatorId": obj.get("creatorId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py deleted file mode 100644 index 5359d6d7..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_request_dto.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Annotated, Self - - -class UpdateWorkspaceNameRequestDto(BaseModel): - """ - UpdateWorkspaceNameRequestDto - """ # noqa: E501 - - name: Annotated[str, Field(min_length=1, strict=True, max_length=128)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 UpdateWorkspaceNameRequestDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateWorkspaceNameRequestDto 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")}) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py b/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py deleted file mode 100644 index dd8d4049..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/update_workspace_name_response_dto.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto import ( - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto, -) - - -class UpdateWorkspaceNameResponseDto(BaseModel): - """ - UpdateWorkspaceNameResponseDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - name: StrictStr - memberships: Optional[ - List[ - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto - ] - ] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "name", - "memberships", - ] - - 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 UpdateWorkspaceNameResponseDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 memberships (list) - _items = [] - if self.memberships: - for _item in self.memberships: - if _item: - _items.append(_item.to_dict()) - _dict["memberships"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if memberships (nullable) is None - # and model_fields_set contains the field - if self.memberships is None and "memberships" in self.model_fields_set: - _dict["memberships"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateWorkspaceNameResponseDto 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"), - "name": obj.get("name"), - "memberships": [ - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto.from_dict( - _item - ) - for _item in obj["memberships"] - ] - if obj.get("memberships") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py b/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py deleted file mode 100644 index 5a1f5abd..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/upload_file_response.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 Self - - -class UploadFileResponse(BaseModel): - """ - UploadFileResponse - """ # noqa: E501 - - file_path: StrictStr = Field(alias="filePath") - content_type: StrictStr = Field(alias="contentType") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filePath", "contentType"] - - 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 UploadFileResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UploadFileResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"filePath": obj.get("filePath"), "contentType": obj.get("contentType")} - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/usage_event.py b/src/askui/tools/askui/askui_workspaces/models/usage_event.py deleted file mode 100644 index ffa977b4..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/usage_event.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class UsageEvent(BaseModel): - """ - UsageEvent - """ # noqa: E501 - - id: StrictStr - access_token_id: Optional[StrictStr] = Field(default=None, alias="accessTokenId") - user_id: StrictStr = Field(alias="userId") - workspace_id: StrictStr = Field(alias="workspaceId") - timestamp: datetime - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "accessTokenId", - "userId", - "workspaceId", - "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 UsageEvent 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if access_token_id (nullable) is None - # and model_fields_set contains the field - if self.access_token_id is None and "access_token_id" in self.model_fields_set: - _dict["accessTokenId"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UsageEvent 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"), - "accessTokenId": obj.get("accessTokenId"), - "userId": obj.get("userId"), - "workspaceId": obj.get("workspaceId"), - "timestamp": obj.get("timestamp"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py b/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py deleted file mode 100644 index 60a15f1e..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/usage_events_list_response.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictBool, StrictInt -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.usage_event import UsageEvent - - -class UsageEventsListResponse(BaseModel): - """ - UsageEventsListResponse - """ # noqa: E501 - - data: List[UsageEvent] = Field( - description="List of usage events matching the query" - ) - has_more: Optional[StrictBool] = Field( - default=False, - description="Whether more events exist beyond the `limit`", - alias="hasMore", - ) - total_count: Optional[StrictInt] = Field(default=None, alias="totalCount") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["data", "hasMore", "totalCount"] - - 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 UsageEventsListResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if total_count (nullable) is None - # and model_fields_set contains the field - if self.total_count is None and "total_count" in self.model_fields_set: - _dict["totalCount"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UsageEventsListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [UsageEvent.from_dict(_item) for _item in obj["data"]] - if obj.get("data") is not None - else None, - "hasMore": obj.get("hasMore") - if obj.get("hasMore") is not None - else False, - "totalCount": obj.get("totalCount"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/user_dto.py b/src/askui/tools/askui/askui_workspaces/models/user_dto.py deleted file mode 100644 index de2ed919..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/user_dto.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - - -class UserDto(BaseModel): - """ - UserDto - """ # noqa: E501 - - id: StrictStr - email: StrictStr - name: StrictStr - picture: Annotated[str, Field(min_length=1, strict=True)] - updated_at: datetime = Field(alias="updatedAt") - created_at: datetime = Field(alias="createdAt") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "email", - "name", - "picture", - "updatedAt", - "createdAt", - ] - - 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 UserDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserDto 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"), - "email": obj.get("email"), - "name": obj.get("name"), - "picture": obj.get("picture"), - "updatedAt": obj.get("updatedAt"), - "createdAt": obj.get("createdAt"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/validation_error.py b/src/askui/tools/askui/askui_workspaces/models/validation_error.py deleted file mode 100644 index 2882e67a..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/validation_error.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.validation_error_loc_inner import ( - ValidationErrorLocInner, -) - - -class ValidationError(BaseModel): - """ - ValidationError - """ # noqa: E501 - - loc: List[ValidationErrorLocInner] - msg: StrictStr - type: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["loc", "msg", "type"] - - 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 ValidationError 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 loc (list) - _items = [] - if self.loc: - for _item in self.loc: - if _item: - _items.append(_item.to_dict()) - _dict["loc"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ValidationError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "loc": [ - ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"] - ] - if obj.get("loc") is not None - else None, - "msg": obj.get("msg"), - "type": obj.get("type"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py b/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py deleted file mode 100644 index 7bcfe0cf..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/validation_error_loc_inner.py +++ /dev/null @@ -1,151 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 TYPE_CHECKING, Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - StrictInt, - StrictStr, - ValidationError, - field_validator, -) -from typing_extensions import Self - -VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"] - - -class ValidationErrorLocInner(BaseModel): - """ - ValidationErrorLocInner - """ - - # data type: str - anyof_schema_1_validator: Optional[StrictStr] = None - # data type: int - anyof_schema_2_validator: Optional[StrictInt] = None - if TYPE_CHECKING: - actual_instance: Optional[Union[int, str]] = None - else: - actual_instance: Any = None - any_of_schemas: Set[str] = {"int", "str"} - - model_config = { - "validate_assignment": True, - "protected_namespaces": (), - } - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError( - "If a position argument is used, only 1 is allowed to set `actual_instance`" - ) - if kwargs: - raise ValueError( - "If a position argument is used, keyword arguments cannot be used." - ) - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_anyof(cls, v): - instance = ValidationErrorLocInner.model_construct() - error_messages = [] - # validate data type: str - try: - instance.anyof_schema_1_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: int - try: - instance.anyof_schema_2_validator = v - return v - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if error_messages: - # no match - raise ValueError( - "No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " - + ", ".join(error_messages) - ) - return v - - @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - # deserialize data into str - try: - # validation - instance.anyof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_1_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into int - try: - # validation - instance.anyof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.anyof_schema_2_validator - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if error_messages: - # no match - raise ValueError( - "No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " - + ", ".join(error_messages) - ) - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): - return self.actual_instance.to_json() - return json.dumps(self.actual_instance) - - def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): - return self.actual_instance.to_dict() - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/src/askui/tools/askui/askui_workspaces/models/webhook_response.py b/src/askui/tools/askui/askui_workspaces/models/webhook_response.py deleted file mode 100644 index d857f9c5..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/webhook_response.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 - - -class WebhookResponse(BaseModel): - """ - WebhookResponse - """ # noqa: E501 - - status_code: StrictInt = Field(alias="statusCode") - headers: Dict[str, StrictStr] - body: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["statusCode", "headers", "body"] - - 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 WebhookResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebhookResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "statusCode": obj.get("statusCode"), - "headers": obj.get("headers"), - "body": obj.get("body"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py b/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py deleted file mode 100644 index cfcd9cd4..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspace_access_token.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing_extensions import Self - - -class WorkspaceAccessToken(BaseModel): - """ - WorkspaceAccessToken - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = None - name: StrictStr - hash: StrictStr - expires_at: Optional[datetime] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "created_at", - "name", - "hash", - "expires_at", - ] - - 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 WorkspaceAccessToken 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if expires_at (nullable) is None - # and model_fields_set contains the field - if self.expires_at is None and "expires_at" in self.model_fields_set: - _dict["expires_at"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspaceAccessToken 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"), - "created_at": obj.get("created_at"), - "name": obj.get("name"), - "hash": obj.get("hash"), - "expires_at": obj.get("expires_at"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py deleted file mode 100644 index 0adb529a..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspace_dto.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - - -class WorkspaceDto(BaseModel): - """ - WorkspaceDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - name: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "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 WorkspaceDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspaceDto 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"), - "name": obj.get("name"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py b/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py deleted file mode 100644 index b0e143d5..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspace_memberships_list_response.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto import ( - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto, -) - - -class WorkspaceMembershipsListResponse(BaseModel): - """ - WorkspaceMembershipsListResponse - """ # noqa: E501 - - data: List[ - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto - ] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["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 WorkspaceMembershipsListResponse 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 data (list) - _items = [] - if self.data: - for _item in self.data: - if _item: - _items.append(_item.to_dict()) - _dict["data"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspaceMembershipsListResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "data": [ - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto.from_dict( - _item - ) - for _item in obj["data"] - ] - if obj.get("data") is not None - else None - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py b/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py deleted file mode 100644 index dcf1d197..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspace_privilege.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 WorkspacePrivilege(str, Enum): - """ - WorkspacePrivilege - """ - - """ - allowed enum values - """ - ROLE_WORKSPACE_OWNER = "ROLE_WORKSPACE_OWNER" - ROLE_WORKSPACE_ADMIN = "ROLE_WORKSPACE_ADMIN" - ROLE_WORKSPACE_MEMBER = "ROLE_WORKSPACE_MEMBER" - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of WorkspacePrivilege from a JSON string""" - return cls(json.loads(json_str)) diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py deleted file mode 100644 index 59a530c4..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_create_workspace_response_dto_workspace_membership_dto.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspace_access_token import ( - WorkspaceAccessToken, -) -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) - - -class WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto( - BaseModel -): - """ - WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - user_id: StrictStr = Field(alias="userId") - workspace_id: StrictStr = Field(alias="workspaceId") - privileges: List[WorkspacePrivilege] - access_tokens: Optional[List[WorkspaceAccessToken]] = Field( - default=None, alias="accessTokens" - ) - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "userId", - "workspaceId", - "privileges", - "accessTokens", - ] - - 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 WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _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 access_tokens (list) - _items = [] - if self.access_tokens: - for _item in self.access_tokens: - if _item: - _items.append(_item.to_dict()) - _dict["accessTokens"] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspacesEntrypointsHttpRoutersWorkspacesMainCreateWorkspaceResponseDtoWorkspaceMembershipDto 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"), - "userId": obj.get("userId"), - "workspaceId": obj.get("workspaceId"), - "privileges": obj.get("privileges"), - "accessTokens": [ - WorkspaceAccessToken.from_dict(_item) - for _item in obj["accessTokens"] - ] - if obj.get("accessTokens") is not None - else None, - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py deleted file mode 100644 index 3cefc8f2..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspaces_entrypoints_http_routers_workspaces_main_update_workspace_name_response_dto_workspace_membership_dto.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) - - -class WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto( - BaseModel -): - """ - WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - user_id: StrictStr = Field(alias="userId") - workspace_id: StrictStr = Field(alias="workspaceId") - privileges: List[WorkspacePrivilege] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "userId", - "workspaceId", - "privileges", - ] - - 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 WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspacesEntrypointsHttpRoutersWorkspacesMainUpdateWorkspaceNameResponseDtoWorkspaceMembershipDto 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"), - "userId": obj.get("userId"), - "workspaceId": obj.get("workspaceId"), - "privileges": obj.get("privileges"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py b/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py deleted file mode 100644 index 2d9af5f6..00000000 --- a/src/askui/tools/askui/askui_workspaces/models/workspaces_use_cases_workspace_memberships_list_workspace_memberships_workspace_membership_dto.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -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 datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from askui.tools.askui.askui_workspaces.models.user_dto import UserDto -from askui.tools.askui.askui_workspaces.models.workspace_dto import WorkspaceDto -from askui.tools.askui.askui_workspaces.models.workspace_privilege import ( - WorkspacePrivilege, -) - - -class WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto( - BaseModel -): - """ - WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto - """ # noqa: E501 - - id: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(default=None, alias="createdAt") - updated_at: Optional[datetime] = Field(default=None, alias="updatedAt") - privileges: List[WorkspacePrivilege] - user: Optional[UserDto] = None - user_id: StrictStr = Field(alias="userId") - workspace: Optional[WorkspaceDto] = None - workspace_id: StrictStr = Field(alias="workspaceId") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = [ - "id", - "createdAt", - "updatedAt", - "privileges", - "user", - "userId", - "workspace", - "workspaceId", - ] - - 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 WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set( - [ - "additional_properties", - ] - ) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict["user"] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of workspace - if self.workspace: - _dict["workspace"] = self.workspace.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if user (nullable) is None - # and model_fields_set contains the field - if self.user is None and "user" in self.model_fields_set: - _dict["user"] = None - - # set to None if workspace (nullable) is None - # and model_fields_set contains the field - if self.workspace is None and "workspace" in self.model_fields_set: - _dict["workspace"] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WorkspacesUseCasesWorkspaceMembershipsListWorkspaceMembershipsWorkspaceMembershipDto 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"), - "privileges": obj.get("privileges"), - "user": UserDto.from_dict(obj["user"]) - if obj.get("user") is not None - else None, - "userId": obj.get("userId"), - "workspace": WorkspaceDto.from_dict(obj["workspace"]) - if obj.get("workspace") is not None - else None, - "workspaceId": obj.get("workspaceId"), - } - ) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj diff --git a/src/askui/tools/askui/askui_workspaces/py.typed b/src/askui/tools/askui/askui_workspaces/py.typed deleted file mode 100644 index e69de29b..00000000 diff --git a/src/askui/tools/askui/askui_workspaces/rest.py b/src/askui/tools/askui/askui_workspaces/rest.py deleted file mode 100644 index dd27d7ed..00000000 --- a/src/askui/tools/askui/askui_workspaces/rest.py +++ /dev/null @@ -1,239 +0,0 @@ -# coding: utf-8 - -""" -AskUI Workspaces API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 0.1.30 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" # noqa: E501 - -import io -import json -import re -import ssl - -import urllib3 - -from askui.tools.askui.askui_workspaces.exceptions import ApiException, ApiValueError - -SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} -RESTResponseType = urllib3.HTTPResponse - - -def is_socks_proxy_url(url): - if url is None: - return False - split_section = url.split("://") - if len(split_section) < 2: - return False - return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES - - -class RESTResponse(io.IOBase): - def __init__(self, resp) -> None: - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None - - def read(self): - if self.data is None: - self.data = self.response.data - return self.data - - def getheaders(self): - """Returns a dictionary 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: - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - } - if configuration.assert_hostname is not None: - pool_args["assert_hostname"] = configuration.assert_hostname - - if configuration.retries is not None: - pool_args["retries"] = configuration.retries - - if configuration.tls_server_name: - pool_args["server_hostname"] = configuration.tls_server_name - - if configuration.socket_options is not None: - pool_args["socket_options"] = configuration.socket_options - - if configuration.connection_pool_maxsize is not None: - pool_args["maxsize"] = configuration.connection_pool_maxsize - - # https pool manager - self.pool_manager: urllib3.PoolManager - - if configuration.proxy: - if is_socks_proxy_url(configuration.proxy): - from urllib3.contrib.socks import SOCKSProxyManager - - pool_args["proxy_url"] = configuration.proxy - pool_args["headers"] = configuration.proxy_headers - self.pool_manager = SOCKSProxyManager(**pool_args) - else: - pool_args["proxy_url"] = configuration.proxy - pool_args["proxy_headers"] = configuration.proxy_headers - self.pool_manager = urllib3.ProxyManager(**pool_args) - else: - self.pool_manager = urllib3.PoolManager(**pool_args) - - def request( - self, - method, - url, - headers=None, - body=None, - post_params=None, - _request_timeout=None, - ): - """Perform requests. - - :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 {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): - timeout = urllib3.Timeout(total=_request_timeout) - elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1] - ) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - # no content type provided or payload is json - content_type = headers.get("Content-Type") - if not content_type or re.search("json", content_type, re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif content_type == "application/x-www-form-urlencoded": - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif content_type == "multipart/form-data": - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers["Content-Type"] - # Ensures that dict objects are serialized - post_params = [ - (a, json.dumps(b)) if isinstance(b, dict) else (a, b) - for a, b in post_params - ] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False, - ) - # Pass a `string` 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): - r = self.pool_manager.request( - method, - url, - body=body, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - timeout=timeout, - headers=headers, - ) - 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) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False, - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise ApiException(status=0, reason=msg) from e - - return RESTResponse(r) diff --git a/src/askui/tools/askui/exceptions.py b/src/askui/tools/askui/exceptions.py index 0c1f90e2..ee67ce35 100644 --- a/src/askui/tools/askui/exceptions.py +++ b/src/askui/tools/askui/exceptions.py @@ -1,18 +1,3 @@ -from .askui_workspaces.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - BadRequestException, - ForbiddenException, - NotFoundException, - OpenApiException, - ServiceException, - UnauthorizedException, -) - - class AskUiControllerError(Exception): """Base exception for AskUI controller errors. @@ -64,18 +49,7 @@ def __init__( __all__ = [ - "ApiAttributeError", - "ApiException", - "ApiKeyError", - "ApiTypeError", - "ApiValueError", "AskUiControllerError", "AskUiControllerOperationFailedError", "AskUiControllerOperationTimeoutError", - "BadRequestException", - "ForbiddenException", - "NotFoundException", - "OpenApiException", - "ServiceException", - "UnauthorizedException", ] diff --git a/src/askui/tools/toolbox.py b/src/askui/tools/toolbox.py index 3f33c034..3f954fe4 100644 --- a/src/askui/tools/toolbox.py +++ b/src/askui/tools/toolbox.py @@ -4,7 +4,6 @@ import pyperclip from askui.tools.agent_os import AgentOs -from askui.tools.askui.askui_hub import AskUIHub class AgentToolbox: @@ -21,22 +20,10 @@ class AgentToolbox: clipboard: `pyperclip` module for clipboard access. agent_os (AgentOs): The OS interface for mouse, keyboard, and screen actions. httpx: HTTPX client for HTTP requests. - hub (AskUIHub): Internal AskUI Hub instance. """ def __init__(self, agent_os: AgentOs): self.webbrowser = webbrowser self.clipboard = pyperclip self.os = agent_os - self._hub = AskUIHub() self.httpx = httpx - - @property - def hub(self) -> AskUIHub: - if self._hub.disabled: - error_msg = ( - "AskUI Hub is disabled. Please, set ASKUI_WORKSPACE_ID and " - "ASKUI_TOKEN environment variables to enable it." - ) - raise ValueError(error_msg) - return self._hub