diff --git a/tangle_cli/api/_tangle_api_client_lib/__init__.py b/tangle_cli/api/_tangle_api_client_lib/__init__.py new file mode 100644 index 0000000..9d26b7b --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Cloud Pipelines API""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/tangle_cli/api/_tangle_api_client_lib/api/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/__init__.py new file mode 100644 index 0000000..81f9fa2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/admin/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/admin/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/admin/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_execution_node_status_api_admin_execution_node_id_status_put.py b/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_execution_node_status_api_admin_execution_node_id_status_put.py new file mode 100644 index 0000000..6f642c9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_execution_node_status_api_admin_execution_node_id_status_put.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.container_execution_status import ContainerExecutionStatus +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response + + +def _get_kwargs( + id: str, + *, + status: ContainerExecutionStatus, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_status = status.value + params["status"] = json_status + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/admin/execution_node/{id}/status".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + status: ContainerExecutionStatus, +) -> Response[Any | HTTPValidationError]: + """Admin Set Execution Node Status + + Args: + id (str): + status (ContainerExecutionStatus): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + status=status, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + status: ContainerExecutionStatus, +) -> Any | HTTPValidationError | None: + """Admin Set Execution Node Status + + Args: + id (str): + status (ContainerExecutionStatus): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + status=status, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + status: ContainerExecutionStatus, +) -> Response[Any | HTTPValidationError]: + """Admin Set Execution Node Status + + Args: + id (str): + status (ContainerExecutionStatus): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + status=status, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + status: ContainerExecutionStatus, +) -> Any | HTTPValidationError | None: + """Admin Set Execution Node Status + + Args: + id (str): + status (ContainerExecutionStatus): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + status=status, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_read_only_model_api_admin_set_read_only_model_put.py b/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_read_only_model_api_admin_set_read_only_model_put.py new file mode 100644 index 0000000..51ac80c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/admin/admin_set_read_only_model_api_admin_set_read_only_model_put.py @@ -0,0 +1,164 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response + + +def _get_kwargs( + *, + read_only: bool, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["read_only"] = read_only + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/admin/set_read_only_model", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + read_only: bool, +) -> Response[Any | HTTPValidationError]: + """Admin Set Read Only Model + + Args: + read_only (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + read_only=read_only, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + read_only: bool, +) -> Any | HTTPValidationError | None: + """Admin Set Read Only Model + + Args: + read_only (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + client=client, + read_only=read_only, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + read_only: bool, +) -> Response[Any | HTTPValidationError]: + """Admin Set Read Only Model + + Args: + read_only (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + read_only=read_only, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + read_only: bool, +) -> Any | HTTPValidationError | None: + """Admin Set Read Only Model + + Args: + read_only (bool): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + read_only=read_only, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/artifacts/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_api_artifacts_id_get.py b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_api_artifacts_id_get.py new file mode 100644 index 0000000..e73fcef --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_api_artifacts_id_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_artifact_info_response import GetArtifactInfoResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/artifacts/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetArtifactInfoResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetArtifactInfoResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetArtifactInfoResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetArtifactInfoResponse | HTTPValidationError]: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetArtifactInfoResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetArtifactInfoResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetArtifactInfoResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetArtifactInfoResponse | HTTPValidationError]: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetArtifactInfoResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetArtifactInfoResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetArtifactInfoResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_signed_artifact_url_api_artifacts_id_signed_artifact_url_get.py b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_signed_artifact_url_api_artifacts_id_signed_artifact_url_get.py new file mode 100644 index 0000000..efdba56 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/artifacts/get_signed_artifact_url_api_artifacts_id_signed_artifact_url_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_artifact_signed_url_response import GetArtifactSignedUrlResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/artifacts/{id}/signed_artifact_url".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetArtifactSignedUrlResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetArtifactSignedUrlResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetArtifactSignedUrlResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetArtifactSignedUrlResponse | HTTPValidationError]: + """Get Signed Artifact Url + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetArtifactSignedUrlResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetArtifactSignedUrlResponse | HTTPValidationError | None: + """Get Signed Artifact Url + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetArtifactSignedUrlResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetArtifactSignedUrlResponse | HTTPValidationError]: + """Get Signed Artifact Url + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetArtifactSignedUrlResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetArtifactSignedUrlResponse | HTTPValidationError | None: + """Get Signed Artifact Url + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetArtifactSignedUrlResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/components/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/create_api_component_libraries_post.py b/tangle_cli/api/_tangle_api_client_lib/api/components/create_api_component_libraries_post.py new file mode 100644 index 0000000..1d905f9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/create_api_component_libraries_post.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_library import ComponentLibrary +from ...models.component_library_response import ComponentLibraryResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: ComponentLibrary, + hide_from_search: bool | Unset = False, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["hide_from_search"] = hide_from_search + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/component_libraries/", + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ComponentLibraryResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ComponentLibraryResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | Unset = False, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Create + + Args: + hide_from_search (bool | Unset): Default: False. + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + hide_from_search=hide_from_search, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | Unset = False, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Create + + Args: + hide_from_search (bool | Unset): Default: False. + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return sync_detailed( + client=client, + body=body, + hide_from_search=hide_from_search, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | Unset = False, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Create + + Args: + hide_from_search (bool | Unset): Default: False. + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + hide_from_search=hide_from_search, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | Unset = False, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Create + + Args: + hide_from_search (bool | Unset): Default: False. + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + hide_from_search=hide_from_search, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_component_libraries_id_get.py b/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_component_libraries_id_get.py new file mode 100644 index 0000000..ce7ff9f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_component_libraries_id_get.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_library_response import ComponentLibraryResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include_component_texts: bool | Unset = False, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["include_component_texts"] = include_component_texts + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/component_libraries/{id}".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ComponentLibraryResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ComponentLibraryResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_component_texts: bool | Unset = False, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Get + + Args: + id (str): + include_component_texts (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + include_component_texts=include_component_texts, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + include_component_texts: bool | Unset = False, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + include_component_texts (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + include_component_texts=include_component_texts, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_component_texts: bool | Unset = False, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Get + + Args: + id (str): + include_component_texts (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + include_component_texts=include_component_texts, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + include_component_texts: bool | Unset = False, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + include_component_texts (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include_component_texts=include_component_texts, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_components_digest_get.py b/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_components_digest_get.py new file mode 100644 index 0000000..1ba4941 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/get_api_components_digest_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_response import ComponentResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + digest: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/components/{digest}".format( + digest=quote(str(digest), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ComponentResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ComponentResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + digest: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ComponentResponse | HTTPValidationError]: + """Get + + Args: + digest (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + digest=digest, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + digest: str, + *, + client: AuthenticatedClient | Client, +) -> ComponentResponse | HTTPValidationError | None: + """Get + + Args: + digest (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentResponse | HTTPValidationError + """ + + return sync_detailed( + digest=digest, + client=client, + ).parsed + + +async def asyncio_detailed( + digest: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ComponentResponse | HTTPValidationError]: + """Get + + Args: + digest (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + digest=digest, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + digest: str, + *, + client: AuthenticatedClient | Client, +) -> ComponentResponse | HTTPValidationError | None: + """Get + + Args: + digest (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + digest=digest, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/get_component_library_pins_api_component_library_pins_me_get.py b/tangle_cli/api/_tangle_api_client_lib/api/components/get_component_library_pins_api_component_library_pins_me_get.py new file mode 100644 index 0000000..387f3bb --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/get_component_library_pins_api_component_library_pins_me_get.py @@ -0,0 +1,128 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.user_component_library_pins_response import UserComponentLibraryPinsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/component_library_pins/me/", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> UserComponentLibraryPinsResponse | None: + if response.status_code == 200: + response_200 = UserComponentLibraryPinsResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[UserComponentLibraryPinsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[UserComponentLibraryPinsResponse]: + """Get Component Library Pins + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserComponentLibraryPinsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> UserComponentLibraryPinsResponse | None: + """Get Component Library Pins + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserComponentLibraryPinsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[UserComponentLibraryPinsResponse]: + """Get Component Library Pins + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UserComponentLibraryPinsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> UserComponentLibraryPinsResponse | None: + """Get Component Library Pins + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UserComponentLibraryPinsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_component_libraries_get.py b/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_component_libraries_get.py new file mode 100644 index 0000000..226b0af --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_component_libraries_get.py @@ -0,0 +1,171 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.list_component_libraries_response import ListComponentLibrariesResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + name_substring: None | str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_name_substring: None | str | Unset + if isinstance(name_substring, Unset): + json_name_substring = UNSET + else: + json_name_substring = name_substring + params["name_substring"] = json_name_substring + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/component_libraries/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | ListComponentLibrariesResponse | None: + if response.status_code == 200: + response_200 = ListComponentLibrariesResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | ListComponentLibrariesResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + name_substring: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | ListComponentLibrariesResponse]: + """List + + Args: + name_substring (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListComponentLibrariesResponse] + """ + + kwargs = _get_kwargs( + name_substring=name_substring, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + name_substring: None | str | Unset = UNSET, +) -> HTTPValidationError | ListComponentLibrariesResponse | None: + """List + + Args: + name_substring (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListComponentLibrariesResponse + """ + + return sync_detailed( + client=client, + name_substring=name_substring, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + name_substring: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | ListComponentLibrariesResponse]: + """List + + Args: + name_substring (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListComponentLibrariesResponse] + """ + + kwargs = _get_kwargs( + name_substring=name_substring, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + name_substring: None | str | Unset = UNSET, +) -> HTTPValidationError | ListComponentLibrariesResponse | None: + """List + + Args: + name_substring (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListComponentLibrariesResponse + """ + + return ( + await asyncio_detailed( + client=client, + name_substring=name_substring, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_published_components_get.py b/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_published_components_get.py new file mode 100644 index 0000000..ed61f66 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/list_api_published_components_get.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.list_published_components_response import ListPublishedComponentsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + include_deprecated: bool | Unset = False, + name_substring: None | str | Unset = UNSET, + published_by_substring: None | str | Unset = UNSET, + digest: None | str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["include_deprecated"] = include_deprecated + + json_name_substring: None | str | Unset + if isinstance(name_substring, Unset): + json_name_substring = UNSET + else: + json_name_substring = name_substring + params["name_substring"] = json_name_substring + + json_published_by_substring: None | str | Unset + if isinstance(published_by_substring, Unset): + json_published_by_substring = UNSET + else: + json_published_by_substring = published_by_substring + params["published_by_substring"] = json_published_by_substring + + json_digest: None | str | Unset + if isinstance(digest, Unset): + json_digest = UNSET + else: + json_digest = digest + params["digest"] = json_digest + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/published_components/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | ListPublishedComponentsResponse | None: + if response.status_code == 200: + response_200 = ListPublishedComponentsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | ListPublishedComponentsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + include_deprecated: bool | Unset = False, + name_substring: None | str | Unset = UNSET, + published_by_substring: None | str | Unset = UNSET, + digest: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | ListPublishedComponentsResponse]: + """List + + Args: + include_deprecated (bool | Unset): Default: False. + name_substring (None | str | Unset): + published_by_substring (None | str | Unset): + digest (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListPublishedComponentsResponse] + """ + + kwargs = _get_kwargs( + include_deprecated=include_deprecated, + name_substring=name_substring, + published_by_substring=published_by_substring, + digest=digest, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + include_deprecated: bool | Unset = False, + name_substring: None | str | Unset = UNSET, + published_by_substring: None | str | Unset = UNSET, + digest: None | str | Unset = UNSET, +) -> HTTPValidationError | ListPublishedComponentsResponse | None: + """List + + Args: + include_deprecated (bool | Unset): Default: False. + name_substring (None | str | Unset): + published_by_substring (None | str | Unset): + digest (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListPublishedComponentsResponse + """ + + return sync_detailed( + client=client, + include_deprecated=include_deprecated, + name_substring=name_substring, + published_by_substring=published_by_substring, + digest=digest, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + include_deprecated: bool | Unset = False, + name_substring: None | str | Unset = UNSET, + published_by_substring: None | str | Unset = UNSET, + digest: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | ListPublishedComponentsResponse]: + """List + + Args: + include_deprecated (bool | Unset): Default: False. + name_substring (None | str | Unset): + published_by_substring (None | str | Unset): + digest (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListPublishedComponentsResponse] + """ + + kwargs = _get_kwargs( + include_deprecated=include_deprecated, + name_substring=name_substring, + published_by_substring=published_by_substring, + digest=digest, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + include_deprecated: bool | Unset = False, + name_substring: None | str | Unset = UNSET, + published_by_substring: None | str | Unset = UNSET, + digest: None | str | Unset = UNSET, +) -> HTTPValidationError | ListPublishedComponentsResponse | None: + """List + + Args: + include_deprecated (bool | Unset): Default: False. + name_substring (None | str | Unset): + published_by_substring (None | str | Unset): + digest (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListPublishedComponentsResponse + """ + + return ( + await asyncio_detailed( + client=client, + include_deprecated=include_deprecated, + name_substring=name_substring, + published_by_substring=published_by_substring, + digest=digest, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/publish_api_published_components_post.py b/tangle_cli/api/_tangle_api_client_lib/api/components/publish_api_published_components_post.py new file mode 100644 index 0000000..2e3a9a1 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/publish_api_published_components_post.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_reference import ComponentReference +from ...models.http_validation_error import HTTPValidationError +from ...models.published_component_response import PublishedComponentResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ComponentReference, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/published_components/", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | PublishedComponentResponse | None: + if response.status_code == 200: + response_200 = PublishedComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | PublishedComponentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: ComponentReference, +) -> Response[HTTPValidationError | PublishedComponentResponse]: + """Publish + + Args: + body (ComponentReference): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PublishedComponentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ComponentReference, +) -> HTTPValidationError | PublishedComponentResponse | None: + """Publish + + Args: + body (ComponentReference): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PublishedComponentResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ComponentReference, +) -> Response[HTTPValidationError | PublishedComponentResponse]: + """Publish + + Args: + body (ComponentReference): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PublishedComponentResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ComponentReference, +) -> HTTPValidationError | PublishedComponentResponse | None: + """Publish + + Args: + body (ComponentReference): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PublishedComponentResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/replace_api_component_libraries_id_put.py b/tangle_cli/api/_tangle_api_client_lib/api/components/replace_api_component_libraries_id_put.py new file mode 100644 index 0000000..b0f707e --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/replace_api_component_libraries_id_put.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.component_library import ComponentLibrary +from ...models.component_library_response import ComponentLibraryResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + body: ComponentLibrary, + hide_from_search: bool | None | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + json_hide_from_search: bool | None | Unset + if isinstance(hide_from_search, Unset): + json_hide_from_search = UNSET + else: + json_hide_from_search = hide_from_search + params["hide_from_search"] = json_hide_from_search + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/component_libraries/{id}".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ComponentLibraryResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = ComponentLibraryResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | None | Unset = UNSET, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Replace + + Args: + id (str): + hide_from_search (bool | None | Unset): + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + hide_from_search=hide_from_search, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | None | Unset = UNSET, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Replace + + Args: + id (str): + hide_from_search (bool | None | Unset): + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + body=body, + hide_from_search=hide_from_search, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | None | Unset = UNSET, +) -> Response[ComponentLibraryResponse | HTTPValidationError]: + """Replace + + Args: + id (str): + hide_from_search (bool | None | Unset): + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ComponentLibraryResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + hide_from_search=hide_from_search, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + body: ComponentLibrary, + hide_from_search: bool | None | Unset = UNSET, +) -> ComponentLibraryResponse | HTTPValidationError | None: + """Replace + + Args: + id (str): + hide_from_search (bool | None | Unset): + body (ComponentLibrary): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ComponentLibraryResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + hide_from_search=hide_from_search, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/set_component_library_pins_api_component_library_pins_me_put.py b/tangle_cli/api/_tangle_api_client_lib/api/components/set_component_library_pins_api_component_library_pins_me_put.py new file mode 100644 index 0000000..07fa182 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/set_component_library_pins_api_component_library_pins_me_put.py @@ -0,0 +1,163 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + *, + body: list[str], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/component_library_pins/me/", + } + + _kwargs["json"] = body + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: list[str], +) -> Response[Any | HTTPValidationError]: + """Set Component Library Pins + + Args: + body (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: list[str], +) -> Any | HTTPValidationError | None: + """Set Component Library Pins + + Args: + body (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: list[str], +) -> Response[Any | HTTPValidationError]: + """Set Component Library Pins + + Args: + body (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: list[str], +) -> Any | HTTPValidationError | None: + """Set Component Library Pins + + Args: + body (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/components/update_api_published_components_digest_put.py b/tangle_cli/api/_tangle_api_client_lib/api/components/update_api_published_components_digest_put.py new file mode 100644 index 0000000..ac6a129 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/components/update_api_published_components_digest_put.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.published_component_response import PublishedComponentResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + digest: str, + *, + deprecated: bool | None | Unset = UNSET, + superseded_by: None | str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_deprecated: bool | None | Unset + if isinstance(deprecated, Unset): + json_deprecated = UNSET + else: + json_deprecated = deprecated + params["deprecated"] = json_deprecated + + json_superseded_by: None | str | Unset + if isinstance(superseded_by, Unset): + json_superseded_by = UNSET + else: + json_superseded_by = superseded_by + params["superseded_by"] = json_superseded_by + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/published_components/{digest}".format( + digest=quote(str(digest), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | PublishedComponentResponse | None: + if response.status_code == 200: + response_200 = PublishedComponentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | PublishedComponentResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + digest: str, + *, + client: AuthenticatedClient | Client, + deprecated: bool | None | Unset = UNSET, + superseded_by: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | PublishedComponentResponse]: + """Update + + Args: + digest (str): + deprecated (bool | None | Unset): + superseded_by (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PublishedComponentResponse] + """ + + kwargs = _get_kwargs( + digest=digest, + deprecated=deprecated, + superseded_by=superseded_by, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + digest: str, + *, + client: AuthenticatedClient | Client, + deprecated: bool | None | Unset = UNSET, + superseded_by: None | str | Unset = UNSET, +) -> HTTPValidationError | PublishedComponentResponse | None: + """Update + + Args: + digest (str): + deprecated (bool | None | Unset): + superseded_by (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PublishedComponentResponse + """ + + return sync_detailed( + digest=digest, + client=client, + deprecated=deprecated, + superseded_by=superseded_by, + ).parsed + + +async def asyncio_detailed( + digest: str, + *, + client: AuthenticatedClient | Client, + deprecated: bool | None | Unset = UNSET, + superseded_by: None | str | Unset = UNSET, +) -> Response[HTTPValidationError | PublishedComponentResponse]: + """Update + + Args: + digest (str): + deprecated (bool | None | Unset): + superseded_by (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PublishedComponentResponse] + """ + + kwargs = _get_kwargs( + digest=digest, + deprecated=deprecated, + superseded_by=superseded_by, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + digest: str, + *, + client: AuthenticatedClient | Client, + deprecated: bool | None | Unset = UNSET, + superseded_by: None | str | Unset = UNSET, +) -> HTTPValidationError | PublishedComponentResponse | None: + """Update + + Args: + digest (str): + deprecated (bool | None | Unset): + superseded_by (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PublishedComponentResponse + """ + + return ( + await asyncio_detailed( + digest=digest, + client=client, + deprecated=deprecated, + superseded_by=superseded_by, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/default/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/default/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/default/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/default/get_sql_engine_connection_pool_status_api_admin_sql_engine_connection_pool_status_get.py b/tangle_cli/api/_tangle_api_client_lib/api/default/get_sql_engine_connection_pool_status_api_admin_sql_engine_connection_pool_status_get.py new file mode 100644 index 0000000..071daaf --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/default/get_sql_engine_connection_pool_status_api_admin_sql_engine_connection_pool_status_get.py @@ -0,0 +1,122 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/admin/sql_engine_connection_pool_status", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> str | None: + if response.status_code == 200: + response_200 = cast(str, response.json()) + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[str]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[str]: + """Get Sql Engine Connection Pool Status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[str] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> str | None: + """Get Sql Engine Connection Pool Status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + str + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[str]: + """Get Sql Engine Connection Pool Status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[str] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> str | None: + """Get Sql Engine Connection Pool Status + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + str + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/default/health_check_services_ping_get.py b/tangle_cli/api/_tangle_api_client_lib/api/default/health_check_services_ping_get.py new file mode 100644 index 0000000..0f0cf6f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/default/health_check_services_ping_get.py @@ -0,0 +1,81 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/services/ping", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 200: + return None + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[Any]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any]: + """Health Check + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[Any]: + """Health Check + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_api_executions_id_details_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_api_executions_id_details_get.py new file mode 100644 index 0000000..8ae2efb --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_api_executions_id_details_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_execution_info_response import GetExecutionInfoResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/details".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetExecutionInfoResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetExecutionInfoResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetExecutionInfoResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetExecutionInfoResponse | HTTPValidationError]: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetExecutionInfoResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetExecutionInfoResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetExecutionInfoResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetExecutionInfoResponse | HTTPValidationError]: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetExecutionInfoResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetExecutionInfoResponse | HTTPValidationError | None: + """Get + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetExecutionInfoResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_artifacts_api_executions_id_artifacts_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_artifacts_api_executions_id_artifacts_get.py new file mode 100644 index 0000000..69f9fc0 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_artifacts_api_executions_id_artifacts_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_execution_artifacts_response import GetExecutionArtifactsResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/artifacts".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetExecutionArtifactsResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetExecutionArtifactsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetExecutionArtifactsResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetExecutionArtifactsResponse | HTTPValidationError]: + """Get Artifacts + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetExecutionArtifactsResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetExecutionArtifactsResponse | HTTPValidationError | None: + """Get Artifacts + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetExecutionArtifactsResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetExecutionArtifactsResponse | HTTPValidationError]: + """Get Artifacts + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetExecutionArtifactsResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetExecutionArtifactsResponse | HTTPValidationError | None: + """Get Artifacts + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetExecutionArtifactsResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_execution_state_api_executions_id_container_state_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_execution_state_api_executions_id_container_state_get.py new file mode 100644 index 0000000..c68b077 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_execution_state_api_executions_id_container_state_get.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_container_execution_state_response import GetContainerExecutionStateResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include_execution_nodes_linked_to_same_container_execution: bool | None | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_include_execution_nodes_linked_to_same_container_execution: bool | None | Unset + if isinstance(include_execution_nodes_linked_to_same_container_execution, Unset): + json_include_execution_nodes_linked_to_same_container_execution = UNSET + else: + json_include_execution_nodes_linked_to_same_container_execution = ( + include_execution_nodes_linked_to_same_container_execution + ) + params["include_execution_nodes_linked_to_same_container_execution"] = ( + json_include_execution_nodes_linked_to_same_container_execution + ) + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/container_state".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetContainerExecutionStateResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetContainerExecutionStateResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetContainerExecutionStateResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_nodes_linked_to_same_container_execution: bool | None | Unset = UNSET, +) -> Response[GetContainerExecutionStateResponse | HTTPValidationError]: + """Get Container Execution State + + Args: + id (str): + include_execution_nodes_linked_to_same_container_execution (bool | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetContainerExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + include_execution_nodes_linked_to_same_container_execution=include_execution_nodes_linked_to_same_container_execution, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_nodes_linked_to_same_container_execution: bool | None | Unset = UNSET, +) -> GetContainerExecutionStateResponse | HTTPValidationError | None: + """Get Container Execution State + + Args: + id (str): + include_execution_nodes_linked_to_same_container_execution (bool | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetContainerExecutionStateResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + include_execution_nodes_linked_to_same_container_execution=include_execution_nodes_linked_to_same_container_execution, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_nodes_linked_to_same_container_execution: bool | None | Unset = UNSET, +) -> Response[GetContainerExecutionStateResponse | HTTPValidationError]: + """Get Container Execution State + + Args: + id (str): + include_execution_nodes_linked_to_same_container_execution (bool | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetContainerExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + include_execution_nodes_linked_to_same_container_execution=include_execution_nodes_linked_to_same_container_execution, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_nodes_linked_to_same_container_execution: bool | None | Unset = UNSET, +) -> GetContainerExecutionStateResponse | HTTPValidationError | None: + """Get Container Execution State + + Args: + id (str): + include_execution_nodes_linked_to_same_container_execution (bool | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetContainerExecutionStateResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include_execution_nodes_linked_to_same_container_execution=include_execution_nodes_linked_to_same_container_execution, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_log_api_executions_id_container_log_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_log_api_executions_id_container_log_get.py new file mode 100644 index 0000000..3a241fc --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_container_log_api_executions_id_container_log_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_container_execution_log_response import GetContainerExecutionLogResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/container_log".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetContainerExecutionLogResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetContainerExecutionLogResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetContainerExecutionLogResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetContainerExecutionLogResponse | HTTPValidationError]: + """Get Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetContainerExecutionLogResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetContainerExecutionLogResponse | HTTPValidationError | None: + """Get Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetContainerExecutionLogResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetContainerExecutionLogResponse | HTTPValidationError]: + """Get Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetContainerExecutionLogResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetContainerExecutionLogResponse | HTTPValidationError | None: + """Get Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetContainerExecutionLogResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_graph_execution_state_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_graph_execution_state_get.py new file mode 100644 index 0000000..a1cf1b5 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_graph_execution_state_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_graph_execution_state_response import GetGraphExecutionStateResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/graph_execution_state".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetGraphExecutionStateResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetGraphExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetGraphExecutionStateResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetGraphExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetGraphExecutionStateResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_state_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_state_get.py new file mode 100644 index 0000000..90a986d --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/get_graph_execution_state_api_executions_id_state_get.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_graph_execution_state_response import GetGraphExecutionStateResponse +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/state".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + if response.status_code == 200: + response_200 = GetGraphExecutionStateResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetGraphExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetGraphExecutionStateResponse | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[GetGraphExecutionStateResponse | HTTPValidationError]: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetGraphExecutionStateResponse | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> GetGraphExecutionStateResponse | HTTPValidationError | None: + """Get Graph Execution State + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetGraphExecutionStateResponse | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/executions/stream_container_log_api_executions_id_stream_container_log_get.py b/tangle_cli/api/_tangle_api_client_lib/api/executions/stream_container_log_api_executions_id_stream_container_log_get.py new file mode 100644 index 0000000..6f7c067 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/executions/stream_container_log_api_executions_id_stream_container_log_get.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/executions/{id}/stream_container_log".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Stream Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Stream Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Stream Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Stream Container Log + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/create_api_pipeline_runs_post.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/create_api_pipeline_runs_post.py new file mode 100644 index 0000000..37d8580 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/create_api_pipeline_runs_post.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_create_api_pipeline_runs_post import BodyCreateApiPipelineRunsPost +from ...models.http_validation_error import HTTPValidationError +from ...models.pipeline_run_response import PipelineRunResponse +from ...types import Response + + +def _get_kwargs( + *, + body: BodyCreateApiPipelineRunsPost, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/pipeline_runs/", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | PipelineRunResponse | None: + if response.status_code == 200: + response_200 = PipelineRunResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | PipelineRunResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: BodyCreateApiPipelineRunsPost, +) -> Response[HTTPValidationError | PipelineRunResponse]: + """Create + + Args: + body (BodyCreateApiPipelineRunsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PipelineRunResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: BodyCreateApiPipelineRunsPost, +) -> HTTPValidationError | PipelineRunResponse | None: + """Create + + Args: + body (BodyCreateApiPipelineRunsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PipelineRunResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: BodyCreateApiPipelineRunsPost, +) -> Response[HTTPValidationError | PipelineRunResponse]: + """Create + + Args: + body (BodyCreateApiPipelineRunsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PipelineRunResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: BodyCreateApiPipelineRunsPost, +) -> HTTPValidationError | PipelineRunResponse | None: + """Create + + Args: + body (BodyCreateApiPipelineRunsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PipelineRunResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/delete_annotation_api_pipeline_runs_id_annotations_key_delete.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/delete_annotation_api_pipeline_runs_id_annotations_key_delete.py new file mode 100644 index 0000000..a21d659 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/delete_annotation_api_pipeline_runs_id_annotations_key_delete.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, + key: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/pipeline_runs/{id}/annotations/{key}".format( + id=quote(str(id), safe=""), + key=quote(str(key), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Annotation + + Args: + id (str): + key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Annotation + + Args: + id (str): + key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + key=key, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Annotation + + Args: + id (str): + key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Annotation + + Args: + id (str): + key (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + key=key, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/get_api_pipeline_runs_id_get.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/get_api_pipeline_runs_id_get.py new file mode 100644 index 0000000..4940431 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/get_api_pipeline_runs_id_get.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.pipeline_run_response import PipelineRunResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + *, + include_execution_stats: bool | Unset = False, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["include_execution_stats"] = include_execution_stats + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/pipeline_runs/{id}".format( + id=quote(str(id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | PipelineRunResponse | None: + if response.status_code == 200: + response_200 = PipelineRunResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | PipelineRunResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_stats: bool | Unset = False, +) -> Response[HTTPValidationError | PipelineRunResponse]: + """Get + + Args: + id (str): + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PipelineRunResponse] + """ + + kwargs = _get_kwargs( + id=id, + include_execution_stats=include_execution_stats, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_stats: bool | Unset = False, +) -> HTTPValidationError | PipelineRunResponse | None: + """Get + + Args: + id (str): + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PipelineRunResponse + """ + + return sync_detailed( + id=id, + client=client, + include_execution_stats=include_execution_stats, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_stats: bool | Unset = False, +) -> Response[HTTPValidationError | PipelineRunResponse]: + """Get + + Args: + id (str): + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | PipelineRunResponse] + """ + + kwargs = _get_kwargs( + id=id, + include_execution_stats=include_execution_stats, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, + include_execution_stats: bool | Unset = False, +) -> HTTPValidationError | PipelineRunResponse | None: + """Get + + Args: + id (str): + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | PipelineRunResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + include_execution_stats=include_execution_stats, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_annotations_api_pipeline_runs_id_annotations_get.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_annotations_api_pipeline_runs_id_annotations_get.py new file mode 100644 index 0000000..3a28982 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_annotations_api_pipeline_runs_id_annotations_get.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get import ( + ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet, +) +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/pipeline_runs/{id}/annotations/".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet + | None +): + if response.status_code == 200: + response_200 = ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet +]: + """List Annotations + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet + | None +): + """List Annotations + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[ + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet +]: + """List Annotations + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> ( + HTTPValidationError + | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet + | None +): + """List Annotations + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_api_pipeline_runs_get.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_api_pipeline_runs_get.py new file mode 100644 index 0000000..ab4b595 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/list_api_pipeline_runs_get.py @@ -0,0 +1,241 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.list_pipeline_jobs_response import ListPipelineJobsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page_token: None | str | Unset = UNSET, + filter_: None | str | Unset = UNSET, + filter_query: None | str | Unset = UNSET, + include_pipeline_names: bool | Unset = False, + include_execution_stats: bool | Unset = False, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_page_token: None | str | Unset + if isinstance(page_token, Unset): + json_page_token = UNSET + else: + json_page_token = page_token + params["page_token"] = json_page_token + + json_filter_: None | str | Unset + if isinstance(filter_, Unset): + json_filter_ = UNSET + else: + json_filter_ = filter_ + params["filter"] = json_filter_ + + json_filter_query: None | str | Unset + if isinstance(filter_query, Unset): + json_filter_query = UNSET + else: + json_filter_query = filter_query + params["filter_query"] = json_filter_query + + params["include_pipeline_names"] = include_pipeline_names + + params["include_execution_stats"] = include_execution_stats + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/pipeline_runs/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | ListPipelineJobsResponse | None: + if response.status_code == 200: + response_200 = ListPipelineJobsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | ListPipelineJobsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + page_token: None | str | Unset = UNSET, + filter_: None | str | Unset = UNSET, + filter_query: None | str | Unset = UNSET, + include_pipeline_names: bool | Unset = False, + include_execution_stats: bool | Unset = False, +) -> Response[HTTPValidationError | ListPipelineJobsResponse]: + """List + + Args: + page_token (None | str | Unset): + filter_ (None | str | Unset): + filter_query (None | str | Unset): + include_pipeline_names (bool | Unset): Default: False. + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListPipelineJobsResponse] + """ + + kwargs = _get_kwargs( + page_token=page_token, + filter_=filter_, + filter_query=filter_query, + include_pipeline_names=include_pipeline_names, + include_execution_stats=include_execution_stats, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + page_token: None | str | Unset = UNSET, + filter_: None | str | Unset = UNSET, + filter_query: None | str | Unset = UNSET, + include_pipeline_names: bool | Unset = False, + include_execution_stats: bool | Unset = False, +) -> HTTPValidationError | ListPipelineJobsResponse | None: + """List + + Args: + page_token (None | str | Unset): + filter_ (None | str | Unset): + filter_query (None | str | Unset): + include_pipeline_names (bool | Unset): Default: False. + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListPipelineJobsResponse + """ + + return sync_detailed( + client=client, + page_token=page_token, + filter_=filter_, + filter_query=filter_query, + include_pipeline_names=include_pipeline_names, + include_execution_stats=include_execution_stats, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + page_token: None | str | Unset = UNSET, + filter_: None | str | Unset = UNSET, + filter_query: None | str | Unset = UNSET, + include_pipeline_names: bool | Unset = False, + include_execution_stats: bool | Unset = False, +) -> Response[HTTPValidationError | ListPipelineJobsResponse]: + """List + + Args: + page_token (None | str | Unset): + filter_ (None | str | Unset): + filter_query (None | str | Unset): + include_pipeline_names (bool | Unset): Default: False. + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | ListPipelineJobsResponse] + """ + + kwargs = _get_kwargs( + page_token=page_token, + filter_=filter_, + filter_query=filter_query, + include_pipeline_names=include_pipeline_names, + include_execution_stats=include_execution_stats, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + page_token: None | str | Unset = UNSET, + filter_: None | str | Unset = UNSET, + filter_query: None | str | Unset = UNSET, + include_pipeline_names: bool | Unset = False, + include_execution_stats: bool | Unset = False, +) -> HTTPValidationError | ListPipelineJobsResponse | None: + """List + + Args: + page_token (None | str | Unset): + filter_ (None | str | Unset): + filter_query (None | str | Unset): + include_pipeline_names (bool | Unset): Default: False. + include_execution_stats (bool | Unset): Default: False. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | ListPipelineJobsResponse + """ + + return ( + await asyncio_detailed( + client=client, + page_token=page_token, + filter_=filter_, + filter_query=filter_query, + include_pipeline_names=include_pipeline_names, + include_execution_stats=include_execution_stats, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/pipeline_run_cancel_api_pipeline_runs_id_cancel_post.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/pipeline_run_cancel_api_pipeline_runs_id_cancel_post.py new file mode 100644 index 0000000..5866050 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/pipeline_run_cancel_api_pipeline_runs_id_cancel_post.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/pipeline_runs/{id}/cancel".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Pipeline Run Cancel + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Pipeline Run Cancel + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Pipeline Run Cancel + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Pipeline Run Cancel + + Args: + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/set_annotation_api_pipeline_runs_id_annotations_key_put.py b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/set_annotation_api_pipeline_runs_id_annotations_key_put.py new file mode 100644 index 0000000..7477359 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/pipeline_runs/set_annotation_api_pipeline_runs_id_annotations_key_put.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + id: str, + key: str, + *, + value: None | str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_value: None | str | Unset + if isinstance(value, Unset): + json_value = UNSET + else: + json_value = value + params["value"] = json_value + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/pipeline_runs/{id}/annotations/{key}".format( + id=quote(str(id), safe=""), + key=quote(str(key), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, + value: None | str | Unset = UNSET, +) -> Response[Any | HTTPValidationError]: + """Set Annotation + + Args: + id (str): + key (str): + value (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + value=value, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, + value: None | str | Unset = UNSET, +) -> Any | HTTPValidationError | None: + """Set Annotation + + Args: + id (str): + key (str): + value (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + id=id, + key=key, + client=client, + value=value, + ).parsed + + +async def asyncio_detailed( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, + value: None | str | Unset = UNSET, +) -> Response[Any | HTTPValidationError]: + """Set Annotation + + Args: + id (str): + key (str): + value (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + id=id, + key=key, + value=value, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + key: str, + *, + client: AuthenticatedClient | Client, + value: None | str | Unset = UNSET, +) -> Any | HTTPValidationError | None: + """Set Annotation + + Args: + id (str): + key (str): + value (None | str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + id=id, + key=key, + client=client, + value=value, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/secrets/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/secrets/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/secrets/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/secrets/create_secret_api_secrets_post.py b/tangle_cli/api/_tangle_api_client_lib/api/secrets/create_secret_api_secrets_post.py new file mode 100644 index 0000000..5d82a18 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/secrets/create_secret_api_secrets_post.py @@ -0,0 +1,229 @@ +import datetime +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_create_secret_api_secrets_post import BodyCreateSecretApiSecretsPost +from ...models.http_validation_error import HTTPValidationError +from ...models.secret_info_response import SecretInfoResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: BodyCreateSecretApiSecretsPost, + secret_name: str, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["secret_name"] = secret_name + + json_description: None | str | Unset + if isinstance(description, Unset): + json_description = UNSET + else: + json_description = description + params["description"] = json_description + + json_expires_at: None | str | Unset + if isinstance(expires_at, Unset): + json_expires_at = UNSET + elif isinstance(expires_at, datetime.datetime): + json_expires_at = expires_at.isoformat() + else: + json_expires_at = expires_at + params["expires_at"] = json_expires_at + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/secrets/", + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | SecretInfoResponse | None: + if response.status_code == 200: + response_200 = SecretInfoResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | SecretInfoResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: BodyCreateSecretApiSecretsPost, + secret_name: str, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> Response[HTTPValidationError | SecretInfoResponse]: + """Create Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyCreateSecretApiSecretsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | SecretInfoResponse] + """ + + kwargs = _get_kwargs( + body=body, + secret_name=secret_name, + description=description, + expires_at=expires_at, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: BodyCreateSecretApiSecretsPost, + secret_name: str, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> HTTPValidationError | SecretInfoResponse | None: + """Create Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyCreateSecretApiSecretsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | SecretInfoResponse + """ + + return sync_detailed( + client=client, + body=body, + secret_name=secret_name, + description=description, + expires_at=expires_at, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: BodyCreateSecretApiSecretsPost, + secret_name: str, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> Response[HTTPValidationError | SecretInfoResponse]: + """Create Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyCreateSecretApiSecretsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | SecretInfoResponse] + """ + + kwargs = _get_kwargs( + body=body, + secret_name=secret_name, + description=description, + expires_at=expires_at, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: BodyCreateSecretApiSecretsPost, + secret_name: str, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> HTTPValidationError | SecretInfoResponse | None: + """Create Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyCreateSecretApiSecretsPost): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | SecretInfoResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + secret_name=secret_name, + description=description, + expires_at=expires_at, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/secrets/delete_secret_api_secrets_secret_name_delete.py b/tangle_cli/api/_tangle_api_client_lib/api/secrets/delete_secret_api_secrets_secret_name_delete.py new file mode 100644 index 0000000..6e96ccc --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/secrets/delete_secret_api_secrets_secret_name_delete.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + secret_name: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/secrets/{secret_name}".format( + secret_name=quote(str(secret_name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + secret_name: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Secret + + Args: + secret_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + secret_name=secret_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + secret_name: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Secret + + Args: + secret_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + secret_name=secret_name, + client=client, + ).parsed + + +async def asyncio_detailed( + secret_name: str, + *, + client: AuthenticatedClient | Client, +) -> Response[Any | HTTPValidationError]: + """Delete Secret + + Args: + secret_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + secret_name=secret_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + secret_name: str, + *, + client: AuthenticatedClient | Client, +) -> Any | HTTPValidationError | None: + """Delete Secret + + Args: + secret_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + secret_name=secret_name, + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/secrets/list_secrets_api_secrets_get.py b/tangle_cli/api/_tangle_api_client_lib/api/secrets/list_secrets_api_secrets_get.py new file mode 100644 index 0000000..54964ef --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/secrets/list_secrets_api_secrets_get.py @@ -0,0 +1,124 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.list_secrets_response import ListSecretsResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/secrets/", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ListSecretsResponse | None: + if response.status_code == 200: + response_200 = ListSecretsResponse.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Response[ListSecretsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListSecretsResponse]: + """List Secrets + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecretsResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> ListSecretsResponse | None: + """List Secrets + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecretsResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[ListSecretsResponse]: + """List Secrets + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ListSecretsResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> ListSecretsResponse | None: + """List Secrets + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ListSecretsResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/secrets/update_secret_api_secrets_secret_name_put.py b/tangle_cli/api/_tangle_api_client_lib/api/secrets/update_secret_api_secrets_secret_name_put.py new file mode 100644 index 0000000..e6534a5 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/secrets/update_secret_api_secrets_secret_name_put.py @@ -0,0 +1,230 @@ +import datetime +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_update_secret_api_secrets_secret_name_put import BodyUpdateSecretApiSecretsSecretNamePut +from ...models.http_validation_error import HTTPValidationError +from ...models.secret_info_response import SecretInfoResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + secret_name: str, + *, + body: BodyUpdateSecretApiSecretsSecretNamePut, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + json_description: None | str | Unset + if isinstance(description, Unset): + json_description = UNSET + else: + json_description = description + params["description"] = json_description + + json_expires_at: None | str | Unset + if isinstance(expires_at, Unset): + json_expires_at = UNSET + elif isinstance(expires_at, datetime.datetime): + json_expires_at = expires_at.isoformat() + else: + json_expires_at = expires_at + params["expires_at"] = json_expires_at + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/api/secrets/{secret_name}".format( + secret_name=quote(str(secret_name), safe=""), + ), + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | SecretInfoResponse | None: + if response.status_code == 200: + response_200 = SecretInfoResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | SecretInfoResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + secret_name: str, + *, + client: AuthenticatedClient | Client, + body: BodyUpdateSecretApiSecretsSecretNamePut, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> Response[HTTPValidationError | SecretInfoResponse]: + """Update Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyUpdateSecretApiSecretsSecretNamePut): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | SecretInfoResponse] + """ + + kwargs = _get_kwargs( + secret_name=secret_name, + body=body, + description=description, + expires_at=expires_at, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + secret_name: str, + *, + client: AuthenticatedClient | Client, + body: BodyUpdateSecretApiSecretsSecretNamePut, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> HTTPValidationError | SecretInfoResponse | None: + """Update Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyUpdateSecretApiSecretsSecretNamePut): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | SecretInfoResponse + """ + + return sync_detailed( + secret_name=secret_name, + client=client, + body=body, + description=description, + expires_at=expires_at, + ).parsed + + +async def asyncio_detailed( + secret_name: str, + *, + client: AuthenticatedClient | Client, + body: BodyUpdateSecretApiSecretsSecretNamePut, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> Response[HTTPValidationError | SecretInfoResponse]: + """Update Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyUpdateSecretApiSecretsSecretNamePut): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | SecretInfoResponse] + """ + + kwargs = _get_kwargs( + secret_name=secret_name, + body=body, + description=description, + expires_at=expires_at, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + secret_name: str, + *, + client: AuthenticatedClient | Client, + body: BodyUpdateSecretApiSecretsSecretNamePut, + description: None | str | Unset = UNSET, + expires_at: datetime.datetime | None | Unset = UNSET, +) -> HTTPValidationError | SecretInfoResponse | None: + """Update Secret + + Args: + secret_name (str): + description (None | str | Unset): + expires_at (datetime.datetime | None | Unset): + body (BodyUpdateSecretApiSecretsSecretNamePut): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | SecretInfoResponse + """ + + return ( + await asyncio_detailed( + secret_name=secret_name, + client=client, + body=body, + description=description, + expires_at=expires_at, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/user_settings/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/user_settings/delete_settings_api_users_me_settings_delete.py b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/delete_settings_api_users_me_settings_delete.py new file mode 100644 index 0000000..9b97eb3 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/delete_settings_api_users_me_settings_delete.py @@ -0,0 +1,166 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...types import UNSET, Response + + +def _get_kwargs( + *, + setting_names: list[str], +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_setting_names = setting_names + + params["setting_names"] = json_setting_names + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/api/users/me/settings", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + setting_names: list[str], +) -> Response[Any | HTTPValidationError]: + """Delete Settings + + Args: + setting_names (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + setting_names=setting_names, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + setting_names: list[str], +) -> Any | HTTPValidationError | None: + """Delete Settings + + Args: + setting_names (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + client=client, + setting_names=setting_names, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + setting_names: list[str], +) -> Response[Any | HTTPValidationError]: + """Delete Settings + + Args: + setting_names (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + setting_names=setting_names, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + setting_names: list[str], +) -> Any | HTTPValidationError | None: + """Delete Settings + + Args: + setting_names (list[str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + setting_names=setting_names, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/user_settings/get_settings_api_users_me_settings_get.py b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/get_settings_api_users_me_settings_get.py new file mode 100644 index 0000000..aae7d8a --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/get_settings_api_users_me_settings_get.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.http_validation_error import HTTPValidationError +from ...models.user_settings_response import UserSettingsResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + setting_names: list[str] | None | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_setting_names: list[str] | None | Unset + if isinstance(setting_names, Unset): + json_setting_names = UNSET + elif isinstance(setting_names, list): + json_setting_names = setting_names + + else: + json_setting_names = setting_names + params["setting_names"] = json_setting_names + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/users/me/settings", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> HTTPValidationError | UserSettingsResponse | None: + if response.status_code == 200: + response_200 = UserSettingsResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[HTTPValidationError | UserSettingsResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + setting_names: list[str] | None | Unset = UNSET, +) -> Response[HTTPValidationError | UserSettingsResponse]: + """Get Settings + + Gets user settings. + + If `setting_names` is specified, returns only those settings. + + Args: + setting_names (list[str] | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | UserSettingsResponse] + """ + + kwargs = _get_kwargs( + setting_names=setting_names, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + setting_names: list[str] | None | Unset = UNSET, +) -> HTTPValidationError | UserSettingsResponse | None: + """Get Settings + + Gets user settings. + + If `setting_names` is specified, returns only those settings. + + Args: + setting_names (list[str] | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | UserSettingsResponse + """ + + return sync_detailed( + client=client, + setting_names=setting_names, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + setting_names: list[str] | None | Unset = UNSET, +) -> Response[HTTPValidationError | UserSettingsResponse]: + """Get Settings + + Gets user settings. + + If `setting_names` is specified, returns only those settings. + + Args: + setting_names (list[str] | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[HTTPValidationError | UserSettingsResponse] + """ + + kwargs = _get_kwargs( + setting_names=setting_names, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + setting_names: list[str] | None | Unset = UNSET, +) -> HTTPValidationError | UserSettingsResponse | None: + """Get Settings + + Gets user settings. + + If `setting_names` is specified, returns only those settings. + + Args: + setting_names (list[str] | None | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + HTTPValidationError | UserSettingsResponse + """ + + return ( + await asyncio_detailed( + client=client, + setting_names=setting_names, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/user_settings/set_settings_api_users_me_settings_patch.py b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/set_settings_api_users_me_settings_patch.py new file mode 100644 index 0000000..9a98561 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/user_settings/set_settings_api_users_me_settings_patch.py @@ -0,0 +1,164 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.body_set_settings_api_users_me_settings_patch import BodySetSettingsApiUsersMeSettingsPatch +from ...models.http_validation_error import HTTPValidationError +from ...types import Response + + +def _get_kwargs( + *, + body: BodySetSettingsApiUsersMeSettingsPatch, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/api/users/me/settings", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | HTTPValidationError | None: + if response.status_code == 200: + response_200 = response.json() + return response_200 + + if response.status_code == 422: + response_422 = HTTPValidationError.from_dict(response.json()) + + return response_422 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | HTTPValidationError]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, + body: BodySetSettingsApiUsersMeSettingsPatch, +) -> Response[Any | HTTPValidationError]: + """Set Settings + + Args: + body (BodySetSettingsApiUsersMeSettingsPatch): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: BodySetSettingsApiUsersMeSettingsPatch, +) -> Any | HTTPValidationError | None: + """Set Settings + + Args: + body (BodySetSettingsApiUsersMeSettingsPatch): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: BodySetSettingsApiUsersMeSettingsPatch, +) -> Response[Any | HTTPValidationError]: + """Set Settings + + Args: + body (BodySetSettingsApiUsersMeSettingsPatch): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | HTTPValidationError] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: BodySetSettingsApiUsersMeSettingsPatch, +) -> Any | HTTPValidationError | None: + """Set Settings + + Args: + body (BodySetSettingsApiUsersMeSettingsPatch): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | HTTPValidationError + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/api/users/__init__.py b/tangle_cli/api/_tangle_api_client_lib/api/users/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/users/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/tangle_cli/api/_tangle_api_client_lib/api/users/get_current_user_api_users_me_get.py b/tangle_cli/api/_tangle_api_client_lib/api/users/get_current_user_api_users_me_get.py new file mode 100644 index 0000000..2a70c80 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/api/users/get_current_user_api_users_me_get.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_user_response import GetUserResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/api/users/me", + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> GetUserResponse | None | None: + if response.status_code == 200: + + def _parse_response_200(data: object) -> GetUserResponse | None: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + response_200_type_0 = GetUserResponse.from_dict(data) + + return response_200_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetUserResponse | None, data) + + response_200 = _parse_response_200(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[GetUserResponse | None]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetUserResponse | None]: + """Get Current User + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetUserResponse | None] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, +) -> GetUserResponse | None | None: + """Get Current User + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetUserResponse | None + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, +) -> Response[GetUserResponse | None]: + """Get Current User + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetUserResponse | None] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, +) -> GetUserResponse | None | None: + """Get Current User + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetUserResponse | None + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/tangle_cli/api/_tangle_api_client_lib/client.py b/tangle_cli/api/_tangle_api_client_lib/client.py new file mode 100644 index 0000000..1b7055a --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/client.py @@ -0,0 +1,268 @@ +import ssl +from typing import Any + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field(default=True, kw_only=True, alias="verify_ssl") + _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/tangle_cli/api/_tangle_api_client_lib/errors.py b/tangle_cli/api/_tangle_api_client_lib/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/tangle_cli/api/_tangle_api_client_lib/models/__init__.py b/tangle_cli/api/_tangle_api_client_lib/models/__init__.py new file mode 100644 index 0000000..c77f159 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/__init__.py @@ -0,0 +1,195 @@ +"""Contains all the data models used in inputs/outputs""" + +from .artifact_data import ArtifactData +from .artifact_data_extra_data_type_0 import ArtifactDataExtraDataType0 +from .artifact_data_response import ArtifactDataResponse +from .artifact_node_id_response import ArtifactNodeIdResponse +from .artifact_node_response import ArtifactNodeResponse +from .artifact_node_response_type_properties_type_0 import ArtifactNodeResponseTypePropertiesType0 +from .body_create_api_pipeline_runs_post import BodyCreateApiPipelineRunsPost +from .body_create_api_pipeline_runs_post_annotations_type_0 import BodyCreateApiPipelineRunsPostAnnotationsType0 +from .body_create_secret_api_secrets_post import BodyCreateSecretApiSecretsPost +from .body_set_settings_api_users_me_settings_patch import BodySetSettingsApiUsersMeSettingsPatch +from .body_set_settings_api_users_me_settings_patch_settings import BodySetSettingsApiUsersMeSettingsPatchSettings +from .body_update_secret_api_secrets_secret_name_put import BodyUpdateSecretApiSecretsSecretNamePut +from .caching_strategy_spec import CachingStrategySpec +from .component_library import ComponentLibrary +from .component_library_annotations_type_0 import ComponentLibraryAnnotationsType0 +from .component_library_folder import ComponentLibraryFolder +from .component_library_folder_annotations_type_0 import ComponentLibraryFolderAnnotationsType0 +from .component_library_response import ComponentLibraryResponse +from .component_library_response_annotations_type_0 import ComponentLibraryResponseAnnotationsType0 +from .component_reference import ComponentReference +from .component_response import ComponentResponse +from .component_spec import ComponentSpec +from .concat_placeholder import ConcatPlaceholder +from .container_execution_status import ContainerExecutionStatus +from .container_implementation import ContainerImplementation +from .container_spec import ContainerSpec +from .container_spec_env_type_0 import ContainerSpecEnvType0 +from .dynamic_data_argument import DynamicDataArgument +from .dynamic_data_argument_dynamic_data_type_1 import DynamicDataArgumentDynamicDataType1 +from .execution_node_reference import ExecutionNodeReference +from .execution_options_spec import ExecutionOptionsSpec +from .execution_status_summary import ExecutionStatusSummary +from .get_artifact_info_response import GetArtifactInfoResponse +from .get_artifact_signed_url_response import GetArtifactSignedUrlResponse +from .get_container_execution_log_response import GetContainerExecutionLogResponse +from .get_container_execution_state_response import GetContainerExecutionStateResponse +from .get_container_execution_state_response_debug_info_type_0 import GetContainerExecutionStateResponseDebugInfoType0 +from .get_execution_artifacts_response import GetExecutionArtifactsResponse +from .get_execution_artifacts_response_input_artifacts_type_0 import GetExecutionArtifactsResponseInputArtifactsType0 +from .get_execution_artifacts_response_output_artifacts_type_0 import GetExecutionArtifactsResponseOutputArtifactsType0 +from .get_execution_info_response import GetExecutionInfoResponse +from .get_execution_info_response_child_task_execution_ids import GetExecutionInfoResponseChildTaskExecutionIds +from .get_execution_info_response_input_artifacts_type_0 import GetExecutionInfoResponseInputArtifactsType0 +from .get_execution_info_response_output_artifacts_type_0 import GetExecutionInfoResponseOutputArtifactsType0 +from .get_graph_execution_state_response import GetGraphExecutionStateResponse +from .get_graph_execution_state_response_child_execution_status_stats import ( + GetGraphExecutionStateResponseChildExecutionStatusStats, +) +from .get_graph_execution_state_response_child_execution_status_stats_additional_property import ( + GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty, +) +from .get_user_response import GetUserResponse +from .graph_implementation import GraphImplementation +from .graph_input_argument import GraphInputArgument +from .graph_input_reference import GraphInputReference +from .graph_input_reference_type_type_1 import GraphInputReferenceTypeType1 +from .graph_spec import GraphSpec +from .graph_spec_output_values_type_0 import GraphSpecOutputValuesType0 +from .graph_spec_tasks import GraphSpecTasks +from .http_validation_error import HTTPValidationError +from .if_placeholder import IfPlaceholder +from .if_placeholder_structure import IfPlaceholderStructure +from .input_path_placeholder import InputPathPlaceholder +from .input_spec import InputSpec +from .input_spec_annotations_type_0 import InputSpecAnnotationsType0 +from .input_spec_type_type_1 import InputSpecTypeType1 +from .input_value_placeholder import InputValuePlaceholder +from .is_present_placeholder import IsPresentPlaceholder +from .list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get import ( + ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet, +) +from .list_component_libraries_response import ListComponentLibrariesResponse +from .list_pipeline_jobs_response import ListPipelineJobsResponse +from .list_published_components_response import ListPublishedComponentsResponse +from .list_secrets_response import ListSecretsResponse +from .metadata_spec import MetadataSpec +from .metadata_spec_annotations_type_0 import MetadataSpecAnnotationsType0 +from .metadata_spec_labels_type_0 import MetadataSpecLabelsType0 +from .output_path_placeholder import OutputPathPlaceholder +from .output_spec import OutputSpec +from .output_spec_annotations_type_0 import OutputSpecAnnotationsType0 +from .output_spec_type_type_1 import OutputSpecTypeType1 +from .pipeline_run_response import PipelineRunResponse +from .pipeline_run_response_annotations_type_0 import PipelineRunResponseAnnotationsType0 +from .pipeline_run_response_execution_status_stats_type_0 import PipelineRunResponseExecutionStatusStatsType0 +from .published_component_response import PublishedComponentResponse +from .retry_strategy_spec import RetryStrategySpec +from .secret_info_response import SecretInfoResponse +from .task_output_argument import TaskOutputArgument +from .task_output_reference import TaskOutputReference +from .task_spec import TaskSpec +from .task_spec_annotations_type_0 import TaskSpecAnnotationsType0 +from .task_spec_arguments_type_0 import TaskSpecArgumentsType0 +from .user_component_library_pins_response import UserComponentLibraryPinsResponse +from .user_settings_response import UserSettingsResponse +from .user_settings_response_settings import UserSettingsResponseSettings +from .validation_error import ValidationError +from .validation_error_context import ValidationErrorContext + +__all__ = ( + "ArtifactData", + "ArtifactDataExtraDataType0", + "ArtifactDataResponse", + "ArtifactNodeIdResponse", + "ArtifactNodeResponse", + "ArtifactNodeResponseTypePropertiesType0", + "BodyCreateApiPipelineRunsPost", + "BodyCreateApiPipelineRunsPostAnnotationsType0", + "BodyCreateSecretApiSecretsPost", + "BodySetSettingsApiUsersMeSettingsPatch", + "BodySetSettingsApiUsersMeSettingsPatchSettings", + "BodyUpdateSecretApiSecretsSecretNamePut", + "CachingStrategySpec", + "ComponentLibrary", + "ComponentLibraryAnnotationsType0", + "ComponentLibraryFolder", + "ComponentLibraryFolderAnnotationsType0", + "ComponentLibraryResponse", + "ComponentLibraryResponseAnnotationsType0", + "ComponentReference", + "ComponentResponse", + "ComponentSpec", + "ConcatPlaceholder", + "ContainerExecutionStatus", + "ContainerImplementation", + "ContainerSpec", + "ContainerSpecEnvType0", + "DynamicDataArgument", + "DynamicDataArgumentDynamicDataType1", + "ExecutionNodeReference", + "ExecutionOptionsSpec", + "ExecutionStatusSummary", + "GetArtifactInfoResponse", + "GetArtifactSignedUrlResponse", + "GetContainerExecutionLogResponse", + "GetContainerExecutionStateResponse", + "GetContainerExecutionStateResponseDebugInfoType0", + "GetExecutionArtifactsResponse", + "GetExecutionArtifactsResponseInputArtifactsType0", + "GetExecutionArtifactsResponseOutputArtifactsType0", + "GetExecutionInfoResponse", + "GetExecutionInfoResponseChildTaskExecutionIds", + "GetExecutionInfoResponseInputArtifactsType0", + "GetExecutionInfoResponseOutputArtifactsType0", + "GetGraphExecutionStateResponse", + "GetGraphExecutionStateResponseChildExecutionStatusStats", + "GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty", + "GetUserResponse", + "GraphImplementation", + "GraphInputArgument", + "GraphInputReference", + "GraphInputReferenceTypeType1", + "GraphSpec", + "GraphSpecOutputValuesType0", + "GraphSpecTasks", + "HTTPValidationError", + "IfPlaceholder", + "IfPlaceholderStructure", + "InputPathPlaceholder", + "InputSpec", + "InputSpecAnnotationsType0", + "InputSpecTypeType1", + "InputValuePlaceholder", + "IsPresentPlaceholder", + "ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet", + "ListComponentLibrariesResponse", + "ListPipelineJobsResponse", + "ListPublishedComponentsResponse", + "ListSecretsResponse", + "MetadataSpec", + "MetadataSpecAnnotationsType0", + "MetadataSpecLabelsType0", + "OutputPathPlaceholder", + "OutputSpec", + "OutputSpecAnnotationsType0", + "OutputSpecTypeType1", + "PipelineRunResponse", + "PipelineRunResponseAnnotationsType0", + "PipelineRunResponseExecutionStatusStatsType0", + "PublishedComponentResponse", + "RetryStrategySpec", + "SecretInfoResponse", + "TaskOutputArgument", + "TaskOutputReference", + "TaskSpec", + "TaskSpecAnnotationsType0", + "TaskSpecArgumentsType0", + "UserComponentLibraryPinsResponse", + "UserSettingsResponse", + "UserSettingsResponseSettings", + "ValidationError", + "ValidationErrorContext", +) diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_data.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data.py new file mode 100644 index 0000000..d543ae8 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data.py @@ -0,0 +1,218 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.artifact_data_extra_data_type_0 import ArtifactDataExtraDataType0 + + +T = TypeVar("T", bound="ArtifactData") + + +@_attrs_define +class ArtifactData: + """ + Attributes: + total_size (int): + is_dir (bool): + hash_ (str): + uri (None | str | Unset): + value (None | str | Unset): + created_at (datetime.datetime | None | Unset): + deleted_at (datetime.datetime | None | Unset): + extra_data (ArtifactDataExtraDataType0 | None | Unset): + """ + + total_size: int + is_dir: bool + hash_: str + uri: None | str | Unset = UNSET + value: None | str | Unset = UNSET + created_at: datetime.datetime | None | Unset = UNSET + deleted_at: datetime.datetime | None | Unset = UNSET + extra_data: ArtifactDataExtraDataType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.artifact_data_extra_data_type_0 import ArtifactDataExtraDataType0 + + total_size = self.total_size + + is_dir = self.is_dir + + hash_ = self.hash_ + + uri: None | str | Unset + if isinstance(self.uri, Unset): + uri = UNSET + else: + uri = self.uri + + value: None | str | Unset + if isinstance(self.value, Unset): + value = UNSET + else: + value = self.value + + created_at: None | str | Unset + if isinstance(self.created_at, Unset): + created_at = UNSET + elif isinstance(self.created_at, datetime.datetime): + created_at = self.created_at.isoformat() + else: + created_at = self.created_at + + deleted_at: None | str | Unset + if isinstance(self.deleted_at, Unset): + deleted_at = UNSET + elif isinstance(self.deleted_at, datetime.datetime): + deleted_at = self.deleted_at.isoformat() + else: + deleted_at = self.deleted_at + + extra_data: dict[str, Any] | None | Unset + if isinstance(self.extra_data, Unset): + extra_data = UNSET + elif isinstance(self.extra_data, ArtifactDataExtraDataType0): + extra_data = self.extra_data.to_dict() + else: + extra_data = self.extra_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "total_size": total_size, + "is_dir": is_dir, + "hash": hash_, + } + ) + if uri is not UNSET: + field_dict["uri"] = uri + if value is not UNSET: + field_dict["value"] = value + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if extra_data is not UNSET: + field_dict["extra_data"] = extra_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_data_extra_data_type_0 import ArtifactDataExtraDataType0 + + d = dict(src_dict) + total_size = d.pop("total_size") + + is_dir = d.pop("is_dir") + + hash_ = d.pop("hash") + + def _parse_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + uri = _parse_uri(d.pop("uri", UNSET)) + + def _parse_value(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + value = _parse_value(d.pop("value", UNSET)) + + def _parse_created_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + created_at_type_0 = datetime.datetime.fromisoformat(data) + + return created_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_deleted_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + deleted_at_type_0 = datetime.datetime.fromisoformat(data) + + return deleted_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) + + def _parse_extra_data(data: object) -> ArtifactDataExtraDataType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + extra_data_type_0 = ArtifactDataExtraDataType0.from_dict(data) + + return extra_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ArtifactDataExtraDataType0 | None | Unset, data) + + extra_data = _parse_extra_data(d.pop("extra_data", UNSET)) + + artifact_data = cls( + total_size=total_size, + is_dir=is_dir, + hash_=hash_, + uri=uri, + value=value, + created_at=created_at, + deleted_at=deleted_at, + extra_data=extra_data, + ) + + artifact_data.additional_properties = d + return artifact_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_extra_data_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_extra_data_type_0.py new file mode 100644 index 0000000..08618e9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_extra_data_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ArtifactDataExtraDataType0") + + +@_attrs_define +class ArtifactDataExtraDataType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + artifact_data_extra_data_type_0 = cls() + + artifact_data_extra_data_type_0.additional_properties = d + return artifact_data_extra_data_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_response.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_response.py new file mode 100644 index 0000000..c8df6f9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_data_response.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ArtifactDataResponse") + + +@_attrs_define +class ArtifactDataResponse: + """ + Attributes: + total_size (int): + is_dir (bool): + uri (None | str | Unset): + value (None | str | Unset): + """ + + total_size: int + is_dir: bool + uri: None | str | Unset = UNSET + value: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + total_size = self.total_size + + is_dir = self.is_dir + + uri: None | str | Unset + if isinstance(self.uri, Unset): + uri = UNSET + else: + uri = self.uri + + value: None | str | Unset + if isinstance(self.value, Unset): + value = UNSET + else: + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "total_size": total_size, + "is_dir": is_dir, + } + ) + if uri is not UNSET: + field_dict["uri"] = uri + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + total_size = d.pop("total_size") + + is_dir = d.pop("is_dir") + + def _parse_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + uri = _parse_uri(d.pop("uri", UNSET)) + + def _parse_value(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + value = _parse_value(d.pop("value", UNSET)) + + artifact_data_response = cls( + total_size=total_size, + is_dir=is_dir, + uri=uri, + value=value, + ) + + artifact_data_response.additional_properties = d + return artifact_data_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_id_response.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_id_response.py new file mode 100644 index 0000000..a30cad4 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_id_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ArtifactNodeIdResponse") + + +@_attrs_define +class ArtifactNodeIdResponse: + """ + Attributes: + id (str): + """ + + id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + artifact_node_id_response = cls( + id=id, + ) + + artifact_node_id_response.additional_properties = d + return artifact_node_id_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response.py new file mode 100644 index 0000000..2f64bb0 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response.py @@ -0,0 +1,194 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.artifact_data_response import ArtifactDataResponse + from ..models.artifact_node_response_type_properties_type_0 import ArtifactNodeResponseTypePropertiesType0 + + +T = TypeVar("T", bound="ArtifactNodeResponse") + + +@_attrs_define +class ArtifactNodeResponse: + """ + Attributes: + id (str): + type_name (None | str | Unset): + type_properties (ArtifactNodeResponseTypePropertiesType0 | None | Unset): + producer_execution_id (None | str | Unset): + producer_output_name (None | str | Unset): + artifact_data (ArtifactDataResponse | None | Unset): + """ + + id: str + type_name: None | str | Unset = UNSET + type_properties: ArtifactNodeResponseTypePropertiesType0 | None | Unset = UNSET + producer_execution_id: None | str | Unset = UNSET + producer_output_name: None | str | Unset = UNSET + artifact_data: ArtifactDataResponse | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.artifact_data_response import ArtifactDataResponse + from ..models.artifact_node_response_type_properties_type_0 import ArtifactNodeResponseTypePropertiesType0 + + id = self.id + + type_name: None | str | Unset + if isinstance(self.type_name, Unset): + type_name = UNSET + else: + type_name = self.type_name + + type_properties: dict[str, Any] | None | Unset + if isinstance(self.type_properties, Unset): + type_properties = UNSET + elif isinstance(self.type_properties, ArtifactNodeResponseTypePropertiesType0): + type_properties = self.type_properties.to_dict() + else: + type_properties = self.type_properties + + producer_execution_id: None | str | Unset + if isinstance(self.producer_execution_id, Unset): + producer_execution_id = UNSET + else: + producer_execution_id = self.producer_execution_id + + producer_output_name: None | str | Unset + if isinstance(self.producer_output_name, Unset): + producer_output_name = UNSET + else: + producer_output_name = self.producer_output_name + + artifact_data: dict[str, Any] | None | Unset + if isinstance(self.artifact_data, Unset): + artifact_data = UNSET + elif isinstance(self.artifact_data, ArtifactDataResponse): + artifact_data = self.artifact_data.to_dict() + else: + artifact_data = self.artifact_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if type_name is not UNSET: + field_dict["type_name"] = type_name + if type_properties is not UNSET: + field_dict["type_properties"] = type_properties + if producer_execution_id is not UNSET: + field_dict["producer_execution_id"] = producer_execution_id + if producer_output_name is not UNSET: + field_dict["producer_output_name"] = producer_output_name + if artifact_data is not UNSET: + field_dict["artifact_data"] = artifact_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_data_response import ArtifactDataResponse + from ..models.artifact_node_response_type_properties_type_0 import ArtifactNodeResponseTypePropertiesType0 + + d = dict(src_dict) + id = d.pop("id") + + def _parse_type_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + type_name = _parse_type_name(d.pop("type_name", UNSET)) + + def _parse_type_properties(data: object) -> ArtifactNodeResponseTypePropertiesType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + type_properties_type_0 = ArtifactNodeResponseTypePropertiesType0.from_dict(data) + + return type_properties_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ArtifactNodeResponseTypePropertiesType0 | None | Unset, data) + + type_properties = _parse_type_properties(d.pop("type_properties", UNSET)) + + def _parse_producer_execution_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + producer_execution_id = _parse_producer_execution_id(d.pop("producer_execution_id", UNSET)) + + def _parse_producer_output_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + producer_output_name = _parse_producer_output_name(d.pop("producer_output_name", UNSET)) + + def _parse_artifact_data(data: object) -> ArtifactDataResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + artifact_data_type_0 = ArtifactDataResponse.from_dict(data) + + return artifact_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ArtifactDataResponse | None | Unset, data) + + artifact_data = _parse_artifact_data(d.pop("artifact_data", UNSET)) + + artifact_node_response = cls( + id=id, + type_name=type_name, + type_properties=type_properties, + producer_execution_id=producer_execution_id, + producer_output_name=producer_output_name, + artifact_data=artifact_data, + ) + + artifact_node_response.additional_properties = d + return artifact_node_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response_type_properties_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response_type_properties_type_0.py new file mode 100644 index 0000000..a24d363 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/artifact_node_response_type_properties_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ArtifactNodeResponseTypePropertiesType0") + + +@_attrs_define +class ArtifactNodeResponseTypePropertiesType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + artifact_node_response_type_properties_type_0 = cls() + + artifact_node_response_type_properties_type_0.additional_properties = d + return artifact_node_response_type_properties_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post.py b/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post.py new file mode 100644 index 0000000..2e08560 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.body_create_api_pipeline_runs_post_annotations_type_0 import ( + BodyCreateApiPipelineRunsPostAnnotationsType0, + ) + from ..models.component_reference import ComponentReference + from ..models.task_spec import TaskSpec + + +T = TypeVar("T", bound="BodyCreateApiPipelineRunsPost") + + +@_attrs_define +class BodyCreateApiPipelineRunsPost: + """ + Attributes: + root_task (TaskSpec): + components (list[ComponentReference] | None | Unset): + annotations (BodyCreateApiPipelineRunsPostAnnotationsType0 | None | Unset): + """ + + root_task: TaskSpec + components: list[ComponentReference] | None | Unset = UNSET + annotations: BodyCreateApiPipelineRunsPostAnnotationsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.body_create_api_pipeline_runs_post_annotations_type_0 import ( + BodyCreateApiPipelineRunsPostAnnotationsType0, + ) + + root_task = self.root_task.to_dict() + + components: list[dict[str, Any]] | None | Unset + if isinstance(self.components, Unset): + components = UNSET + elif isinstance(self.components, list): + components = [] + for components_type_0_item_data in self.components: + components_type_0_item = components_type_0_item_data.to_dict() + components.append(components_type_0_item) + + else: + components = self.components + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, BodyCreateApiPipelineRunsPostAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "root_task": root_task, + } + ) + if components is not UNSET: + field_dict["components"] = components + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.body_create_api_pipeline_runs_post_annotations_type_0 import ( + BodyCreateApiPipelineRunsPostAnnotationsType0, + ) + from ..models.component_reference import ComponentReference + from ..models.task_spec import TaskSpec + + d = dict(src_dict) + root_task = TaskSpec.from_dict(d.pop("root_task")) + + def _parse_components(data: object) -> list[ComponentReference] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + components_type_0 = [] + _components_type_0 = data + for components_type_0_item_data in _components_type_0: + components_type_0_item = ComponentReference.from_dict(components_type_0_item_data) + + components_type_0.append(components_type_0_item) + + return components_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[ComponentReference] | None | Unset, data) + + components = _parse_components(d.pop("components", UNSET)) + + def _parse_annotations(data: object) -> BodyCreateApiPipelineRunsPostAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = BodyCreateApiPipelineRunsPostAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(BodyCreateApiPipelineRunsPostAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + body_create_api_pipeline_runs_post = cls( + root_task=root_task, + components=components, + annotations=annotations, + ) + + body_create_api_pipeline_runs_post.additional_properties = d + return body_create_api_pipeline_runs_post + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post_annotations_type_0.py new file mode 100644 index 0000000..9f32f9d --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_create_api_pipeline_runs_post_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="BodyCreateApiPipelineRunsPostAnnotationsType0") + + +@_attrs_define +class BodyCreateApiPipelineRunsPostAnnotationsType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + body_create_api_pipeline_runs_post_annotations_type_0 = cls() + + body_create_api_pipeline_runs_post_annotations_type_0.additional_properties = d + return body_create_api_pipeline_runs_post_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_create_secret_api_secrets_post.py b/tangle_cli/api/_tangle_api_client_lib/models/body_create_secret_api_secrets_post.py new file mode 100644 index 0000000..0f57b85 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_create_secret_api_secrets_post.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="BodyCreateSecretApiSecretsPost") + + +@_attrs_define +class BodyCreateSecretApiSecretsPost: + """ + Attributes: + secret_value (str): + """ + + secret_value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + secret_value = self.secret_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "secret_value": secret_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + secret_value = d.pop("secret_value") + + body_create_secret_api_secrets_post = cls( + secret_value=secret_value, + ) + + body_create_secret_api_secrets_post.additional_properties = d + return body_create_secret_api_secrets_post + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch.py b/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch.py new file mode 100644 index 0000000..686b377 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.body_set_settings_api_users_me_settings_patch_settings import ( + BodySetSettingsApiUsersMeSettingsPatchSettings, + ) + + +T = TypeVar("T", bound="BodySetSettingsApiUsersMeSettingsPatch") + + +@_attrs_define +class BodySetSettingsApiUsersMeSettingsPatch: + """ + Attributes: + settings (BodySetSettingsApiUsersMeSettingsPatchSettings): + """ + + settings: BodySetSettingsApiUsersMeSettingsPatchSettings + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + settings = self.settings.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "settings": settings, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.body_set_settings_api_users_me_settings_patch_settings import ( + BodySetSettingsApiUsersMeSettingsPatchSettings, + ) + + d = dict(src_dict) + settings = BodySetSettingsApiUsersMeSettingsPatchSettings.from_dict(d.pop("settings")) + + body_set_settings_api_users_me_settings_patch = cls( + settings=settings, + ) + + body_set_settings_api_users_me_settings_patch.additional_properties = d + return body_set_settings_api_users_me_settings_patch + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch_settings.py b/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch_settings.py new file mode 100644 index 0000000..a04127c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_set_settings_api_users_me_settings_patch_settings.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="BodySetSettingsApiUsersMeSettingsPatchSettings") + + +@_attrs_define +class BodySetSettingsApiUsersMeSettingsPatchSettings: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + body_set_settings_api_users_me_settings_patch_settings = cls() + + body_set_settings_api_users_me_settings_patch_settings.additional_properties = d + return body_set_settings_api_users_me_settings_patch_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/body_update_secret_api_secrets_secret_name_put.py b/tangle_cli/api/_tangle_api_client_lib/models/body_update_secret_api_secrets_secret_name_put.py new file mode 100644 index 0000000..b38be8e --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/body_update_secret_api_secrets_secret_name_put.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="BodyUpdateSecretApiSecretsSecretNamePut") + + +@_attrs_define +class BodyUpdateSecretApiSecretsSecretNamePut: + """ + Attributes: + secret_value (str): + """ + + secret_value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + secret_value = self.secret_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "secret_value": secret_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + secret_value = d.pop("secret_value") + + body_update_secret_api_secrets_secret_name_put = cls( + secret_value=secret_value, + ) + + body_update_secret_api_secrets_secret_name_put.additional_properties = d + return body_update_secret_api_secrets_secret_name_put + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/caching_strategy_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/caching_strategy_spec.py new file mode 100644 index 0000000..066f4a1 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/caching_strategy_spec.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CachingStrategySpec") + + +@_attrs_define +class CachingStrategySpec: + """ + Attributes: + max_cache_staleness (None | str | Unset): + """ + + max_cache_staleness: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + max_cache_staleness: None | str | Unset + if isinstance(self.max_cache_staleness, Unset): + max_cache_staleness = UNSET + else: + max_cache_staleness = self.max_cache_staleness + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if max_cache_staleness is not UNSET: + field_dict["maxCacheStaleness"] = max_cache_staleness + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_max_cache_staleness(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + max_cache_staleness = _parse_max_cache_staleness(d.pop("maxCacheStaleness", UNSET)) + + caching_strategy_spec = cls( + max_cache_staleness=max_cache_staleness, + ) + + caching_strategy_spec.additional_properties = d + return caching_strategy_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library.py new file mode 100644 index 0000000..00797d7 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_library_annotations_type_0 import ComponentLibraryAnnotationsType0 + from ..models.component_library_folder import ComponentLibraryFolder + + +T = TypeVar("T", bound="ComponentLibrary") + + +@_attrs_define +class ComponentLibrary: + """ + Attributes: + name (str): + root_folder (ComponentLibraryFolder): + annotations (ComponentLibraryAnnotationsType0 | None | Unset): + """ + + name: str + root_folder: ComponentLibraryFolder + annotations: ComponentLibraryAnnotationsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.component_library_annotations_type_0 import ComponentLibraryAnnotationsType0 + + name = self.name + + root_folder = self.root_folder.to_dict() + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, ComponentLibraryAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "root_folder": root_folder, + } + ) + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_library_annotations_type_0 import ComponentLibraryAnnotationsType0 + from ..models.component_library_folder import ComponentLibraryFolder + + d = dict(src_dict) + name = d.pop("name") + + root_folder = ComponentLibraryFolder.from_dict(d.pop("root_folder")) + + def _parse_annotations(data: object) -> ComponentLibraryAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = ComponentLibraryAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ComponentLibraryAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + component_library = cls( + name=name, + root_folder=root_folder, + annotations=annotations, + ) + + component_library.additional_properties = d + return component_library + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library_annotations_type_0.py new file mode 100644 index 0000000..0d1cf61 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ComponentLibraryAnnotationsType0") + + +@_attrs_define +class ComponentLibraryAnnotationsType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + component_library_annotations_type_0 = cls() + + component_library_annotations_type_0.additional_properties = d + return component_library_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder.py new file mode 100644 index 0000000..9c10875 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_library_folder_annotations_type_0 import ComponentLibraryFolderAnnotationsType0 + from ..models.component_reference import ComponentReference + + +T = TypeVar("T", bound="ComponentLibraryFolder") + + +@_attrs_define +class ComponentLibraryFolder: + """ + Attributes: + name (str): + folders (list[ComponentLibraryFolder] | None | Unset): + components (list[ComponentReference] | None | Unset): + annotations (ComponentLibraryFolderAnnotationsType0 | None | Unset): + """ + + name: str + folders: list[ComponentLibraryFolder] | None | Unset = UNSET + components: list[ComponentReference] | None | Unset = UNSET + annotations: ComponentLibraryFolderAnnotationsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.component_library_folder_annotations_type_0 import ComponentLibraryFolderAnnotationsType0 + + name = self.name + + folders: list[dict[str, Any]] | None | Unset + if isinstance(self.folders, Unset): + folders = UNSET + elif isinstance(self.folders, list): + folders = [] + for folders_type_0_item_data in self.folders: + folders_type_0_item = folders_type_0_item_data.to_dict() + folders.append(folders_type_0_item) + + else: + folders = self.folders + + components: list[dict[str, Any]] | None | Unset + if isinstance(self.components, Unset): + components = UNSET + elif isinstance(self.components, list): + components = [] + for components_type_0_item_data in self.components: + components_type_0_item = components_type_0_item_data.to_dict() + components.append(components_type_0_item) + + else: + components = self.components + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, ComponentLibraryFolderAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if folders is not UNSET: + field_dict["folders"] = folders + if components is not UNSET: + field_dict["components"] = components + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_library_folder_annotations_type_0 import ComponentLibraryFolderAnnotationsType0 + from ..models.component_reference import ComponentReference + + d = dict(src_dict) + name = d.pop("name") + + def _parse_folders(data: object) -> list[ComponentLibraryFolder] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + folders_type_0 = [] + _folders_type_0 = data + for folders_type_0_item_data in _folders_type_0: + folders_type_0_item = ComponentLibraryFolder.from_dict(folders_type_0_item_data) + + folders_type_0.append(folders_type_0_item) + + return folders_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[ComponentLibraryFolder] | None | Unset, data) + + folders = _parse_folders(d.pop("folders", UNSET)) + + def _parse_components(data: object) -> list[ComponentReference] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + components_type_0 = [] + _components_type_0 = data + for components_type_0_item_data in _components_type_0: + components_type_0_item = ComponentReference.from_dict(components_type_0_item_data) + + components_type_0.append(components_type_0_item) + + return components_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[ComponentReference] | None | Unset, data) + + components = _parse_components(d.pop("components", UNSET)) + + def _parse_annotations(data: object) -> ComponentLibraryFolderAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = ComponentLibraryFolderAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ComponentLibraryFolderAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + component_library_folder = cls( + name=name, + folders=folders, + components=components, + annotations=annotations, + ) + + component_library_folder.additional_properties = d + return component_library_folder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder_annotations_type_0.py new file mode 100644 index 0000000..e6ddec0 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library_folder_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ComponentLibraryFolderAnnotationsType0") + + +@_attrs_define +class ComponentLibraryFolderAnnotationsType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + component_library_folder_annotations_type_0 = cls() + + component_library_folder_annotations_type_0.additional_properties = d + return component_library_folder_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library_response.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library_response.py new file mode 100644 index 0000000..4b35e24 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library_response.py @@ -0,0 +1,197 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_library_folder import ComponentLibraryFolder + from ..models.component_library_response_annotations_type_0 import ComponentLibraryResponseAnnotationsType0 + + +T = TypeVar("T", bound="ComponentLibraryResponse") + + +@_attrs_define +class ComponentLibraryResponse: + """ + Attributes: + id (str): + name (str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + root_folder (ComponentLibraryFolder | None | Unset): + published_by (None | str | Unset): + hide_from_search (bool | Unset): Default: False. + annotations (ComponentLibraryResponseAnnotationsType0 | None | Unset): + component_count (int | Unset): Default: 0. + """ + + id: str + name: str + created_at: datetime.datetime + updated_at: datetime.datetime + root_folder: ComponentLibraryFolder | None | Unset = UNSET + published_by: None | str | Unset = UNSET + hide_from_search: bool | Unset = False + annotations: ComponentLibraryResponseAnnotationsType0 | None | Unset = UNSET + component_count: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.component_library_folder import ComponentLibraryFolder + from ..models.component_library_response_annotations_type_0 import ComponentLibraryResponseAnnotationsType0 + + id = self.id + + name = self.name + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + root_folder: dict[str, Any] | None | Unset + if isinstance(self.root_folder, Unset): + root_folder = UNSET + elif isinstance(self.root_folder, ComponentLibraryFolder): + root_folder = self.root_folder.to_dict() + else: + root_folder = self.root_folder + + published_by: None | str | Unset + if isinstance(self.published_by, Unset): + published_by = UNSET + else: + published_by = self.published_by + + hide_from_search = self.hide_from_search + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, ComponentLibraryResponseAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + component_count = self.component_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if root_folder is not UNSET: + field_dict["root_folder"] = root_folder + if published_by is not UNSET: + field_dict["published_by"] = published_by + if hide_from_search is not UNSET: + field_dict["hide_from_search"] = hide_from_search + if annotations is not UNSET: + field_dict["annotations"] = annotations + if component_count is not UNSET: + field_dict["component_count"] = component_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_library_folder import ComponentLibraryFolder + from ..models.component_library_response_annotations_type_0 import ComponentLibraryResponseAnnotationsType0 + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + def _parse_root_folder(data: object) -> ComponentLibraryFolder | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + root_folder_type_0 = ComponentLibraryFolder.from_dict(data) + + return root_folder_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ComponentLibraryFolder | None | Unset, data) + + root_folder = _parse_root_folder(d.pop("root_folder", UNSET)) + + def _parse_published_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + published_by = _parse_published_by(d.pop("published_by", UNSET)) + + hide_from_search = d.pop("hide_from_search", UNSET) + + def _parse_annotations(data: object) -> ComponentLibraryResponseAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = ComponentLibraryResponseAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ComponentLibraryResponseAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + component_count = d.pop("component_count", UNSET) + + component_library_response = cls( + id=id, + name=name, + created_at=created_at, + updated_at=updated_at, + root_folder=root_folder, + published_by=published_by, + hide_from_search=hide_from_search, + annotations=annotations, + component_count=component_count, + ) + + component_library_response.additional_properties = d + return component_library_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_library_response_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/component_library_response_annotations_type_0.py new file mode 100644 index 0000000..d89e949 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_library_response_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ComponentLibraryResponseAnnotationsType0") + + +@_attrs_define +class ComponentLibraryResponseAnnotationsType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + component_library_response_annotations_type_0 = cls() + + component_library_response_annotations_type_0.additional_properties = d + return component_library_response_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_reference.py b/tangle_cli/api/_tangle_api_client_lib/models/component_reference.py new file mode 100644 index 0000000..b411c23 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_reference.py @@ -0,0 +1,191 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_spec import ComponentSpec + + +T = TypeVar("T", bound="ComponentReference") + + +@_attrs_define +class ComponentReference: + """ + Attributes: + name (None | str | Unset): + digest (None | str | Unset): + tag (None | str | Unset): + url (None | str | Unset): + spec (ComponentSpec | None | Unset): + text (None | str | Unset): + """ + + name: None | str | Unset = UNSET + digest: None | str | Unset = UNSET + tag: None | str | Unset = UNSET + url: None | str | Unset = UNSET + spec: ComponentSpec | None | Unset = UNSET + text: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.component_spec import ComponentSpec + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + digest: None | str | Unset + if isinstance(self.digest, Unset): + digest = UNSET + else: + digest = self.digest + + tag: None | str | Unset + if isinstance(self.tag, Unset): + tag = UNSET + else: + tag = self.tag + + url: None | str | Unset + if isinstance(self.url, Unset): + url = UNSET + else: + url = self.url + + spec: dict[str, Any] | None | Unset + if isinstance(self.spec, Unset): + spec = UNSET + elif isinstance(self.spec, ComponentSpec): + spec = self.spec.to_dict() + else: + spec = self.spec + + text: None | str | Unset + if isinstance(self.text, Unset): + text = UNSET + else: + text = self.text + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if digest is not UNSET: + field_dict["digest"] = digest + if tag is not UNSET: + field_dict["tag"] = tag + if url is not UNSET: + field_dict["url"] = url + if spec is not UNSET: + field_dict["spec"] = spec + if text is not UNSET: + field_dict["text"] = text + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_spec import ComponentSpec + + d = dict(src_dict) + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_digest(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + digest = _parse_digest(d.pop("digest", UNSET)) + + def _parse_tag(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + tag = _parse_tag(d.pop("tag", UNSET)) + + def _parse_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + url = _parse_url(d.pop("url", UNSET)) + + def _parse_spec(data: object) -> ComponentSpec | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + spec_type_0 = ComponentSpec.from_dict(data) + + return spec_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ComponentSpec | None | Unset, data) + + spec = _parse_spec(d.pop("spec", UNSET)) + + def _parse_text(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + text = _parse_text(d.pop("text", UNSET)) + + component_reference = cls( + name=name, + digest=digest, + tag=tag, + url=url, + spec=spec, + text=text, + ) + + component_reference.additional_properties = d + return component_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_response.py b/tangle_cli/api/_tangle_api_client_lib/models/component_response.py new file mode 100644 index 0000000..dca3154 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_response.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ComponentResponse") + + +@_attrs_define +class ComponentResponse: + """ + Attributes: + digest (str): + text (str): + """ + + digest: str + text: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + digest = self.digest + + text = self.text + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "digest": digest, + "text": text, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + digest = d.pop("digest") + + text = d.pop("text") + + component_response = cls( + digest=digest, + text=text, + ) + + component_response.additional_properties = d + return component_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/component_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/component_spec.py new file mode 100644 index 0000000..c936f77 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/component_spec.py @@ -0,0 +1,259 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.container_implementation import ContainerImplementation + from ..models.graph_implementation import GraphImplementation + from ..models.input_spec import InputSpec + from ..models.metadata_spec import MetadataSpec + from ..models.output_spec import OutputSpec + + +T = TypeVar("T", bound="ComponentSpec") + + +@_attrs_define +class ComponentSpec: + """ + Attributes: + name (None | str | Unset): + description (None | str | Unset): + metadata (MetadataSpec | None | Unset): + inputs (list[InputSpec] | None | Unset): + outputs (list[OutputSpec] | None | Unset): + implementation (ContainerImplementation | GraphImplementation | None | Unset): + """ + + name: None | str | Unset = UNSET + description: None | str | Unset = UNSET + metadata: MetadataSpec | None | Unset = UNSET + inputs: list[InputSpec] | None | Unset = UNSET + outputs: list[OutputSpec] | None | Unset = UNSET + implementation: ContainerImplementation | GraphImplementation | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.container_implementation import ContainerImplementation + from ..models.graph_implementation import GraphImplementation + from ..models.metadata_spec import MetadataSpec + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + metadata: dict[str, Any] | None | Unset + if isinstance(self.metadata, Unset): + metadata = UNSET + elif isinstance(self.metadata, MetadataSpec): + metadata = self.metadata.to_dict() + else: + metadata = self.metadata + + inputs: list[dict[str, Any]] | None | Unset + if isinstance(self.inputs, Unset): + inputs = UNSET + elif isinstance(self.inputs, list): + inputs = [] + for inputs_type_0_item_data in self.inputs: + inputs_type_0_item = inputs_type_0_item_data.to_dict() + inputs.append(inputs_type_0_item) + + else: + inputs = self.inputs + + outputs: list[dict[str, Any]] | None | Unset + if isinstance(self.outputs, Unset): + outputs = UNSET + elif isinstance(self.outputs, list): + outputs = [] + for outputs_type_0_item_data in self.outputs: + outputs_type_0_item = outputs_type_0_item_data.to_dict() + outputs.append(outputs_type_0_item) + + else: + outputs = self.outputs + + implementation: dict[str, Any] | None | Unset + if isinstance(self.implementation, Unset): + implementation = UNSET + elif isinstance(self.implementation, ContainerImplementation): + implementation = self.implementation.to_dict() + elif isinstance(self.implementation, GraphImplementation): + implementation = self.implementation.to_dict() + else: + implementation = self.implementation + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if metadata is not UNSET: + field_dict["metadata"] = metadata + if inputs is not UNSET: + field_dict["inputs"] = inputs + if outputs is not UNSET: + field_dict["outputs"] = outputs + if implementation is not UNSET: + field_dict["implementation"] = implementation + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.container_implementation import ContainerImplementation + from ..models.graph_implementation import GraphImplementation + from ..models.input_spec import InputSpec + from ..models.metadata_spec import MetadataSpec + from ..models.output_spec import OutputSpec + + d = dict(src_dict) + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_metadata(data: object) -> MetadataSpec | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + metadata_type_0 = MetadataSpec.from_dict(data) + + return metadata_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MetadataSpec | None | Unset, data) + + metadata = _parse_metadata(d.pop("metadata", UNSET)) + + def _parse_inputs(data: object) -> list[InputSpec] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + inputs_type_0 = [] + _inputs_type_0 = data + for inputs_type_0_item_data in _inputs_type_0: + inputs_type_0_item = InputSpec.from_dict(inputs_type_0_item_data) + + inputs_type_0.append(inputs_type_0_item) + + return inputs_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[InputSpec] | None | Unset, data) + + inputs = _parse_inputs(d.pop("inputs", UNSET)) + + def _parse_outputs(data: object) -> list[OutputSpec] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + outputs_type_0 = [] + _outputs_type_0 = data + for outputs_type_0_item_data in _outputs_type_0: + outputs_type_0_item = OutputSpec.from_dict(outputs_type_0_item_data) + + outputs_type_0.append(outputs_type_0_item) + + return outputs_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[OutputSpec] | None | Unset, data) + + outputs = _parse_outputs(d.pop("outputs", UNSET)) + + def _parse_implementation(data: object) -> ContainerImplementation | GraphImplementation | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + implementation_type_0 = ContainerImplementation.from_dict(data) + + return implementation_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + implementation_type_1 = GraphImplementation.from_dict(data) + + return implementation_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ContainerImplementation | GraphImplementation | None | Unset, data) + + implementation = _parse_implementation(d.pop("implementation", UNSET)) + + component_spec = cls( + name=name, + description=description, + metadata=metadata, + inputs=inputs, + outputs=outputs, + implementation=implementation, + ) + + component_spec.additional_properties = d + return component_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/concat_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/concat_placeholder.py new file mode 100644 index 0000000..d67cb97 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/concat_placeholder.py @@ -0,0 +1,162 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + +T = TypeVar("T", bound="ConcatPlaceholder") + + +@_attrs_define +class ConcatPlaceholder: + """ + Attributes: + concat (list[ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | + OutputPathPlaceholder | str]): + """ + + concat: list[ + ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | OutputPathPlaceholder | str + ] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + concat = [] + for concat_item_data in self.concat: + concat_item: dict[str, Any] | str + if isinstance(concat_item_data, InputValuePlaceholder): + concat_item = concat_item_data.to_dict() + elif isinstance(concat_item_data, InputPathPlaceholder): + concat_item = concat_item_data.to_dict() + elif isinstance(concat_item_data, OutputPathPlaceholder): + concat_item = concat_item_data.to_dict() + elif isinstance(concat_item_data, ConcatPlaceholder): + concat_item = concat_item_data.to_dict() + elif isinstance(concat_item_data, IfPlaceholder): + concat_item = concat_item_data.to_dict() + else: + concat_item = concat_item_data + concat.append(concat_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "concat": concat, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + d = dict(src_dict) + concat = [] + _concat = d.pop("concat") + for concat_item_data in _concat: + + def _parse_concat_item( + data: object, + ) -> ( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ): + try: + if not isinstance(data, dict): + raise TypeError() + concat_item_type_1 = InputValuePlaceholder.from_dict(data) + + return concat_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + concat_item_type_2 = InputPathPlaceholder.from_dict(data) + + return concat_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + concat_item_type_3 = OutputPathPlaceholder.from_dict(data) + + return concat_item_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + concat_item_type_4 = ConcatPlaceholder.from_dict(data) + + return concat_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + concat_item_type_5 = IfPlaceholder.from_dict(data) + + return concat_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str, + data, + ) + + concat_item = _parse_concat_item(concat_item_data) + + concat.append(concat_item) + + concat_placeholder = cls( + concat=concat, + ) + + concat_placeholder.additional_properties = d + return concat_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/container_execution_status.py b/tangle_cli/api/_tangle_api_client_lib/models/container_execution_status.py new file mode 100644 index 0000000..5db4c11 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/container_execution_status.py @@ -0,0 +1,19 @@ +from enum import Enum + + +class ContainerExecutionStatus(str, Enum): + CANCELLED = "CANCELLED" + CANCELLING = "CANCELLING" + FAILED = "FAILED" + INVALID = "INVALID" + PENDING = "PENDING" + QUEUED = "QUEUED" + RUNNING = "RUNNING" + SKIPPED = "SKIPPED" + SUCCEEDED = "SUCCEEDED" + SYSTEM_ERROR = "SYSTEM_ERROR" + UNINITIALIZED = "UNINITIALIZED" + WAITING_FOR_UPSTREAM = "WAITING_FOR_UPSTREAM" + + def __str__(self) -> str: + return str(self.value) diff --git a/tangle_cli/api/_tangle_api_client_lib/models/container_implementation.py b/tangle_cli/api/_tangle_api_client_lib/models/container_implementation.py new file mode 100644 index 0000000..e3960dd --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/container_implementation.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.container_spec import ContainerSpec + + +T = TypeVar("T", bound="ContainerImplementation") + + +@_attrs_define +class ContainerImplementation: + """ + Attributes: + container (ContainerSpec): + """ + + container: ContainerSpec + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + container = self.container.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "container": container, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.container_spec import ContainerSpec + + d = dict(src_dict) + container = ContainerSpec.from_dict(d.pop("container")) + + container_implementation = cls( + container=container, + ) + + container_implementation.additional_properties = d + return container_implementation + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/container_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/container_spec.py new file mode 100644 index 0000000..ee469da --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/container_spec.py @@ -0,0 +1,414 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.container_spec_env_type_0 import ContainerSpecEnvType0 + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + +T = TypeVar("T", bound="ContainerSpec") + + +@_attrs_define +class ContainerSpec: + """ + Attributes: + image (str): + command (list[ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | + OutputPathPlaceholder | str] | None | Unset): + args (list[ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | + OutputPathPlaceholder | str] | None | Unset): + env (ContainerSpecEnvType0 | None | Unset): + """ + + image: str + command: ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ) = UNSET + args: ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ) = UNSET + env: ContainerSpecEnvType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.container_spec_env_type_0 import ContainerSpecEnvType0 + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + image = self.image + + command: list[dict[str, Any] | str] | None | Unset + if isinstance(self.command, Unset): + command = UNSET + elif isinstance(self.command, list): + command = [] + for command_type_0_item_data in self.command: + command_type_0_item: dict[str, Any] | str + if isinstance(command_type_0_item_data, InputValuePlaceholder): + command_type_0_item = command_type_0_item_data.to_dict() + elif isinstance(command_type_0_item_data, InputPathPlaceholder): + command_type_0_item = command_type_0_item_data.to_dict() + elif isinstance(command_type_0_item_data, OutputPathPlaceholder): + command_type_0_item = command_type_0_item_data.to_dict() + elif isinstance(command_type_0_item_data, ConcatPlaceholder): + command_type_0_item = command_type_0_item_data.to_dict() + elif isinstance(command_type_0_item_data, IfPlaceholder): + command_type_0_item = command_type_0_item_data.to_dict() + else: + command_type_0_item = command_type_0_item_data + command.append(command_type_0_item) + + else: + command = self.command + + args: list[dict[str, Any] | str] | None | Unset + if isinstance(self.args, Unset): + args = UNSET + elif isinstance(self.args, list): + args = [] + for args_type_0_item_data in self.args: + args_type_0_item: dict[str, Any] | str + if isinstance(args_type_0_item_data, InputValuePlaceholder): + args_type_0_item = args_type_0_item_data.to_dict() + elif isinstance(args_type_0_item_data, InputPathPlaceholder): + args_type_0_item = args_type_0_item_data.to_dict() + elif isinstance(args_type_0_item_data, OutputPathPlaceholder): + args_type_0_item = args_type_0_item_data.to_dict() + elif isinstance(args_type_0_item_data, ConcatPlaceholder): + args_type_0_item = args_type_0_item_data.to_dict() + elif isinstance(args_type_0_item_data, IfPlaceholder): + args_type_0_item = args_type_0_item_data.to_dict() + else: + args_type_0_item = args_type_0_item_data + args.append(args_type_0_item) + + else: + args = self.args + + env: dict[str, Any] | None | Unset + if isinstance(self.env, Unset): + env = UNSET + elif isinstance(self.env, ContainerSpecEnvType0): + env = self.env.to_dict() + else: + env = self.env + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "image": image, + } + ) + if command is not UNSET: + field_dict["command"] = command + if args is not UNSET: + field_dict["args"] = args + if env is not UNSET: + field_dict["env"] = env + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.container_spec_env_type_0 import ContainerSpecEnvType0 + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + d = dict(src_dict) + image = d.pop("image") + + def _parse_command( + data: object, + ) -> ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ): + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + command_type_0 = [] + _command_type_0 = data + for command_type_0_item_data in _command_type_0: + + def _parse_command_type_0_item( + data: object, + ) -> ( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ): + try: + if not isinstance(data, dict): + raise TypeError() + command_type_0_item_type_1 = InputValuePlaceholder.from_dict(data) + + return command_type_0_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + command_type_0_item_type_2 = InputPathPlaceholder.from_dict(data) + + return command_type_0_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + command_type_0_item_type_3 = OutputPathPlaceholder.from_dict(data) + + return command_type_0_item_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + command_type_0_item_type_4 = ConcatPlaceholder.from_dict(data) + + return command_type_0_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + command_type_0_item_type_5 = IfPlaceholder.from_dict(data) + + return command_type_0_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str, + data, + ) + + command_type_0_item = _parse_command_type_0_item(command_type_0_item_data) + + command_type_0.append(command_type_0_item) + + return command_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset, + data, + ) + + command = _parse_command(d.pop("command", UNSET)) + + def _parse_args( + data: object, + ) -> ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ): + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + args_type_0 = [] + _args_type_0 = data + for args_type_0_item_data in _args_type_0: + + def _parse_args_type_0_item( + data: object, + ) -> ( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ): + try: + if not isinstance(data, dict): + raise TypeError() + args_type_0_item_type_1 = InputValuePlaceholder.from_dict(data) + + return args_type_0_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + args_type_0_item_type_2 = InputPathPlaceholder.from_dict(data) + + return args_type_0_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + args_type_0_item_type_3 = OutputPathPlaceholder.from_dict(data) + + return args_type_0_item_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + args_type_0_item_type_4 = ConcatPlaceholder.from_dict(data) + + return args_type_0_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + args_type_0_item_type_5 = IfPlaceholder.from_dict(data) + + return args_type_0_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str, + data, + ) + + args_type_0_item = _parse_args_type_0_item(args_type_0_item_data) + + args_type_0.append(args_type_0_item) + + return args_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset, + data, + ) + + args = _parse_args(d.pop("args", UNSET)) + + def _parse_env(data: object) -> ContainerSpecEnvType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + env_type_0 = ContainerSpecEnvType0.from_dict(data) + + return env_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ContainerSpecEnvType0 | None | Unset, data) + + env = _parse_env(d.pop("env", UNSET)) + + container_spec = cls( + image=image, + command=command, + args=args, + env=env, + ) + + container_spec.additional_properties = d + return container_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/container_spec_env_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/container_spec_env_type_0.py new file mode 100644 index 0000000..5d3d994 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/container_spec_env_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ContainerSpecEnvType0") + + +@_attrs_define +class ContainerSpecEnvType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + container_spec_env_type_0 = cls() + + container_spec_env_type_0.additional_properties = d + return container_spec_env_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument.py b/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument.py new file mode 100644 index 0000000..8f12d76 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.dynamic_data_argument_dynamic_data_type_1 import DynamicDataArgumentDynamicDataType1 + + +T = TypeVar("T", bound="DynamicDataArgument") + + +@_attrs_define +class DynamicDataArgument: + """ + Attributes: + dynamic_data (DynamicDataArgumentDynamicDataType1 | str): + """ + + dynamic_data: DynamicDataArgumentDynamicDataType1 | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.dynamic_data_argument_dynamic_data_type_1 import DynamicDataArgumentDynamicDataType1 + + dynamic_data: dict[str, Any] | str + if isinstance(self.dynamic_data, DynamicDataArgumentDynamicDataType1): + dynamic_data = self.dynamic_data.to_dict() + else: + dynamic_data = self.dynamic_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "dynamicData": dynamic_data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.dynamic_data_argument_dynamic_data_type_1 import DynamicDataArgumentDynamicDataType1 + + d = dict(src_dict) + + def _parse_dynamic_data(data: object) -> DynamicDataArgumentDynamicDataType1 | str: + try: + if not isinstance(data, dict): + raise TypeError() + dynamic_data_type_1 = DynamicDataArgumentDynamicDataType1.from_dict(data) + + return dynamic_data_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DynamicDataArgumentDynamicDataType1 | str, data) + + dynamic_data = _parse_dynamic_data(d.pop("dynamicData")) + + dynamic_data_argument = cls( + dynamic_data=dynamic_data, + ) + + dynamic_data_argument.additional_properties = d + return dynamic_data_argument + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument_dynamic_data_type_1.py b/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument_dynamic_data_type_1.py new file mode 100644 index 0000000..8899641 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/dynamic_data_argument_dynamic_data_type_1.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DynamicDataArgumentDynamicDataType1") + + +@_attrs_define +class DynamicDataArgumentDynamicDataType1: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + dynamic_data_argument_dynamic_data_type_1 = cls() + + dynamic_data_argument_dynamic_data_type_1.additional_properties = d + return dynamic_data_argument_dynamic_data_type_1 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/execution_node_reference.py b/tangle_cli/api/_tangle_api_client_lib/models/execution_node_reference.py new file mode 100644 index 0000000..a6a9be1 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/execution_node_reference.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ExecutionNodeReference") + + +@_attrs_define +class ExecutionNodeReference: + """ + Attributes: + execution_node_id (str): + pipeline_run_id (None | str): + """ + + execution_node_id: str + pipeline_run_id: None | str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + execution_node_id = self.execution_node_id + + pipeline_run_id: None | str + pipeline_run_id = self.pipeline_run_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "execution_node_id": execution_node_id, + "pipeline_run_id": pipeline_run_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + execution_node_id = d.pop("execution_node_id") + + def _parse_pipeline_run_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + pipeline_run_id = _parse_pipeline_run_id(d.pop("pipeline_run_id")) + + execution_node_reference = cls( + execution_node_id=execution_node_id, + pipeline_run_id=pipeline_run_id, + ) + + execution_node_reference.additional_properties = d + return execution_node_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/execution_options_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/execution_options_spec.py new file mode 100644 index 0000000..8751bd7 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/execution_options_spec.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.caching_strategy_spec import CachingStrategySpec + from ..models.retry_strategy_spec import RetryStrategySpec + + +T = TypeVar("T", bound="ExecutionOptionsSpec") + + +@_attrs_define +class ExecutionOptionsSpec: + """ + Attributes: + retry_strategy (None | RetryStrategySpec | Unset): + caching_strategy (CachingStrategySpec | None | Unset): + """ + + retry_strategy: None | RetryStrategySpec | Unset = UNSET + caching_strategy: CachingStrategySpec | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.caching_strategy_spec import CachingStrategySpec + from ..models.retry_strategy_spec import RetryStrategySpec + + retry_strategy: dict[str, Any] | None | Unset + if isinstance(self.retry_strategy, Unset): + retry_strategy = UNSET + elif isinstance(self.retry_strategy, RetryStrategySpec): + retry_strategy = self.retry_strategy.to_dict() + else: + retry_strategy = self.retry_strategy + + caching_strategy: dict[str, Any] | None | Unset + if isinstance(self.caching_strategy, Unset): + caching_strategy = UNSET + elif isinstance(self.caching_strategy, CachingStrategySpec): + caching_strategy = self.caching_strategy.to_dict() + else: + caching_strategy = self.caching_strategy + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if retry_strategy is not UNSET: + field_dict["retryStrategy"] = retry_strategy + if caching_strategy is not UNSET: + field_dict["cachingStrategy"] = caching_strategy + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.caching_strategy_spec import CachingStrategySpec + from ..models.retry_strategy_spec import RetryStrategySpec + + d = dict(src_dict) + + def _parse_retry_strategy(data: object) -> None | RetryStrategySpec | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + retry_strategy_type_0 = RetryStrategySpec.from_dict(data) + + return retry_strategy_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | RetryStrategySpec | Unset, data) + + retry_strategy = _parse_retry_strategy(d.pop("retryStrategy", UNSET)) + + def _parse_caching_strategy(data: object) -> CachingStrategySpec | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + caching_strategy_type_0 = CachingStrategySpec.from_dict(data) + + return caching_strategy_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(CachingStrategySpec | None | Unset, data) + + caching_strategy = _parse_caching_strategy(d.pop("cachingStrategy", UNSET)) + + execution_options_spec = cls( + retry_strategy=retry_strategy, + caching_strategy=caching_strategy, + ) + + execution_options_spec.additional_properties = d + return execution_options_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/execution_status_summary.py b/tangle_cli/api/_tangle_api_client_lib/models/execution_status_summary.py new file mode 100644 index 0000000..692061c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/execution_status_summary.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ExecutionStatusSummary") + + +@_attrs_define +class ExecutionStatusSummary: + """ + Attributes: + total_executions (int): + ended_executions (int): + has_ended (bool): + """ + + total_executions: int + ended_executions: int + has_ended: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + total_executions = self.total_executions + + ended_executions = self.ended_executions + + has_ended = self.has_ended + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "total_executions": total_executions, + "ended_executions": ended_executions, + "has_ended": has_ended, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + total_executions = d.pop("total_executions") + + ended_executions = d.pop("ended_executions") + + has_ended = d.pop("has_ended") + + execution_status_summary = cls( + total_executions=total_executions, + ended_executions=ended_executions, + has_ended=has_ended, + ) + + execution_status_summary.additional_properties = d + return execution_status_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_info_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_info_response.py new file mode 100644 index 0000000..f06f8ec --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_info_response.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.artifact_data import ArtifactData + + +T = TypeVar("T", bound="GetArtifactInfoResponse") + + +@_attrs_define +class GetArtifactInfoResponse: + """ + Attributes: + id (str): + artifact_data (ArtifactData | None | Unset): + """ + + id: str + artifact_data: ArtifactData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.artifact_data import ArtifactData + + id = self.id + + artifact_data: dict[str, Any] | None | Unset + if isinstance(self.artifact_data, Unset): + artifact_data = UNSET + elif isinstance(self.artifact_data, ArtifactData): + artifact_data = self.artifact_data.to_dict() + else: + artifact_data = self.artifact_data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + } + ) + if artifact_data is not UNSET: + field_dict["artifact_data"] = artifact_data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_data import ArtifactData + + d = dict(src_dict) + id = d.pop("id") + + def _parse_artifact_data(data: object) -> ArtifactData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + artifact_data_type_0 = ArtifactData.from_dict(data) + + return artifact_data_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ArtifactData | None | Unset, data) + + artifact_data = _parse_artifact_data(d.pop("artifact_data", UNSET)) + + get_artifact_info_response = cls( + id=id, + artifact_data=artifact_data, + ) + + get_artifact_info_response.additional_properties = d + return get_artifact_info_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_signed_url_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_signed_url_response.py new file mode 100644 index 0000000..af0e7d9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_artifact_signed_url_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetArtifactSignedUrlResponse") + + +@_attrs_define +class GetArtifactSignedUrlResponse: + """ + Attributes: + signed_url (str): + """ + + signed_url: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + signed_url = self.signed_url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "signed_url": signed_url, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + signed_url = d.pop("signed_url") + + get_artifact_signed_url_response = cls( + signed_url=signed_url, + ) + + get_artifact_signed_url_response.additional_properties = d + return get_artifact_signed_url_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_log_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_log_response.py new file mode 100644 index 0000000..e9dfbfc --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_log_response.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="GetContainerExecutionLogResponse") + + +@_attrs_define +class GetContainerExecutionLogResponse: + """ + Attributes: + log_text (None | str | Unset): + system_error_exception_full (None | str | Unset): + orchestration_error_message (None | str | Unset): + """ + + log_text: None | str | Unset = UNSET + system_error_exception_full: None | str | Unset = UNSET + orchestration_error_message: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + log_text: None | str | Unset + if isinstance(self.log_text, Unset): + log_text = UNSET + else: + log_text = self.log_text + + system_error_exception_full: None | str | Unset + if isinstance(self.system_error_exception_full, Unset): + system_error_exception_full = UNSET + else: + system_error_exception_full = self.system_error_exception_full + + orchestration_error_message: None | str | Unset + if isinstance(self.orchestration_error_message, Unset): + orchestration_error_message = UNSET + else: + orchestration_error_message = self.orchestration_error_message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if log_text is not UNSET: + field_dict["log_text"] = log_text + if system_error_exception_full is not UNSET: + field_dict["system_error_exception_full"] = system_error_exception_full + if orchestration_error_message is not UNSET: + field_dict["orchestration_error_message"] = orchestration_error_message + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_log_text(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + log_text = _parse_log_text(d.pop("log_text", UNSET)) + + def _parse_system_error_exception_full(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + system_error_exception_full = _parse_system_error_exception_full(d.pop("system_error_exception_full", UNSET)) + + def _parse_orchestration_error_message(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + orchestration_error_message = _parse_orchestration_error_message(d.pop("orchestration_error_message", UNSET)) + + get_container_execution_log_response = cls( + log_text=log_text, + system_error_exception_full=system_error_exception_full, + orchestration_error_message=orchestration_error_message, + ) + + get_container_execution_log_response.additional_properties = d + return get_container_execution_log_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response.py new file mode 100644 index 0000000..39e09d3 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.container_execution_status import ContainerExecutionStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.execution_node_reference import ExecutionNodeReference + from ..models.get_container_execution_state_response_debug_info_type_0 import ( + GetContainerExecutionStateResponseDebugInfoType0, + ) + + +T = TypeVar("T", bound="GetContainerExecutionStateResponse") + + +@_attrs_define +class GetContainerExecutionStateResponse: + """ + Attributes: + status (ContainerExecutionStatus): + exit_code (int | None | Unset): + started_at (datetime.datetime | None | Unset): + ended_at (datetime.datetime | None | Unset): + debug_info (GetContainerExecutionStateResponseDebugInfoType0 | None | Unset): + execution_nodes_linked_to_same_container_execution (list[ExecutionNodeReference] | None | Unset): + """ + + status: ContainerExecutionStatus + exit_code: int | None | Unset = UNSET + started_at: datetime.datetime | None | Unset = UNSET + ended_at: datetime.datetime | None | Unset = UNSET + debug_info: GetContainerExecutionStateResponseDebugInfoType0 | None | Unset = UNSET + execution_nodes_linked_to_same_container_execution: list[ExecutionNodeReference] | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.get_container_execution_state_response_debug_info_type_0 import ( + GetContainerExecutionStateResponseDebugInfoType0, + ) + + status = self.status.value + + exit_code: int | None | Unset + if isinstance(self.exit_code, Unset): + exit_code = UNSET + else: + exit_code = self.exit_code + + started_at: None | str | Unset + if isinstance(self.started_at, Unset): + started_at = UNSET + elif isinstance(self.started_at, datetime.datetime): + started_at = self.started_at.isoformat() + else: + started_at = self.started_at + + ended_at: None | str | Unset + if isinstance(self.ended_at, Unset): + ended_at = UNSET + elif isinstance(self.ended_at, datetime.datetime): + ended_at = self.ended_at.isoformat() + else: + ended_at = self.ended_at + + debug_info: dict[str, Any] | None | Unset + if isinstance(self.debug_info, Unset): + debug_info = UNSET + elif isinstance(self.debug_info, GetContainerExecutionStateResponseDebugInfoType0): + debug_info = self.debug_info.to_dict() + else: + debug_info = self.debug_info + + execution_nodes_linked_to_same_container_execution: list[dict[str, Any]] | None | Unset + if isinstance(self.execution_nodes_linked_to_same_container_execution, Unset): + execution_nodes_linked_to_same_container_execution = UNSET + elif isinstance(self.execution_nodes_linked_to_same_container_execution, list): + execution_nodes_linked_to_same_container_execution = [] + for ( + execution_nodes_linked_to_same_container_execution_type_0_item_data + ) in self.execution_nodes_linked_to_same_container_execution: + execution_nodes_linked_to_same_container_execution_type_0_item = ( + execution_nodes_linked_to_same_container_execution_type_0_item_data.to_dict() + ) + execution_nodes_linked_to_same_container_execution.append( + execution_nodes_linked_to_same_container_execution_type_0_item + ) + + else: + execution_nodes_linked_to_same_container_execution = self.execution_nodes_linked_to_same_container_execution + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status": status, + } + ) + if exit_code is not UNSET: + field_dict["exit_code"] = exit_code + if started_at is not UNSET: + field_dict["started_at"] = started_at + if ended_at is not UNSET: + field_dict["ended_at"] = ended_at + if debug_info is not UNSET: + field_dict["debug_info"] = debug_info + if execution_nodes_linked_to_same_container_execution is not UNSET: + field_dict["execution_nodes_linked_to_same_container_execution"] = ( + execution_nodes_linked_to_same_container_execution + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.execution_node_reference import ExecutionNodeReference + from ..models.get_container_execution_state_response_debug_info_type_0 import ( + GetContainerExecutionStateResponseDebugInfoType0, + ) + + d = dict(src_dict) + status = ContainerExecutionStatus(d.pop("status")) + + def _parse_exit_code(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + exit_code = _parse_exit_code(d.pop("exit_code", UNSET)) + + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + started_at_type_0 = datetime.datetime.fromisoformat(data) + + return started_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + started_at = _parse_started_at(d.pop("started_at", UNSET)) + + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + ended_at_type_0 = datetime.datetime.fromisoformat(data) + + return ended_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) + + def _parse_debug_info(data: object) -> GetContainerExecutionStateResponseDebugInfoType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + debug_info_type_0 = GetContainerExecutionStateResponseDebugInfoType0.from_dict(data) + + return debug_info_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetContainerExecutionStateResponseDebugInfoType0 | None | Unset, data) + + debug_info = _parse_debug_info(d.pop("debug_info", UNSET)) + + def _parse_execution_nodes_linked_to_same_container_execution( + data: object, + ) -> list[ExecutionNodeReference] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + execution_nodes_linked_to_same_container_execution_type_0 = [] + _execution_nodes_linked_to_same_container_execution_type_0 = data + for ( + execution_nodes_linked_to_same_container_execution_type_0_item_data + ) in _execution_nodes_linked_to_same_container_execution_type_0: + execution_nodes_linked_to_same_container_execution_type_0_item = ExecutionNodeReference.from_dict( + execution_nodes_linked_to_same_container_execution_type_0_item_data + ) + + execution_nodes_linked_to_same_container_execution_type_0.append( + execution_nodes_linked_to_same_container_execution_type_0_item + ) + + return execution_nodes_linked_to_same_container_execution_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[ExecutionNodeReference] | None | Unset, data) + + execution_nodes_linked_to_same_container_execution = _parse_execution_nodes_linked_to_same_container_execution( + d.pop("execution_nodes_linked_to_same_container_execution", UNSET) + ) + + get_container_execution_state_response = cls( + status=status, + exit_code=exit_code, + started_at=started_at, + ended_at=ended_at, + debug_info=debug_info, + execution_nodes_linked_to_same_container_execution=execution_nodes_linked_to_same_container_execution, + ) + + get_container_execution_state_response.additional_properties = d + return get_container_execution_state_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response_debug_info_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response_debug_info_type_0.py new file mode 100644 index 0000000..f7e4672 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_container_execution_state_response_debug_info_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetContainerExecutionStateResponseDebugInfoType0") + + +@_attrs_define +class GetContainerExecutionStateResponseDebugInfoType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_container_execution_state_response_debug_info_type_0 = cls() + + get_container_execution_state_response_debug_info_type_0.additional_properties = d + return get_container_execution_state_response_debug_info_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response.py new file mode 100644 index 0000000..1960398 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response.py @@ -0,0 +1,136 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_execution_artifacts_response_input_artifacts_type_0 import ( + GetExecutionArtifactsResponseInputArtifactsType0, + ) + from ..models.get_execution_artifacts_response_output_artifacts_type_0 import ( + GetExecutionArtifactsResponseOutputArtifactsType0, + ) + + +T = TypeVar("T", bound="GetExecutionArtifactsResponse") + + +@_attrs_define +class GetExecutionArtifactsResponse: + """ + Attributes: + input_artifacts (GetExecutionArtifactsResponseInputArtifactsType0 | None | Unset): + output_artifacts (GetExecutionArtifactsResponseOutputArtifactsType0 | None | Unset): + """ + + input_artifacts: GetExecutionArtifactsResponseInputArtifactsType0 | None | Unset = UNSET + output_artifacts: GetExecutionArtifactsResponseOutputArtifactsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.get_execution_artifacts_response_input_artifacts_type_0 import ( + GetExecutionArtifactsResponseInputArtifactsType0, + ) + from ..models.get_execution_artifacts_response_output_artifacts_type_0 import ( + GetExecutionArtifactsResponseOutputArtifactsType0, + ) + + input_artifacts: dict[str, Any] | None | Unset + if isinstance(self.input_artifacts, Unset): + input_artifacts = UNSET + elif isinstance(self.input_artifacts, GetExecutionArtifactsResponseInputArtifactsType0): + input_artifacts = self.input_artifacts.to_dict() + else: + input_artifacts = self.input_artifacts + + output_artifacts: dict[str, Any] | None | Unset + if isinstance(self.output_artifacts, Unset): + output_artifacts = UNSET + elif isinstance(self.output_artifacts, GetExecutionArtifactsResponseOutputArtifactsType0): + output_artifacts = self.output_artifacts.to_dict() + else: + output_artifacts = self.output_artifacts + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if input_artifacts is not UNSET: + field_dict["input_artifacts"] = input_artifacts + if output_artifacts is not UNSET: + field_dict["output_artifacts"] = output_artifacts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_execution_artifacts_response_input_artifacts_type_0 import ( + GetExecutionArtifactsResponseInputArtifactsType0, + ) + from ..models.get_execution_artifacts_response_output_artifacts_type_0 import ( + GetExecutionArtifactsResponseOutputArtifactsType0, + ) + + d = dict(src_dict) + + def _parse_input_artifacts(data: object) -> GetExecutionArtifactsResponseInputArtifactsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + input_artifacts_type_0 = GetExecutionArtifactsResponseInputArtifactsType0.from_dict(data) + + return input_artifacts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetExecutionArtifactsResponseInputArtifactsType0 | None | Unset, data) + + input_artifacts = _parse_input_artifacts(d.pop("input_artifacts", UNSET)) + + def _parse_output_artifacts(data: object) -> GetExecutionArtifactsResponseOutputArtifactsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + output_artifacts_type_0 = GetExecutionArtifactsResponseOutputArtifactsType0.from_dict(data) + + return output_artifacts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetExecutionArtifactsResponseOutputArtifactsType0 | None | Unset, data) + + output_artifacts = _parse_output_artifacts(d.pop("output_artifacts", UNSET)) + + get_execution_artifacts_response = cls( + input_artifacts=input_artifacts, + output_artifacts=output_artifacts, + ) + + get_execution_artifacts_response.additional_properties = d + return get_execution_artifacts_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_input_artifacts_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_input_artifacts_type_0.py new file mode 100644 index 0000000..44dcb5f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_input_artifacts_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.artifact_node_response import ArtifactNodeResponse + + +T = TypeVar("T", bound="GetExecutionArtifactsResponseInputArtifactsType0") + + +@_attrs_define +class GetExecutionArtifactsResponseInputArtifactsType0: + """ """ + + additional_properties: dict[str, ArtifactNodeResponse] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_node_response import ArtifactNodeResponse + + d = dict(src_dict) + get_execution_artifacts_response_input_artifacts_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ArtifactNodeResponse.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + get_execution_artifacts_response_input_artifacts_type_0.additional_properties = additional_properties + return get_execution_artifacts_response_input_artifacts_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ArtifactNodeResponse: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ArtifactNodeResponse) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_output_artifacts_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_output_artifacts_type_0.py new file mode 100644 index 0000000..06a855b --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_artifacts_response_output_artifacts_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.artifact_node_response import ArtifactNodeResponse + + +T = TypeVar("T", bound="GetExecutionArtifactsResponseOutputArtifactsType0") + + +@_attrs_define +class GetExecutionArtifactsResponseOutputArtifactsType0: + """ """ + + additional_properties: dict[str, ArtifactNodeResponse] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_node_response import ArtifactNodeResponse + + d = dict(src_dict) + get_execution_artifacts_response_output_artifacts_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ArtifactNodeResponse.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + get_execution_artifacts_response_output_artifacts_type_0.additional_properties = additional_properties + return get_execution_artifacts_response_output_artifacts_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ArtifactNodeResponse: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ArtifactNodeResponse) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response.py new file mode 100644 index 0000000..1ce7288 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response.py @@ -0,0 +1,210 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_execution_info_response_child_task_execution_ids import ( + GetExecutionInfoResponseChildTaskExecutionIds, + ) + from ..models.get_execution_info_response_input_artifacts_type_0 import GetExecutionInfoResponseInputArtifactsType0 + from ..models.get_execution_info_response_output_artifacts_type_0 import ( + GetExecutionInfoResponseOutputArtifactsType0, + ) + from ..models.task_spec import TaskSpec + + +T = TypeVar("T", bound="GetExecutionInfoResponse") + + +@_attrs_define +class GetExecutionInfoResponse: + """ + Attributes: + id (str): + task_spec (TaskSpec): + child_task_execution_ids (GetExecutionInfoResponseChildTaskExecutionIds): + parent_execution_id (None | str | Unset): + pipeline_run_id (None | str | Unset): + input_artifacts (GetExecutionInfoResponseInputArtifactsType0 | None | Unset): + output_artifacts (GetExecutionInfoResponseOutputArtifactsType0 | None | Unset): + """ + + id: str + task_spec: TaskSpec + child_task_execution_ids: GetExecutionInfoResponseChildTaskExecutionIds + parent_execution_id: None | str | Unset = UNSET + pipeline_run_id: None | str | Unset = UNSET + input_artifacts: GetExecutionInfoResponseInputArtifactsType0 | None | Unset = UNSET + output_artifacts: GetExecutionInfoResponseOutputArtifactsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.get_execution_info_response_input_artifacts_type_0 import ( + GetExecutionInfoResponseInputArtifactsType0, + ) + from ..models.get_execution_info_response_output_artifacts_type_0 import ( + GetExecutionInfoResponseOutputArtifactsType0, + ) + + id = self.id + + task_spec = self.task_spec.to_dict() + + child_task_execution_ids = self.child_task_execution_ids.to_dict() + + parent_execution_id: None | str | Unset + if isinstance(self.parent_execution_id, Unset): + parent_execution_id = UNSET + else: + parent_execution_id = self.parent_execution_id + + pipeline_run_id: None | str | Unset + if isinstance(self.pipeline_run_id, Unset): + pipeline_run_id = UNSET + else: + pipeline_run_id = self.pipeline_run_id + + input_artifacts: dict[str, Any] | None | Unset + if isinstance(self.input_artifacts, Unset): + input_artifacts = UNSET + elif isinstance(self.input_artifacts, GetExecutionInfoResponseInputArtifactsType0): + input_artifacts = self.input_artifacts.to_dict() + else: + input_artifacts = self.input_artifacts + + output_artifacts: dict[str, Any] | None | Unset + if isinstance(self.output_artifacts, Unset): + output_artifacts = UNSET + elif isinstance(self.output_artifacts, GetExecutionInfoResponseOutputArtifactsType0): + output_artifacts = self.output_artifacts.to_dict() + else: + output_artifacts = self.output_artifacts + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "task_spec": task_spec, + "child_task_execution_ids": child_task_execution_ids, + } + ) + if parent_execution_id is not UNSET: + field_dict["parent_execution_id"] = parent_execution_id + if pipeline_run_id is not UNSET: + field_dict["pipeline_run_id"] = pipeline_run_id + if input_artifacts is not UNSET: + field_dict["input_artifacts"] = input_artifacts + if output_artifacts is not UNSET: + field_dict["output_artifacts"] = output_artifacts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_execution_info_response_child_task_execution_ids import ( + GetExecutionInfoResponseChildTaskExecutionIds, + ) + from ..models.get_execution_info_response_input_artifacts_type_0 import ( + GetExecutionInfoResponseInputArtifactsType0, + ) + from ..models.get_execution_info_response_output_artifacts_type_0 import ( + GetExecutionInfoResponseOutputArtifactsType0, + ) + from ..models.task_spec import TaskSpec + + d = dict(src_dict) + id = d.pop("id") + + task_spec = TaskSpec.from_dict(d.pop("task_spec")) + + child_task_execution_ids = GetExecutionInfoResponseChildTaskExecutionIds.from_dict( + d.pop("child_task_execution_ids") + ) + + def _parse_parent_execution_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_execution_id = _parse_parent_execution_id(d.pop("parent_execution_id", UNSET)) + + def _parse_pipeline_run_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + pipeline_run_id = _parse_pipeline_run_id(d.pop("pipeline_run_id", UNSET)) + + def _parse_input_artifacts(data: object) -> GetExecutionInfoResponseInputArtifactsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + input_artifacts_type_0 = GetExecutionInfoResponseInputArtifactsType0.from_dict(data) + + return input_artifacts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetExecutionInfoResponseInputArtifactsType0 | None | Unset, data) + + input_artifacts = _parse_input_artifacts(d.pop("input_artifacts", UNSET)) + + def _parse_output_artifacts(data: object) -> GetExecutionInfoResponseOutputArtifactsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + output_artifacts_type_0 = GetExecutionInfoResponseOutputArtifactsType0.from_dict(data) + + return output_artifacts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GetExecutionInfoResponseOutputArtifactsType0 | None | Unset, data) + + output_artifacts = _parse_output_artifacts(d.pop("output_artifacts", UNSET)) + + get_execution_info_response = cls( + id=id, + task_spec=task_spec, + child_task_execution_ids=child_task_execution_ids, + parent_execution_id=parent_execution_id, + pipeline_run_id=pipeline_run_id, + input_artifacts=input_artifacts, + output_artifacts=output_artifacts, + ) + + get_execution_info_response.additional_properties = d + return get_execution_info_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_child_task_execution_ids.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_child_task_execution_ids.py new file mode 100644 index 0000000..ee1e50f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_child_task_execution_ids.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetExecutionInfoResponseChildTaskExecutionIds") + + +@_attrs_define +class GetExecutionInfoResponseChildTaskExecutionIds: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_execution_info_response_child_task_execution_ids = cls() + + get_execution_info_response_child_task_execution_ids.additional_properties = d + return get_execution_info_response_child_task_execution_ids + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_input_artifacts_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_input_artifacts_type_0.py new file mode 100644 index 0000000..72dfd97 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_input_artifacts_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.artifact_node_id_response import ArtifactNodeIdResponse + + +T = TypeVar("T", bound="GetExecutionInfoResponseInputArtifactsType0") + + +@_attrs_define +class GetExecutionInfoResponseInputArtifactsType0: + """ """ + + additional_properties: dict[str, ArtifactNodeIdResponse] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_node_id_response import ArtifactNodeIdResponse + + d = dict(src_dict) + get_execution_info_response_input_artifacts_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ArtifactNodeIdResponse.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + get_execution_info_response_input_artifacts_type_0.additional_properties = additional_properties + return get_execution_info_response_input_artifacts_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ArtifactNodeIdResponse: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ArtifactNodeIdResponse) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_output_artifacts_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_output_artifacts_type_0.py new file mode 100644 index 0000000..70380b8 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_execution_info_response_output_artifacts_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.artifact_node_id_response import ArtifactNodeIdResponse + + +T = TypeVar("T", bound="GetExecutionInfoResponseOutputArtifactsType0") + + +@_attrs_define +class GetExecutionInfoResponseOutputArtifactsType0: + """ """ + + additional_properties: dict[str, ArtifactNodeIdResponse] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_node_id_response import ArtifactNodeIdResponse + + d = dict(src_dict) + get_execution_info_response_output_artifacts_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = ArtifactNodeIdResponse.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + get_execution_info_response_output_artifacts_type_0.additional_properties = additional_properties + return get_execution_info_response_output_artifacts_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> ArtifactNodeIdResponse: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: ArtifactNodeIdResponse) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response.py new file mode 100644 index 0000000..6c45cd2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response.py @@ -0,0 +1,83 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.execution_status_summary import ExecutionStatusSummary + from ..models.get_graph_execution_state_response_child_execution_status_stats import ( + GetGraphExecutionStateResponseChildExecutionStatusStats, + ) + + +T = TypeVar("T", bound="GetGraphExecutionStateResponse") + + +@_attrs_define +class GetGraphExecutionStateResponse: + """ + Attributes: + child_execution_status_stats (GetGraphExecutionStateResponseChildExecutionStatusStats): + child_execution_status_summary (ExecutionStatusSummary): + """ + + child_execution_status_stats: GetGraphExecutionStateResponseChildExecutionStatusStats + child_execution_status_summary: ExecutionStatusSummary + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + child_execution_status_stats = self.child_execution_status_stats.to_dict() + + child_execution_status_summary = self.child_execution_status_summary.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "child_execution_status_stats": child_execution_status_stats, + "child_execution_status_summary": child_execution_status_summary, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.execution_status_summary import ExecutionStatusSummary + from ..models.get_graph_execution_state_response_child_execution_status_stats import ( + GetGraphExecutionStateResponseChildExecutionStatusStats, + ) + + d = dict(src_dict) + child_execution_status_stats = GetGraphExecutionStateResponseChildExecutionStatusStats.from_dict( + d.pop("child_execution_status_stats") + ) + + child_execution_status_summary = ExecutionStatusSummary.from_dict(d.pop("child_execution_status_summary")) + + get_graph_execution_state_response = cls( + child_execution_status_stats=child_execution_status_stats, + child_execution_status_summary=child_execution_status_summary, + ) + + get_graph_execution_state_response.additional_properties = d + return get_graph_execution_state_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats.py b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats.py new file mode 100644 index 0000000..80ad67f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.get_graph_execution_state_response_child_execution_status_stats_additional_property import ( + GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty, + ) + + +T = TypeVar("T", bound="GetGraphExecutionStateResponseChildExecutionStatusStats") + + +@_attrs_define +class GetGraphExecutionStateResponseChildExecutionStatusStats: + """ """ + + additional_properties: dict[str, GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty] = ( + _attrs_field(init=False, factory=dict) + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_graph_execution_state_response_child_execution_status_stats_additional_property import ( + GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty, + ) + + d = dict(src_dict) + get_graph_execution_state_response_child_execution_status_stats = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty.from_dict( + prop_dict + ) + + additional_properties[prop_name] = additional_property + + get_graph_execution_state_response_child_execution_status_stats.additional_properties = additional_properties + return get_graph_execution_state_response_child_execution_status_stats + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty: + return self.additional_properties[key] + + def __setitem__( + self, key: str, value: GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty + ) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats_additional_property.py b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats_additional_property.py new file mode 100644 index 0000000..1587702 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_graph_execution_state_response_child_execution_status_stats_additional_property.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty") + + +@_attrs_define +class GetGraphExecutionStateResponseChildExecutionStatusStatsAdditionalProperty: + """ """ + + additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + get_graph_execution_state_response_child_execution_status_stats_additional_property = cls() + + get_graph_execution_state_response_child_execution_status_stats_additional_property.additional_properties = d + return get_graph_execution_state_response_child_execution_status_stats_additional_property + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> int: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: int) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/get_user_response.py b/tangle_cli/api/_tangle_api_client_lib/models/get_user_response.py new file mode 100644 index 0000000..6a95c25 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/get_user_response.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GetUserResponse") + + +@_attrs_define +class GetUserResponse: + """ + Attributes: + id (None | str): + permissions (list[str]): + """ + + id: None | str + permissions: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id: None | str + id = self.id + + permissions = self.permissions + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "permissions": permissions, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_id(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + id = _parse_id(d.pop("id")) + + permissions = cast(list[str], d.pop("permissions")) + + get_user_response = cls( + id=id, + permissions=permissions, + ) + + get_user_response.additional_properties = d + return get_user_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_implementation.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_implementation.py new file mode 100644 index 0000000..87a155d --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_implementation.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.graph_spec import GraphSpec + + +T = TypeVar("T", bound="GraphImplementation") + + +@_attrs_define +class GraphImplementation: + """ + Attributes: + graph (GraphSpec): + """ + + graph: GraphSpec + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + graph = self.graph.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "graph": graph, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.graph_spec import GraphSpec + + d = dict(src_dict) + graph = GraphSpec.from_dict(d.pop("graph")) + + graph_implementation = cls( + graph=graph, + ) + + graph_implementation.additional_properties = d + return graph_implementation + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_input_argument.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_argument.py new file mode 100644 index 0000000..8bc5a48 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_argument.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.graph_input_reference import GraphInputReference + + +T = TypeVar("T", bound="GraphInputArgument") + + +@_attrs_define +class GraphInputArgument: + """ + Attributes: + graph_input (GraphInputReference): + """ + + graph_input: GraphInputReference + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + graph_input = self.graph_input.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "graphInput": graph_input, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.graph_input_reference import GraphInputReference + + d = dict(src_dict) + graph_input = GraphInputReference.from_dict(d.pop("graphInput")) + + graph_input_argument = cls( + graph_input=graph_input, + ) + + graph_input_argument.additional_properties = d + return graph_input_argument + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference.py new file mode 100644 index 0000000..98e0a14 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.graph_input_reference_type_type_1 import GraphInputReferenceTypeType1 + + +T = TypeVar("T", bound="GraphInputReference") + + +@_attrs_define +class GraphInputReference: + """ + Attributes: + input_name (str): + type_ (GraphInputReferenceTypeType1 | list[Any] | None | str | Unset): + """ + + input_name: str + type_: GraphInputReferenceTypeType1 | list[Any] | None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.graph_input_reference_type_type_1 import GraphInputReferenceTypeType1 + + input_name = self.input_name + + type_: dict[str, Any] | list[Any] | None | str | Unset + if isinstance(self.type_, Unset): + type_ = UNSET + elif isinstance(self.type_, GraphInputReferenceTypeType1): + type_ = self.type_.to_dict() + elif isinstance(self.type_, list): + type_ = self.type_ + + else: + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "inputName": input_name, + } + ) + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.graph_input_reference_type_type_1 import GraphInputReferenceTypeType1 + + d = dict(src_dict) + input_name = d.pop("inputName") + + def _parse_type_(data: object) -> GraphInputReferenceTypeType1 | list[Any] | None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + type_type_1 = GraphInputReferenceTypeType1.from_dict(data) + + return type_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, list): + raise TypeError() + type_type_2 = cast(list[Any], data) + + return type_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GraphInputReferenceTypeType1 | list[Any] | None | str | Unset, data) + + type_ = _parse_type_(d.pop("type", UNSET)) + + graph_input_reference = cls( + input_name=input_name, + type_=type_, + ) + + graph_input_reference.additional_properties = d + return graph_input_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference_type_type_1.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference_type_type_1.py new file mode 100644 index 0000000..672d118 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_input_reference_type_type_1.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="GraphInputReferenceTypeType1") + + +@_attrs_define +class GraphInputReferenceTypeType1: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + graph_input_reference_type_type_1 = cls() + + graph_input_reference_type_type_1.additional_properties = d + return graph_input_reference_type_type_1 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec.py new file mode 100644 index 0000000..71ad3ac --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.graph_spec_output_values_type_0 import GraphSpecOutputValuesType0 + from ..models.graph_spec_tasks import GraphSpecTasks + + +T = TypeVar("T", bound="GraphSpec") + + +@_attrs_define +class GraphSpec: + """ + Attributes: + tasks (GraphSpecTasks): + output_values (GraphSpecOutputValuesType0 | None | Unset): + """ + + tasks: GraphSpecTasks + output_values: GraphSpecOutputValuesType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.graph_spec_output_values_type_0 import GraphSpecOutputValuesType0 + + tasks = self.tasks.to_dict() + + output_values: dict[str, Any] | None | Unset + if isinstance(self.output_values, Unset): + output_values = UNSET + elif isinstance(self.output_values, GraphSpecOutputValuesType0): + output_values = self.output_values.to_dict() + else: + output_values = self.output_values + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "tasks": tasks, + } + ) + if output_values is not UNSET: + field_dict["outputValues"] = output_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.graph_spec_output_values_type_0 import GraphSpecOutputValuesType0 + from ..models.graph_spec_tasks import GraphSpecTasks + + d = dict(src_dict) + tasks = GraphSpecTasks.from_dict(d.pop("tasks")) + + def _parse_output_values(data: object) -> GraphSpecOutputValuesType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + output_values_type_0 = GraphSpecOutputValuesType0.from_dict(data) + + return output_values_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(GraphSpecOutputValuesType0 | None | Unset, data) + + output_values = _parse_output_values(d.pop("outputValues", UNSET)) + + graph_spec = cls( + tasks=tasks, + output_values=output_values, + ) + + graph_spec.additional_properties = d + return graph_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_output_values_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_output_values_type_0.py new file mode 100644 index 0000000..c6d2445 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_output_values_type_0.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + +T = TypeVar("T", bound="GraphSpecOutputValuesType0") + + +@_attrs_define +class GraphSpecOutputValuesType0: + """ """ + + additional_properties: dict[str, DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument] = ( + _attrs_field(init=False, factory=dict) + ) + + def to_dict(self) -> dict[str, Any]: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + if isinstance(prop, GraphInputArgument): + field_dict[prop_name] = prop.to_dict() + elif isinstance(prop, TaskOutputArgument): + field_dict[prop_name] = prop.to_dict() + elif isinstance(prop, DynamicDataArgument): + field_dict[prop_name] = prop.to_dict() + else: + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + d = dict(src_dict) + graph_spec_output_values_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property( + data: object, + ) -> DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument: + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_1 = GraphInputArgument.from_dict(data) + + return additional_property_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_2 = TaskOutputArgument.from_dict(data) + + return additional_property_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_3 = DynamicDataArgument.from_dict(data) + + return additional_property_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + graph_spec_output_values_type_0.additional_properties = additional_properties + return graph_spec_output_values_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_tasks.py b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_tasks.py new file mode 100644 index 0000000..d19e1a1 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/graph_spec_tasks.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.task_spec import TaskSpec + + +T = TypeVar("T", bound="GraphSpecTasks") + + +@_attrs_define +class GraphSpecTasks: + """ """ + + additional_properties: dict[str, TaskSpec] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop.to_dict() + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.task_spec import TaskSpec + + d = dict(src_dict) + graph_spec_tasks = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = TaskSpec.from_dict(prop_dict) + + additional_properties[prop_name] = additional_property + + graph_spec_tasks.additional_properties = additional_properties + return graph_spec_tasks + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> TaskSpec: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: TaskSpec) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/http_validation_error.py b/tangle_cli/api/_tangle_api_client_lib/models/http_validation_error.py new file mode 100644 index 0000000..195e5a7 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/http_validation_error.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error import ValidationError + + +T = TypeVar("T", bound="HTTPValidationError") + + +@_attrs_define +class HTTPValidationError: + """ + Attributes: + detail (list[ValidationError] | Unset): + """ + + detail: list[ValidationError] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + detail: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.detail, Unset): + detail = [] + for detail_item_data in self.detail: + detail_item = detail_item_data.to_dict() + detail.append(detail_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if detail is not UNSET: + field_dict["detail"] = detail + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error import ValidationError + + d = dict(src_dict) + _detail = d.pop("detail", UNSET) + detail: list[ValidationError] | Unset = UNSET + if _detail is not UNSET: + detail = [] + for detail_item_data in _detail: + detail_item = ValidationError.from_dict(detail_item_data) + + detail.append(detail_item) + + http_validation_error = cls( + detail=detail, + ) + + http_validation_error.additional_properties = d + return http_validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder.py new file mode 100644 index 0000000..c9ee625 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.if_placeholder_structure import IfPlaceholderStructure + + +T = TypeVar("T", bound="IfPlaceholder") + + +@_attrs_define +class IfPlaceholder: + """ + Attributes: + if_ (IfPlaceholderStructure): + """ + + if_: IfPlaceholderStructure + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + if_ = self.if_.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "if": if_, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.if_placeholder_structure import IfPlaceholderStructure + + d = dict(src_dict) + if_ = IfPlaceholderStructure.from_dict(d.pop("if")) + + if_placeholder = cls( + if_=if_, + ) + + if_placeholder.additional_properties = d + return if_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder_structure.py b/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder_structure.py new file mode 100644 index 0000000..6684a20 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/if_placeholder_structure.py @@ -0,0 +1,353 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.is_present_placeholder import IsPresentPlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + +T = TypeVar("T", bound="IfPlaceholderStructure") + + +@_attrs_define +class IfPlaceholderStructure: + """ + Attributes: + cond (bool | InputValuePlaceholder | IsPresentPlaceholder | str): + then (list[ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | + OutputPathPlaceholder | str]): + else_ (list[ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | + OutputPathPlaceholder | str] | None | Unset): + """ + + cond: bool | InputValuePlaceholder | IsPresentPlaceholder | str + then: list[ + ConcatPlaceholder | IfPlaceholder | InputPathPlaceholder | InputValuePlaceholder | OutputPathPlaceholder | str + ] + else_: ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ) = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.is_present_placeholder import IsPresentPlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + cond: bool | dict[str, Any] | str + if isinstance(self.cond, IsPresentPlaceholder): + cond = self.cond.to_dict() + elif isinstance(self.cond, InputValuePlaceholder): + cond = self.cond.to_dict() + else: + cond = self.cond + + then = [] + for then_item_data in self.then: + then_item: dict[str, Any] | str + if isinstance(then_item_data, InputValuePlaceholder): + then_item = then_item_data.to_dict() + elif isinstance(then_item_data, InputPathPlaceholder): + then_item = then_item_data.to_dict() + elif isinstance(then_item_data, OutputPathPlaceholder): + then_item = then_item_data.to_dict() + elif isinstance(then_item_data, ConcatPlaceholder): + then_item = then_item_data.to_dict() + elif isinstance(then_item_data, IfPlaceholder): + then_item = then_item_data.to_dict() + else: + then_item = then_item_data + then.append(then_item) + + else_: list[dict[str, Any] | str] | None | Unset + if isinstance(self.else_, Unset): + else_ = UNSET + elif isinstance(self.else_, list): + else_ = [] + for else_type_0_item_data in self.else_: + else_type_0_item: dict[str, Any] | str + if isinstance(else_type_0_item_data, InputValuePlaceholder): + else_type_0_item = else_type_0_item_data.to_dict() + elif isinstance(else_type_0_item_data, InputPathPlaceholder): + else_type_0_item = else_type_0_item_data.to_dict() + elif isinstance(else_type_0_item_data, OutputPathPlaceholder): + else_type_0_item = else_type_0_item_data.to_dict() + elif isinstance(else_type_0_item_data, ConcatPlaceholder): + else_type_0_item = else_type_0_item_data.to_dict() + elif isinstance(else_type_0_item_data, IfPlaceholder): + else_type_0_item = else_type_0_item_data.to_dict() + else: + else_type_0_item = else_type_0_item_data + else_.append(else_type_0_item) + + else: + else_ = self.else_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cond": cond, + "then": then, + } + ) + if else_ is not UNSET: + field_dict["else"] = else_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.concat_placeholder import ConcatPlaceholder + from ..models.if_placeholder import IfPlaceholder + from ..models.input_path_placeholder import InputPathPlaceholder + from ..models.input_value_placeholder import InputValuePlaceholder + from ..models.is_present_placeholder import IsPresentPlaceholder + from ..models.output_path_placeholder import OutputPathPlaceholder + + d = dict(src_dict) + + def _parse_cond(data: object) -> bool | InputValuePlaceholder | IsPresentPlaceholder | str: + try: + if not isinstance(data, dict): + raise TypeError() + cond_type_2 = IsPresentPlaceholder.from_dict(data) + + return cond_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + cond_type_3 = InputValuePlaceholder.from_dict(data) + + return cond_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(bool | InputValuePlaceholder | IsPresentPlaceholder | str, data) + + cond = _parse_cond(d.pop("cond")) + + then = [] + _then = d.pop("then") + for then_item_data in _then: + + def _parse_then_item( + data: object, + ) -> ( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ): + try: + if not isinstance(data, dict): + raise TypeError() + then_item_type_1 = InputValuePlaceholder.from_dict(data) + + return then_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + then_item_type_2 = InputPathPlaceholder.from_dict(data) + + return then_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + then_item_type_3 = OutputPathPlaceholder.from_dict(data) + + return then_item_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + then_item_type_4 = ConcatPlaceholder.from_dict(data) + + return then_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + then_item_type_5 = IfPlaceholder.from_dict(data) + + return then_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str, + data, + ) + + then_item = _parse_then_item(then_item_data) + + then.append(then_item) + + def _parse_else_( + data: object, + ) -> ( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset + ): + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + else_type_0 = [] + _else_type_0 = data + for else_type_0_item_data in _else_type_0: + + def _parse_else_type_0_item( + data: object, + ) -> ( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ): + try: + if not isinstance(data, dict): + raise TypeError() + else_type_0_item_type_1 = InputValuePlaceholder.from_dict(data) + + return else_type_0_item_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + else_type_0_item_type_2 = InputPathPlaceholder.from_dict(data) + + return else_type_0_item_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + else_type_0_item_type_3 = OutputPathPlaceholder.from_dict(data) + + return else_type_0_item_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + else_type_0_item_type_4 = ConcatPlaceholder.from_dict(data) + + return else_type_0_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + else_type_0_item_type_5 = IfPlaceholder.from_dict(data) + + return else_type_0_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str, + data, + ) + + else_type_0_item = _parse_else_type_0_item(else_type_0_item_data) + + else_type_0.append(else_type_0_item) + + return else_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + list[ + ConcatPlaceholder + | IfPlaceholder + | InputPathPlaceholder + | InputValuePlaceholder + | OutputPathPlaceholder + | str + ] + | None + | Unset, + data, + ) + + else_ = _parse_else_(d.pop("else", UNSET)) + + if_placeholder_structure = cls( + cond=cond, + then=then, + else_=else_, + ) + + if_placeholder_structure.additional_properties = d + return if_placeholder_structure + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/input_path_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/input_path_placeholder.py new file mode 100644 index 0000000..ddae485 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/input_path_placeholder.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="InputPathPlaceholder") + + +@_attrs_define +class InputPathPlaceholder: + """ + Attributes: + input_path (str): + """ + + input_path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + input_path = self.input_path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "inputPath": input_path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + input_path = d.pop("inputPath") + + input_path_placeholder = cls( + input_path=input_path, + ) + + input_path_placeholder.additional_properties = d + return input_path_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/input_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/input_spec.py new file mode 100644 index 0000000..aa0b53c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/input_spec.py @@ -0,0 +1,205 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.input_spec_annotations_type_0 import InputSpecAnnotationsType0 + from ..models.input_spec_type_type_1 import InputSpecTypeType1 + + +T = TypeVar("T", bound="InputSpec") + + +@_attrs_define +class InputSpec: + """ + Attributes: + name (str): + type_ (InputSpecTypeType1 | list[Any] | None | str | Unset): + description (None | str | Unset): + default (None | str | Unset): + optional (bool | None | Unset): Default: False. + annotations (InputSpecAnnotationsType0 | None | Unset): + """ + + name: str + type_: InputSpecTypeType1 | list[Any] | None | str | Unset = UNSET + description: None | str | Unset = UNSET + default: None | str | Unset = UNSET + optional: bool | None | Unset = False + annotations: InputSpecAnnotationsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.input_spec_annotations_type_0 import InputSpecAnnotationsType0 + from ..models.input_spec_type_type_1 import InputSpecTypeType1 + + name = self.name + + type_: dict[str, Any] | list[Any] | None | str | Unset + if isinstance(self.type_, Unset): + type_ = UNSET + elif isinstance(self.type_, InputSpecTypeType1): + type_ = self.type_.to_dict() + elif isinstance(self.type_, list): + type_ = self.type_ + + else: + type_ = self.type_ + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + default: None | str | Unset + if isinstance(self.default, Unset): + default = UNSET + else: + default = self.default + + optional: bool | None | Unset + if isinstance(self.optional, Unset): + optional = UNSET + else: + optional = self.optional + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, InputSpecAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if type_ is not UNSET: + field_dict["type"] = type_ + if description is not UNSET: + field_dict["description"] = description + if default is not UNSET: + field_dict["default"] = default + if optional is not UNSET: + field_dict["optional"] = optional + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.input_spec_annotations_type_0 import InputSpecAnnotationsType0 + from ..models.input_spec_type_type_1 import InputSpecTypeType1 + + d = dict(src_dict) + name = d.pop("name") + + def _parse_type_(data: object) -> InputSpecTypeType1 | list[Any] | None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + type_type_1 = InputSpecTypeType1.from_dict(data) + + return type_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, list): + raise TypeError() + type_type_2 = cast(list[Any], data) + + return type_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(InputSpecTypeType1 | list[Any] | None | str | Unset, data) + + type_ = _parse_type_(d.pop("type", UNSET)) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_default(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + default = _parse_default(d.pop("default", UNSET)) + + def _parse_optional(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + optional = _parse_optional(d.pop("optional", UNSET)) + + def _parse_annotations(data: object) -> InputSpecAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = InputSpecAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(InputSpecAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + input_spec = cls( + name=name, + type_=type_, + description=description, + default=default, + optional=optional, + annotations=annotations, + ) + + input_spec.additional_properties = d + return input_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/input_spec_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/input_spec_annotations_type_0.py new file mode 100644 index 0000000..0681fc8 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/input_spec_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="InputSpecAnnotationsType0") + + +@_attrs_define +class InputSpecAnnotationsType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + input_spec_annotations_type_0 = cls() + + input_spec_annotations_type_0.additional_properties = d + return input_spec_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/input_spec_type_type_1.py b/tangle_cli/api/_tangle_api_client_lib/models/input_spec_type_type_1.py new file mode 100644 index 0000000..53e5ef0 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/input_spec_type_type_1.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="InputSpecTypeType1") + + +@_attrs_define +class InputSpecTypeType1: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + input_spec_type_type_1 = cls() + + input_spec_type_type_1.additional_properties = d + return input_spec_type_type_1 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/input_value_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/input_value_placeholder.py new file mode 100644 index 0000000..7308050 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/input_value_placeholder.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="InputValuePlaceholder") + + +@_attrs_define +class InputValuePlaceholder: + """ + Attributes: + input_value (str): + """ + + input_value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + input_value = self.input_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "inputValue": input_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + input_value = d.pop("inputValue") + + input_value_placeholder = cls( + input_value=input_value, + ) + + input_value_placeholder.additional_properties = d + return input_value_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/is_present_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/is_present_placeholder.py new file mode 100644 index 0000000..6c6fc04 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/is_present_placeholder.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="IsPresentPlaceholder") + + +@_attrs_define +class IsPresentPlaceholder: + """ + Attributes: + is_present (str): + """ + + is_present: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + is_present = self.is_present + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "isPresent": is_present, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_present = d.pop("isPresent") + + is_present_placeholder = cls( + is_present=is_present, + ) + + is_present_placeholder.additional_properties = d + return is_present_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get.py b/tangle_cli/api/_tangle_api_client_lib/models/list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get.py new file mode 100644 index 0000000..3f6f3a2 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar( + "T", bound="ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet" +) + + +@_attrs_define +class ListAnnotationsApiPipelineRunsIdAnnotationsGetResponseListAnnotationsApiPipelineRunsIdAnnotationsGet: + """ """ + + additional_properties: dict[str, None | str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get.additional_properties = additional_properties + return list_annotations_api_pipeline_runs_id_annotations_get_response_list_annotations_api_pipeline_runs_id_annotations_get + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> None | str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: None | str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/list_component_libraries_response.py b/tangle_cli/api/_tangle_api_client_lib/models/list_component_libraries_response.py new file mode 100644 index 0000000..228a82a --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/list_component_libraries_response.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.component_library_response import ComponentLibraryResponse + + +T = TypeVar("T", bound="ListComponentLibrariesResponse") + + +@_attrs_define +class ListComponentLibrariesResponse: + """ + Attributes: + component_libraries (list[ComponentLibraryResponse]): + """ + + component_libraries: list[ComponentLibraryResponse] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_libraries = [] + for component_libraries_item_data in self.component_libraries: + component_libraries_item = component_libraries_item_data.to_dict() + component_libraries.append(component_libraries_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "component_libraries": component_libraries, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_library_response import ComponentLibraryResponse + + d = dict(src_dict) + component_libraries = [] + _component_libraries = d.pop("component_libraries") + for component_libraries_item_data in _component_libraries: + component_libraries_item = ComponentLibraryResponse.from_dict(component_libraries_item_data) + + component_libraries.append(component_libraries_item) + + list_component_libraries_response = cls( + component_libraries=component_libraries, + ) + + list_component_libraries_response.additional_properties = d + return list_component_libraries_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/list_pipeline_jobs_response.py b/tangle_cli/api/_tangle_api_client_lib/models/list_pipeline_jobs_response.py new file mode 100644 index 0000000..f30ff88 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/list_pipeline_jobs_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pipeline_run_response import PipelineRunResponse + + +T = TypeVar("T", bound="ListPipelineJobsResponse") + + +@_attrs_define +class ListPipelineJobsResponse: + """ + Attributes: + pipeline_runs (list[PipelineRunResponse]): + next_page_token (None | str | Unset): + """ + + pipeline_runs: list[PipelineRunResponse] + next_page_token: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + pipeline_runs = [] + for pipeline_runs_item_data in self.pipeline_runs: + pipeline_runs_item = pipeline_runs_item_data.to_dict() + pipeline_runs.append(pipeline_runs_item) + + next_page_token: None | str | Unset + if isinstance(self.next_page_token, Unset): + next_page_token = UNSET + else: + next_page_token = self.next_page_token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "pipeline_runs": pipeline_runs, + } + ) + if next_page_token is not UNSET: + field_dict["next_page_token"] = next_page_token + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pipeline_run_response import PipelineRunResponse + + d = dict(src_dict) + pipeline_runs = [] + _pipeline_runs = d.pop("pipeline_runs") + for pipeline_runs_item_data in _pipeline_runs: + pipeline_runs_item = PipelineRunResponse.from_dict(pipeline_runs_item_data) + + pipeline_runs.append(pipeline_runs_item) + + def _parse_next_page_token(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + next_page_token = _parse_next_page_token(d.pop("next_page_token", UNSET)) + + list_pipeline_jobs_response = cls( + pipeline_runs=pipeline_runs, + next_page_token=next_page_token, + ) + + list_pipeline_jobs_response.additional_properties = d + return list_pipeline_jobs_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/list_published_components_response.py b/tangle_cli/api/_tangle_api_client_lib/models/list_published_components_response.py new file mode 100644 index 0000000..8dc296c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/list_published_components_response.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.published_component_response import PublishedComponentResponse + + +T = TypeVar("T", bound="ListPublishedComponentsResponse") + + +@_attrs_define +class ListPublishedComponentsResponse: + """ + Attributes: + published_components (list[PublishedComponentResponse]): + """ + + published_components: list[PublishedComponentResponse] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + published_components = [] + for published_components_item_data in self.published_components: + published_components_item = published_components_item_data.to_dict() + published_components.append(published_components_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "published_components": published_components, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.published_component_response import PublishedComponentResponse + + d = dict(src_dict) + published_components = [] + _published_components = d.pop("published_components") + for published_components_item_data in _published_components: + published_components_item = PublishedComponentResponse.from_dict(published_components_item_data) + + published_components.append(published_components_item) + + list_published_components_response = cls( + published_components=published_components, + ) + + list_published_components_response.additional_properties = d + return list_published_components_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/list_secrets_response.py b/tangle_cli/api/_tangle_api_client_lib/models/list_secrets_response.py new file mode 100644 index 0000000..c0f5822 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/list_secrets_response.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.secret_info_response import SecretInfoResponse + + +T = TypeVar("T", bound="ListSecretsResponse") + + +@_attrs_define +class ListSecretsResponse: + """ + Attributes: + secrets (list[SecretInfoResponse]): + """ + + secrets: list[SecretInfoResponse] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + secrets = [] + for secrets_item_data in self.secrets: + secrets_item = secrets_item_data.to_dict() + secrets.append(secrets_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "secrets": secrets, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.secret_info_response import SecretInfoResponse + + d = dict(src_dict) + secrets = [] + _secrets = d.pop("secrets") + for secrets_item_data in _secrets: + secrets_item = SecretInfoResponse.from_dict(secrets_item_data) + + secrets.append(secrets_item) + + list_secrets_response = cls( + secrets=secrets, + ) + + list_secrets_response.additional_properties = d + return list_secrets_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec.py new file mode 100644 index 0000000..6f0e710 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.metadata_spec_annotations_type_0 import MetadataSpecAnnotationsType0 + from ..models.metadata_spec_labels_type_0 import MetadataSpecLabelsType0 + + +T = TypeVar("T", bound="MetadataSpec") + + +@_attrs_define +class MetadataSpec: + """ + Attributes: + annotations (MetadataSpecAnnotationsType0 | None | Unset): + labels (MetadataSpecLabelsType0 | None | Unset): + """ + + annotations: MetadataSpecAnnotationsType0 | None | Unset = UNSET + labels: MetadataSpecLabelsType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.metadata_spec_annotations_type_0 import MetadataSpecAnnotationsType0 + from ..models.metadata_spec_labels_type_0 import MetadataSpecLabelsType0 + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, MetadataSpecAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + labels: dict[str, Any] | None | Unset + if isinstance(self.labels, Unset): + labels = UNSET + elif isinstance(self.labels, MetadataSpecLabelsType0): + labels = self.labels.to_dict() + else: + labels = self.labels + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if annotations is not UNSET: + field_dict["annotations"] = annotations + if labels is not UNSET: + field_dict["labels"] = labels + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.metadata_spec_annotations_type_0 import MetadataSpecAnnotationsType0 + from ..models.metadata_spec_labels_type_0 import MetadataSpecLabelsType0 + + d = dict(src_dict) + + def _parse_annotations(data: object) -> MetadataSpecAnnotationsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = MetadataSpecAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MetadataSpecAnnotationsType0 | None | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + def _parse_labels(data: object) -> MetadataSpecLabelsType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + labels_type_0 = MetadataSpecLabelsType0.from_dict(data) + + return labels_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(MetadataSpecLabelsType0 | None | Unset, data) + + labels = _parse_labels(d.pop("labels", UNSET)) + + metadata_spec = cls( + annotations=annotations, + labels=labels, + ) + + metadata_spec.additional_properties = d + return metadata_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_annotations_type_0.py new file mode 100644 index 0000000..89f4ebb --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MetadataSpecAnnotationsType0") + + +@_attrs_define +class MetadataSpecAnnotationsType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + metadata_spec_annotations_type_0 = cls() + + metadata_spec_annotations_type_0.additional_properties = d + return metadata_spec_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_labels_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_labels_type_0.py new file mode 100644 index 0000000..f5a2a4c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/metadata_spec_labels_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="MetadataSpecLabelsType0") + + +@_attrs_define +class MetadataSpecLabelsType0: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + metadata_spec_labels_type_0 = cls() + + metadata_spec_labels_type_0.additional_properties = d + return metadata_spec_labels_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/output_path_placeholder.py b/tangle_cli/api/_tangle_api_client_lib/models/output_path_placeholder.py new file mode 100644 index 0000000..0a78241 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/output_path_placeholder.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OutputPathPlaceholder") + + +@_attrs_define +class OutputPathPlaceholder: + """ + Attributes: + output_path (str): + """ + + output_path: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + output_path = self.output_path + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "outputPath": output_path, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + output_path = d.pop("outputPath") + + output_path_placeholder = cls( + output_path=output_path, + ) + + output_path_placeholder.additional_properties = d + return output_path_placeholder + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/output_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/output_spec.py new file mode 100644 index 0000000..f91ac28 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/output_spec.py @@ -0,0 +1,165 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.output_spec_annotations_type_0 import OutputSpecAnnotationsType0 + from ..models.output_spec_type_type_1 import OutputSpecTypeType1 + + +T = TypeVar("T", bound="OutputSpec") + + +@_attrs_define +class OutputSpec: + """ + Attributes: + name (str): + type_ (list[Any] | None | OutputSpecTypeType1 | str | Unset): + description (None | str | Unset): + annotations (None | OutputSpecAnnotationsType0 | Unset): + """ + + name: str + type_: list[Any] | None | OutputSpecTypeType1 | str | Unset = UNSET + description: None | str | Unset = UNSET + annotations: None | OutputSpecAnnotationsType0 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.output_spec_annotations_type_0 import OutputSpecAnnotationsType0 + from ..models.output_spec_type_type_1 import OutputSpecTypeType1 + + name = self.name + + type_: dict[str, Any] | list[Any] | None | str | Unset + if isinstance(self.type_, Unset): + type_ = UNSET + elif isinstance(self.type_, OutputSpecTypeType1): + type_ = self.type_.to_dict() + elif isinstance(self.type_, list): + type_ = self.type_ + + else: + type_ = self.type_ + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, OutputSpecAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if type_ is not UNSET: + field_dict["type"] = type_ + if description is not UNSET: + field_dict["description"] = description + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.output_spec_annotations_type_0 import OutputSpecAnnotationsType0 + from ..models.output_spec_type_type_1 import OutputSpecTypeType1 + + d = dict(src_dict) + name = d.pop("name") + + def _parse_type_(data: object) -> list[Any] | None | OutputSpecTypeType1 | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + type_type_1 = OutputSpecTypeType1.from_dict(data) + + return type_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, list): + raise TypeError() + type_type_2 = cast(list[Any], data) + + return type_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[Any] | None | OutputSpecTypeType1 | str | Unset, data) + + type_ = _parse_type_(d.pop("type", UNSET)) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_annotations(data: object) -> None | OutputSpecAnnotationsType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = OutputSpecAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | OutputSpecAnnotationsType0 | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + output_spec = cls( + name=name, + type_=type_, + description=description, + annotations=annotations, + ) + + output_spec.additional_properties = d + return output_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/output_spec_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/output_spec_annotations_type_0.py new file mode 100644 index 0000000..05aed0d --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/output_spec_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OutputSpecAnnotationsType0") + + +@_attrs_define +class OutputSpecAnnotationsType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + output_spec_annotations_type_0 = cls() + + output_spec_annotations_type_0.additional_properties = d + return output_spec_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/output_spec_type_type_1.py b/tangle_cli/api/_tangle_api_client_lib/models/output_spec_type_type_1.py new file mode 100644 index 0000000..bdc046a --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/output_spec_type_type_1.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OutputSpecTypeType1") + + +@_attrs_define +class OutputSpecTypeType1: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + output_spec_type_type_1 = cls() + + output_spec_type_type_1.additional_properties = d + return output_spec_type_type_1 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response.py b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response.py new file mode 100644 index 0000000..2da85b3 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response.py @@ -0,0 +1,252 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.execution_status_summary import ExecutionStatusSummary + from ..models.pipeline_run_response_annotations_type_0 import PipelineRunResponseAnnotationsType0 + from ..models.pipeline_run_response_execution_status_stats_type_0 import ( + PipelineRunResponseExecutionStatusStatsType0, + ) + + +T = TypeVar("T", bound="PipelineRunResponse") + + +@_attrs_define +class PipelineRunResponse: + """ + Attributes: + id (str): + root_execution_id (str): + annotations (None | PipelineRunResponseAnnotationsType0 | Unset): + created_by (None | str | Unset): + created_at (datetime.datetime | None | Unset): + pipeline_name (None | str | Unset): + execution_status_stats (None | PipelineRunResponseExecutionStatusStatsType0 | Unset): + execution_summary (ExecutionStatusSummary | None | Unset): + """ + + id: str + root_execution_id: str + annotations: None | PipelineRunResponseAnnotationsType0 | Unset = UNSET + created_by: None | str | Unset = UNSET + created_at: datetime.datetime | None | Unset = UNSET + pipeline_name: None | str | Unset = UNSET + execution_status_stats: None | PipelineRunResponseExecutionStatusStatsType0 | Unset = UNSET + execution_summary: ExecutionStatusSummary | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.execution_status_summary import ExecutionStatusSummary + from ..models.pipeline_run_response_annotations_type_0 import PipelineRunResponseAnnotationsType0 + from ..models.pipeline_run_response_execution_status_stats_type_0 import ( + PipelineRunResponseExecutionStatusStatsType0, + ) + + id = self.id + + root_execution_id = self.root_execution_id + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, PipelineRunResponseAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + created_at: None | str | Unset + if isinstance(self.created_at, Unset): + created_at = UNSET + elif isinstance(self.created_at, datetime.datetime): + created_at = self.created_at.isoformat() + else: + created_at = self.created_at + + pipeline_name: None | str | Unset + if isinstance(self.pipeline_name, Unset): + pipeline_name = UNSET + else: + pipeline_name = self.pipeline_name + + execution_status_stats: dict[str, Any] | None | Unset + if isinstance(self.execution_status_stats, Unset): + execution_status_stats = UNSET + elif isinstance(self.execution_status_stats, PipelineRunResponseExecutionStatusStatsType0): + execution_status_stats = self.execution_status_stats.to_dict() + else: + execution_status_stats = self.execution_status_stats + + execution_summary: dict[str, Any] | None | Unset + if isinstance(self.execution_summary, Unset): + execution_summary = UNSET + elif isinstance(self.execution_summary, ExecutionStatusSummary): + execution_summary = self.execution_summary.to_dict() + else: + execution_summary = self.execution_summary + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "root_execution_id": root_execution_id, + } + ) + if annotations is not UNSET: + field_dict["annotations"] = annotations + if created_by is not UNSET: + field_dict["created_by"] = created_by + if created_at is not UNSET: + field_dict["created_at"] = created_at + if pipeline_name is not UNSET: + field_dict["pipeline_name"] = pipeline_name + if execution_status_stats is not UNSET: + field_dict["execution_status_stats"] = execution_status_stats + if execution_summary is not UNSET: + field_dict["execution_summary"] = execution_summary + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.execution_status_summary import ExecutionStatusSummary + from ..models.pipeline_run_response_annotations_type_0 import PipelineRunResponseAnnotationsType0 + from ..models.pipeline_run_response_execution_status_stats_type_0 import ( + PipelineRunResponseExecutionStatusStatsType0, + ) + + d = dict(src_dict) + id = d.pop("id") + + root_execution_id = d.pop("root_execution_id") + + def _parse_annotations(data: object) -> None | PipelineRunResponseAnnotationsType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = PipelineRunResponseAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PipelineRunResponseAnnotationsType0 | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("created_by", UNSET)) + + def _parse_created_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + created_at_type_0 = datetime.datetime.fromisoformat(data) + + return created_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_pipeline_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + pipeline_name = _parse_pipeline_name(d.pop("pipeline_name", UNSET)) + + def _parse_execution_status_stats(data: object) -> None | PipelineRunResponseExecutionStatusStatsType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + execution_status_stats_type_0 = PipelineRunResponseExecutionStatusStatsType0.from_dict(data) + + return execution_status_stats_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PipelineRunResponseExecutionStatusStatsType0 | Unset, data) + + execution_status_stats = _parse_execution_status_stats(d.pop("execution_status_stats", UNSET)) + + def _parse_execution_summary(data: object) -> ExecutionStatusSummary | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + execution_summary_type_0 = ExecutionStatusSummary.from_dict(data) + + return execution_summary_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ExecutionStatusSummary | None | Unset, data) + + execution_summary = _parse_execution_summary(d.pop("execution_summary", UNSET)) + + pipeline_run_response = cls( + id=id, + root_execution_id=root_execution_id, + annotations=annotations, + created_by=created_by, + created_at=created_at, + pipeline_name=pipeline_name, + execution_status_stats=execution_status_stats, + execution_summary=execution_summary, + ) + + pipeline_run_response.additional_properties = d + return pipeline_run_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_annotations_type_0.py new file mode 100644 index 0000000..e066d0d --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PipelineRunResponseAnnotationsType0") + + +@_attrs_define +class PipelineRunResponseAnnotationsType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + pipeline_run_response_annotations_type_0 = cls() + + pipeline_run_response_annotations_type_0.additional_properties = d + return pipeline_run_response_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_execution_status_stats_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_execution_status_stats_type_0.py new file mode 100644 index 0000000..1e4f92f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/pipeline_run_response_execution_status_stats_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PipelineRunResponseExecutionStatusStatsType0") + + +@_attrs_define +class PipelineRunResponseExecutionStatusStatsType0: + """ """ + + additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + pipeline_run_response_execution_status_stats_type_0 = cls() + + pipeline_run_response_execution_status_stats_type_0.additional_properties = d + return pipeline_run_response_execution_status_stats_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> int: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: int) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/published_component_response.py b/tangle_cli/api/_tangle_api_client_lib/models/published_component_response.py new file mode 100644 index 0000000..1c570d7 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/published_component_response.py @@ -0,0 +1,140 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PublishedComponentResponse") + + +@_attrs_define +class PublishedComponentResponse: + """ + Attributes: + digest (str): + published_by (str): + deprecated (bool | Unset): Default: False. + superseded_by (None | str | Unset): + url (None | str | Unset): + name (None | str | Unset): + """ + + digest: str + published_by: str + deprecated: bool | Unset = False + superseded_by: None | str | Unset = UNSET + url: None | str | Unset = UNSET + name: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + digest = self.digest + + published_by = self.published_by + + deprecated = self.deprecated + + superseded_by: None | str | Unset + if isinstance(self.superseded_by, Unset): + superseded_by = UNSET + else: + superseded_by = self.superseded_by + + url: None | str | Unset + if isinstance(self.url, Unset): + url = UNSET + else: + url = self.url + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "digest": digest, + "published_by": published_by, + } + ) + if deprecated is not UNSET: + field_dict["deprecated"] = deprecated + if superseded_by is not UNSET: + field_dict["superseded_by"] = superseded_by + if url is not UNSET: + field_dict["url"] = url + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + digest = d.pop("digest") + + published_by = d.pop("published_by") + + deprecated = d.pop("deprecated", UNSET) + + def _parse_superseded_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + superseded_by = _parse_superseded_by(d.pop("superseded_by", UNSET)) + + def _parse_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + url = _parse_url(d.pop("url", UNSET)) + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + published_component_response = cls( + digest=digest, + published_by=published_by, + deprecated=deprecated, + superseded_by=superseded_by, + url=url, + name=name, + ) + + published_component_response.additional_properties = d + return published_component_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/retry_strategy_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/retry_strategy_spec.py new file mode 100644 index 0000000..a205e74 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/retry_strategy_spec.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RetryStrategySpec") + + +@_attrs_define +class RetryStrategySpec: + """ + Attributes: + max_retries (int): + """ + + max_retries: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + max_retries = self.max_retries + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "maxRetries": max_retries, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + max_retries = d.pop("maxRetries") + + retry_strategy_spec = cls( + max_retries=max_retries, + ) + + retry_strategy_spec.additional_properties = d + return retry_strategy_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/secret_info_response.py b/tangle_cli/api/_tangle_api_client_lib/models/secret_info_response.py new file mode 100644 index 0000000..9feb2e9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/secret_info_response.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SecretInfoResponse") + + +@_attrs_define +class SecretInfoResponse: + """ + Attributes: + secret_name (str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + expires_at (datetime.datetime | None | Unset): + description (None | str | Unset): + """ + + secret_name: str + created_at: datetime.datetime + updated_at: datetime.datetime + expires_at: datetime.datetime | None | Unset = UNSET + description: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + secret_name = self.secret_name + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + expires_at: None | str | Unset + if isinstance(self.expires_at, Unset): + expires_at = UNSET + elif isinstance(self.expires_at, datetime.datetime): + expires_at = self.expires_at.isoformat() + else: + expires_at = self.expires_at + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "secret_name": secret_name, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + secret_name = d.pop("secret_name") + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + expires_at_type_0 = datetime.datetime.fromisoformat(data) + + return expires_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + secret_info_response = cls( + secret_name=secret_name, + created_at=created_at, + updated_at=updated_at, + expires_at=expires_at, + description=description, + ) + + secret_info_response.additional_properties = d + return secret_info_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/task_output_argument.py b/tangle_cli/api/_tangle_api_client_lib/models/task_output_argument.py new file mode 100644 index 0000000..d5b792c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/task_output_argument.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.task_output_reference import TaskOutputReference + + +T = TypeVar("T", bound="TaskOutputArgument") + + +@_attrs_define +class TaskOutputArgument: + """ + Attributes: + task_output (TaskOutputReference): + """ + + task_output: TaskOutputReference + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + task_output = self.task_output.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "taskOutput": task_output, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.task_output_reference import TaskOutputReference + + d = dict(src_dict) + task_output = TaskOutputReference.from_dict(d.pop("taskOutput")) + + task_output_argument = cls( + task_output=task_output, + ) + + task_output_argument.additional_properties = d + return task_output_argument + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/task_output_reference.py b/tangle_cli/api/_tangle_api_client_lib/models/task_output_reference.py new file mode 100644 index 0000000..0274092 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/task_output_reference.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TaskOutputReference") + + +@_attrs_define +class TaskOutputReference: + """ + Attributes: + output_name (str): + task_id (str): + """ + + output_name: str + task_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + output_name = self.output_name + + task_id = self.task_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "outputName": output_name, + "taskId": task_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + output_name = d.pop("outputName") + + task_id = d.pop("taskId") + + task_output_reference = cls( + output_name=output_name, + task_id=task_id, + ) + + task_output_reference.additional_properties = d + return task_output_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/task_spec.py b/tangle_cli/api/_tangle_api_client_lib/models/task_spec.py new file mode 100644 index 0000000..2b54e89 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/task_spec.py @@ -0,0 +1,230 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.component_reference import ComponentReference + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.execution_options_spec import ExecutionOptionsSpec + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + from ..models.task_spec_annotations_type_0 import TaskSpecAnnotationsType0 + from ..models.task_spec_arguments_type_0 import TaskSpecArgumentsType0 + + +T = TypeVar("T", bound="TaskSpec") + + +@_attrs_define +class TaskSpec: + """ + Attributes: + component_ref (ComponentReference): + arguments (None | TaskSpecArgumentsType0 | Unset): + is_enabled (DynamicDataArgument | GraphInputArgument | None | str | TaskOutputArgument | Unset): + execution_options (ExecutionOptionsSpec | None | Unset): + annotations (None | TaskSpecAnnotationsType0 | Unset): + """ + + component_ref: ComponentReference + arguments: None | TaskSpecArgumentsType0 | Unset = UNSET + is_enabled: DynamicDataArgument | GraphInputArgument | None | str | TaskOutputArgument | Unset = UNSET + execution_options: ExecutionOptionsSpec | None | Unset = UNSET + annotations: None | TaskSpecAnnotationsType0 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.execution_options_spec import ExecutionOptionsSpec + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + from ..models.task_spec_annotations_type_0 import TaskSpecAnnotationsType0 + from ..models.task_spec_arguments_type_0 import TaskSpecArgumentsType0 + + component_ref = self.component_ref.to_dict() + + arguments: dict[str, Any] | None | Unset + if isinstance(self.arguments, Unset): + arguments = UNSET + elif isinstance(self.arguments, TaskSpecArgumentsType0): + arguments = self.arguments.to_dict() + else: + arguments = self.arguments + + is_enabled: dict[str, Any] | None | str | Unset + if isinstance(self.is_enabled, Unset): + is_enabled = UNSET + elif isinstance(self.is_enabled, GraphInputArgument): + is_enabled = self.is_enabled.to_dict() + elif isinstance(self.is_enabled, TaskOutputArgument): + is_enabled = self.is_enabled.to_dict() + elif isinstance(self.is_enabled, DynamicDataArgument): + is_enabled = self.is_enabled.to_dict() + else: + is_enabled = self.is_enabled + + execution_options: dict[str, Any] | None | Unset + if isinstance(self.execution_options, Unset): + execution_options = UNSET + elif isinstance(self.execution_options, ExecutionOptionsSpec): + execution_options = self.execution_options.to_dict() + else: + execution_options = self.execution_options + + annotations: dict[str, Any] | None | Unset + if isinstance(self.annotations, Unset): + annotations = UNSET + elif isinstance(self.annotations, TaskSpecAnnotationsType0): + annotations = self.annotations.to_dict() + else: + annotations = self.annotations + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "componentRef": component_ref, + } + ) + if arguments is not UNSET: + field_dict["arguments"] = arguments + if is_enabled is not UNSET: + field_dict["isEnabled"] = is_enabled + if execution_options is not UNSET: + field_dict["executionOptions"] = execution_options + if annotations is not UNSET: + field_dict["annotations"] = annotations + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.component_reference import ComponentReference + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.execution_options_spec import ExecutionOptionsSpec + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + from ..models.task_spec_annotations_type_0 import TaskSpecAnnotationsType0 + from ..models.task_spec_arguments_type_0 import TaskSpecArgumentsType0 + + d = dict(src_dict) + component_ref = ComponentReference.from_dict(d.pop("componentRef")) + + def _parse_arguments(data: object) -> None | TaskSpecArgumentsType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + arguments_type_0 = TaskSpecArgumentsType0.from_dict(data) + + return arguments_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | TaskSpecArgumentsType0 | Unset, data) + + arguments = _parse_arguments(d.pop("arguments", UNSET)) + + def _parse_is_enabled( + data: object, + ) -> DynamicDataArgument | GraphInputArgument | None | str | TaskOutputArgument | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + is_enabled_type_1 = GraphInputArgument.from_dict(data) + + return is_enabled_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + is_enabled_type_2 = TaskOutputArgument.from_dict(data) + + return is_enabled_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + is_enabled_type_3 = DynamicDataArgument.from_dict(data) + + return is_enabled_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DynamicDataArgument | GraphInputArgument | None | str | TaskOutputArgument | Unset, data) + + is_enabled = _parse_is_enabled(d.pop("isEnabled", UNSET)) + + def _parse_execution_options(data: object) -> ExecutionOptionsSpec | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + execution_options_type_0 = ExecutionOptionsSpec.from_dict(data) + + return execution_options_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ExecutionOptionsSpec | None | Unset, data) + + execution_options = _parse_execution_options(d.pop("executionOptions", UNSET)) + + def _parse_annotations(data: object) -> None | TaskSpecAnnotationsType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + annotations_type_0 = TaskSpecAnnotationsType0.from_dict(data) + + return annotations_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | TaskSpecAnnotationsType0 | Unset, data) + + annotations = _parse_annotations(d.pop("annotations", UNSET)) + + task_spec = cls( + component_ref=component_ref, + arguments=arguments, + is_enabled=is_enabled, + execution_options=execution_options, + annotations=annotations, + ) + + task_spec.additional_properties = d + return task_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/task_spec_annotations_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/task_spec_annotations_type_0.py new file mode 100644 index 0000000..7cb7453 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/task_spec_annotations_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TaskSpecAnnotationsType0") + + +@_attrs_define +class TaskSpecAnnotationsType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + task_spec_annotations_type_0 = cls() + + task_spec_annotations_type_0.additional_properties = d + return task_spec_annotations_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/task_spec_arguments_type_0.py b/tangle_cli/api/_tangle_api_client_lib/models/task_spec_arguments_type_0.py new file mode 100644 index 0000000..03e5509 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/task_spec_arguments_type_0.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + +T = TypeVar("T", bound="TaskSpecArgumentsType0") + + +@_attrs_define +class TaskSpecArgumentsType0: + """ """ + + additional_properties: dict[str, DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument] = ( + _attrs_field(init=False, factory=dict) + ) + + def to_dict(self) -> dict[str, Any]: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + if isinstance(prop, GraphInputArgument): + field_dict[prop_name] = prop.to_dict() + elif isinstance(prop, TaskOutputArgument): + field_dict[prop_name] = prop.to_dict() + elif isinstance(prop, DynamicDataArgument): + field_dict[prop_name] = prop.to_dict() + else: + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.dynamic_data_argument import DynamicDataArgument + from ..models.graph_input_argument import GraphInputArgument + from ..models.task_output_argument import TaskOutputArgument + + d = dict(src_dict) + task_spec_arguments_type_0 = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + + def _parse_additional_property( + data: object, + ) -> DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument: + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_1 = GraphInputArgument.from_dict(data) + + return additional_property_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_2 = TaskOutputArgument.from_dict(data) + + return additional_property_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + additional_property_type_3 = DynamicDataArgument.from_dict(data) + + return additional_property_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument, data) + + additional_property = _parse_additional_property(prop_dict) + + additional_properties[prop_name] = additional_property + + task_spec_arguments_type_0.additional_properties = additional_properties + return task_spec_arguments_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: DynamicDataArgument | GraphInputArgument | str | TaskOutputArgument) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/user_component_library_pins_response.py b/tangle_cli/api/_tangle_api_client_lib/models/user_component_library_pins_response.py new file mode 100644 index 0000000..6da9de9 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/user_component_library_pins_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="UserComponentLibraryPinsResponse") + + +@_attrs_define +class UserComponentLibraryPinsResponse: + """ + Attributes: + component_library_ids (list[str]): + """ + + component_library_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_library_ids = self.component_library_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "component_library_ids": component_library_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + component_library_ids = cast(list[str], d.pop("component_library_ids")) + + user_component_library_pins_response = cls( + component_library_ids=component_library_ids, + ) + + user_component_library_pins_response.additional_properties = d + return user_component_library_pins_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response.py b/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response.py new file mode 100644 index 0000000..22d688c --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.user_settings_response_settings import UserSettingsResponseSettings + + +T = TypeVar("T", bound="UserSettingsResponse") + + +@_attrs_define +class UserSettingsResponse: + """ + Attributes: + settings (UserSettingsResponseSettings): + """ + + settings: UserSettingsResponseSettings + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + settings = self.settings.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "settings": settings, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user_settings_response_settings import UserSettingsResponseSettings + + d = dict(src_dict) + settings = UserSettingsResponseSettings.from_dict(d.pop("settings")) + + user_settings_response = cls( + settings=settings, + ) + + user_settings_response.additional_properties = d + return user_settings_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response_settings.py b/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response_settings.py new file mode 100644 index 0000000..3aa01e7 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/user_settings_response_settings.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="UserSettingsResponseSettings") + + +@_attrs_define +class UserSettingsResponseSettings: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_settings_response_settings = cls() + + user_settings_response_settings.additional_properties = d + return user_settings_response_settings + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/validation_error.py b/tangle_cli/api/_tangle_api_client_lib/models/validation_error.py new file mode 100644 index 0000000..6df5a45 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/validation_error.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_error_context import ValidationErrorContext + + +T = TypeVar("T", bound="ValidationError") + + +@_attrs_define +class ValidationError: + """ + Attributes: + loc (list[int | str]): + msg (str): + type_ (str): + input_ (Any | Unset): + ctx (ValidationErrorContext | Unset): + """ + + loc: list[int | str] + msg: str + type_: str + input_: Any | Unset = UNSET + ctx: ValidationErrorContext | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + loc = [] + for loc_item_data in self.loc: + loc_item: int | str + loc_item = loc_item_data + loc.append(loc_item) + + msg = self.msg + + type_ = self.type_ + + input_ = self.input_ + + ctx: dict[str, Any] | Unset = UNSET + if not isinstance(self.ctx, Unset): + ctx = self.ctx.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "loc": loc, + "msg": msg, + "type": type_, + } + ) + if input_ is not UNSET: + field_dict["input"] = input_ + if ctx is not UNSET: + field_dict["ctx"] = ctx + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.validation_error_context import ValidationErrorContext + + d = dict(src_dict) + loc = [] + _loc = d.pop("loc") + for loc_item_data in _loc: + + def _parse_loc_item(data: object) -> int | str: + return cast(int | str, data) + + loc_item = _parse_loc_item(loc_item_data) + + loc.append(loc_item) + + msg = d.pop("msg") + + type_ = d.pop("type") + + input_ = d.pop("input", UNSET) + + _ctx = d.pop("ctx", UNSET) + ctx: ValidationErrorContext | Unset + if isinstance(_ctx, Unset): + ctx = UNSET + else: + ctx = ValidationErrorContext.from_dict(_ctx) + + validation_error = cls( + loc=loc, + msg=msg, + type_=type_, + input_=input_, + ctx=ctx, + ) + + validation_error.additional_properties = d + return validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/models/validation_error_context.py b/tangle_cli/api/_tangle_api_client_lib/models/validation_error_context.py new file mode 100644 index 0000000..ef2d13f --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/models/validation_error_context.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidationErrorContext") + + +@_attrs_define +class ValidationErrorContext: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + validation_error_context = cls() + + validation_error_context.additional_properties = d + return validation_error_context + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/tangle_cli/api/_tangle_api_client_lib/types.py b/tangle_cli/api/_tangle_api_client_lib/types.py new file mode 100644 index 0000000..b64af09 --- /dev/null +++ b/tangle_cli/api/_tangle_api_client_lib/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]