diff --git a/nuon/api/installs/get_install_workflow_steps.py b/nuon/api/installs/get_install_workflow_steps.py index f1e88358..e22d5b9f 100644 --- a/nuon/api/installs/get_install_workflow_steps.py +++ b/nuon/api/installs/get_install_workflow_steps.py @@ -8,18 +8,33 @@ from ...client import AuthenticatedClient, Client from ...models.app_workflow_step import AppWorkflowStep from ...models.stderr_err_response import StderrErrResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( install_workflow_id: str, + *, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["offset"] = offset + + params["limit"] = limit + + params["page"] = page + + 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": "/v1/install-workflows/{install_workflow_id}/steps".format( install_workflow_id=quote(str(install_workflow_id), safe=""), ), + "params": params, } return _kwargs @@ -84,6 +99,9 @@ def sync_detailed( install_workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> Response[StderrErrResponse | list[AppWorkflowStep]]: """get all of the steps for a given install workflow @@ -91,6 +109,9 @@ def sync_detailed( Args: install_workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,6 +123,9 @@ def sync_detailed( kwargs = _get_kwargs( install_workflow_id=install_workflow_id, + offset=offset, + limit=limit, + page=page, ) response = client.get_httpx_client().request( @@ -115,6 +139,9 @@ def sync( install_workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> StderrErrResponse | list[AppWorkflowStep] | None: """get all of the steps for a given install workflow @@ -122,6 +149,9 @@ def sync( Args: install_workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,6 +164,9 @@ def sync( return sync_detailed( install_workflow_id=install_workflow_id, client=client, + offset=offset, + limit=limit, + page=page, ).parsed @@ -141,6 +174,9 @@ async def asyncio_detailed( install_workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> Response[StderrErrResponse | list[AppWorkflowStep]]: """get all of the steps for a given install workflow @@ -148,6 +184,9 @@ async def asyncio_detailed( Args: install_workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,6 +198,9 @@ async def asyncio_detailed( kwargs = _get_kwargs( install_workflow_id=install_workflow_id, + offset=offset, + limit=limit, + page=page, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -170,6 +212,9 @@ async def asyncio( install_workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> StderrErrResponse | list[AppWorkflowStep] | None: """get all of the steps for a given install workflow @@ -177,6 +222,9 @@ async def asyncio( Args: install_workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,5 +238,8 @@ async def asyncio( await asyncio_detailed( install_workflow_id=install_workflow_id, client=client, + offset=offset, + limit=limit, + page=page, ) ).parsed diff --git a/nuon/api/installs/get_workflow_steps.py b/nuon/api/installs/get_workflow_steps.py index 9bfb085b..aa34fb2a 100644 --- a/nuon/api/installs/get_workflow_steps.py +++ b/nuon/api/installs/get_workflow_steps.py @@ -8,18 +8,33 @@ from ...client import AuthenticatedClient, Client from ...models.app_workflow_step import AppWorkflowStep from ...models.stderr_err_response import StderrErrResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( workflow_id: str, + *, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["offset"] = offset + + params["limit"] = limit + + params["page"] = page + + 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": "/v1/workflows/{workflow_id}/steps".format( workflow_id=quote(str(workflow_id), safe=""), ), + "params": params, } return _kwargs @@ -84,6 +99,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> Response[StderrErrResponse | list[AppWorkflowStep]]: """get all of the steps for a given workflow @@ -91,6 +109,9 @@ def sync_detailed( Args: workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,6 +123,9 @@ def sync_detailed( kwargs = _get_kwargs( workflow_id=workflow_id, + offset=offset, + limit=limit, + page=page, ) response = client.get_httpx_client().request( @@ -115,6 +139,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> StderrErrResponse | list[AppWorkflowStep] | None: """get all of the steps for a given workflow @@ -122,6 +149,9 @@ def sync( Args: workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,6 +164,9 @@ def sync( return sync_detailed( workflow_id=workflow_id, client=client, + offset=offset, + limit=limit, + page=page, ).parsed @@ -141,6 +174,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> Response[StderrErrResponse | list[AppWorkflowStep]]: """get all of the steps for a given workflow @@ -148,6 +184,9 @@ async def asyncio_detailed( Args: workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,6 +198,9 @@ async def asyncio_detailed( kwargs = _get_kwargs( workflow_id=workflow_id, + offset=offset, + limit=limit, + page=page, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -170,6 +212,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + page: int | Unset = 0, ) -> StderrErrResponse | list[AppWorkflowStep] | None: """get all of the steps for a given workflow @@ -177,6 +222,9 @@ async def asyncio( Args: workflow_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + page (int | Unset): Default: 0. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,5 +238,8 @@ async def asyncio( await asyncio_detailed( workflow_id=workflow_id, client=client, + offset=offset, + limit=limit, + page=page, ) ).parsed diff --git a/nuon/api/notebooks/__init__.py b/nuon/api/notebooks/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/nuon/api/notebooks/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/nuon/api/notebooks/create_notebook.py b/nuon/api/notebooks/create_notebook.py new file mode 100644 index 00000000..5bd2af19 --- /dev/null +++ b/nuon/api/notebooks/create_notebook.py @@ -0,0 +1,172 @@ +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.app_notebook import AppNotebook +from ...models.service_create_notebook_request import ServiceCreateNotebookRequest +from ...types import Response + + +def _get_kwargs( + install_id: str, + *, + body: ServiceCreateNotebookRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/installs/{install_id}/notebooks".format( + install_id=quote(str(install_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebook | None: + if response.status_code == 201: + response_201 = AppNotebook.from_dict(response.json()) + + return response_201 + + 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[AppNotebook]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateNotebookRequest, +) -> Response[AppNotebook]: + """create a notebook for an install + + Args: + install_id (str): + body (ServiceCreateNotebookRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateNotebookRequest, +) -> AppNotebook | None: + """create a notebook for an install + + Args: + install_id (str): + body (ServiceCreateNotebookRequest): + + 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: + AppNotebook + """ + + return sync_detailed( + install_id=install_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateNotebookRequest, +) -> Response[AppNotebook]: + """create a notebook for an install + + Args: + install_id (str): + body (ServiceCreateNotebookRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateNotebookRequest, +) -> AppNotebook | None: + """create a notebook for an install + + Args: + install_id (str): + body (ServiceCreateNotebookRequest): + + 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: + AppNotebook + """ + + return ( + await asyncio_detailed( + install_id=install_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/notebooks/create_notebook_cell.py b/nuon/api/notebooks/create_notebook_cell.py new file mode 100644 index 00000000..013ec1a9 --- /dev/null +++ b/nuon/api/notebooks/create_notebook_cell.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.app_notebook_cell import AppNotebookCell +from ...models.service_create_cell_request import ServiceCreateCellRequest +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + *, + body: ServiceCreateCellRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebookCell | None: + if response.status_code == 201: + response_201 = AppNotebookCell.from_dict(response.json()) + + return response_201 + + 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[AppNotebookCell]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateCellRequest, +) -> Response[AppNotebookCell]: + """add a cell to a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceCreateCellRequest): + + 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[AppNotebookCell] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateCellRequest, +) -> AppNotebookCell | None: + """add a cell to a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceCreateCellRequest): + + 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: + AppNotebookCell + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateCellRequest, +) -> Response[AppNotebookCell]: + """add a cell to a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceCreateCellRequest): + + 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[AppNotebookCell] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateCellRequest, +) -> AppNotebookCell | None: + """add a cell to a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceCreateCellRequest): + + 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: + AppNotebookCell + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/notebooks/delete_notebook.py b/nuon/api/notebooks/delete_notebook.py new file mode 100644 index 00000000..7c3c2333 --- /dev/null +++ b/nuon/api/notebooks/delete_notebook.py @@ -0,0 +1,106 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 204: + 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( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """delete a notebook + + Args: + install_id (str): + notebook_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] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """delete a notebook + + Args: + install_id (str): + notebook_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] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/nuon/api/notebooks/delete_notebook_cell.py b/nuon/api/notebooks/delete_notebook_cell.py new file mode 100644 index 00000000..df763ae1 --- /dev/null +++ b/nuon/api/notebooks/delete_notebook_cell.py @@ -0,0 +1,114 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + cell_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells/{cell_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + cell_id=quote(str(cell_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | None: + if response.status_code == 204: + 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( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """delete a cell + + Args: + install_id (str): + notebook_id (str): + cell_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] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any]: + """delete a cell + + Args: + install_id (str): + notebook_id (str): + cell_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] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) diff --git a/nuon/api/notebooks/get_notebook.py b/nuon/api/notebooks/get_notebook.py new file mode 100644 index 00000000..c8f3b4d3 --- /dev/null +++ b/nuon/api/notebooks/get_notebook.py @@ -0,0 +1,165 @@ +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.app_notebook import AppNotebook +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebook | None: + if response.status_code == 200: + response_200 = AppNotebook.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[AppNotebook]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppNotebook]: + """get a notebook with its ordered cells and each cell's latest run + + Args: + install_id (str): + notebook_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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> AppNotebook | None: + """get a notebook with its ordered cells and each cell's latest run + + Args: + install_id (str): + notebook_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: + AppNotebook + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppNotebook]: + """get a notebook with its ordered cells and each cell's latest run + + Args: + install_id (str): + notebook_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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, +) -> AppNotebook | None: + """get a notebook with its ordered cells and each cell's latest run + + Args: + install_id (str): + notebook_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: + AppNotebook + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + ) + ).parsed diff --git a/nuon/api/notebooks/get_notebook_cell_run.py b/nuon/api/notebooks/get_notebook_cell_run.py new file mode 100644 index 00000000..ecbfa246 --- /dev/null +++ b/nuon/api/notebooks/get_notebook_cell_run.py @@ -0,0 +1,179 @@ +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.app_notebook_cell_run import AppNotebookCellRun +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + run_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/runs/{run_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + run_id=quote(str(run_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebookCellRun | None: + if response.status_code == 200: + response_200 = AppNotebookCellRun.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[AppNotebookCellRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppNotebookCellRun]: + """get a single cell run (includes log_stream_id for tailing) + + Args: + install_id (str): + notebook_id (str): + run_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[AppNotebookCellRun] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + run_id=run_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> AppNotebookCellRun | None: + """get a single cell run (includes log_stream_id for tailing) + + Args: + install_id (str): + notebook_id (str): + run_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: + AppNotebookCellRun + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + run_id=run_id, + client=client, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppNotebookCellRun]: + """get a single cell run (includes log_stream_id for tailing) + + Args: + install_id (str): + notebook_id (str): + run_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[AppNotebookCellRun] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + run_id=run_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + run_id: str, + *, + client: AuthenticatedClient, +) -> AppNotebookCellRun | None: + """get a single cell run (includes log_stream_id for tailing) + + Args: + install_id (str): + notebook_id (str): + run_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: + AppNotebookCellRun + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + run_id=run_id, + client=client, + ) + ).parsed diff --git a/nuon/api/notebooks/get_notebook_cell_runs.py b/nuon/api/notebooks/get_notebook_cell_runs.py new file mode 100644 index 00000000..44b44f2e --- /dev/null +++ b/nuon/api/notebooks/get_notebook_cell_runs.py @@ -0,0 +1,224 @@ +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.app_notebook_cell_run import AppNotebookCellRun +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + install_id: str, + notebook_id: str, + cell_id: str, + *, + offset: int | Unset = 0, + limit: int | Unset = 20, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["offset"] = offset + + params["limit"] = limit + + 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": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells/{cell_id}/runs".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + cell_id=quote(str(cell_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> list[AppNotebookCellRun] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppNotebookCellRun.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + 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[list[AppNotebookCellRun]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 20, +) -> Response[list[AppNotebookCellRun]]: + """list a cell's run history (newest first) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 20. + + 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[list[AppNotebookCellRun]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + offset=offset, + limit=limit, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 20, +) -> list[AppNotebookCellRun] | None: + """list a cell's run history (newest first) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 20. + + 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: + list[AppNotebookCellRun] + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + offset=offset, + limit=limit, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 20, +) -> Response[list[AppNotebookCellRun]]: + """list a cell's run history (newest first) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 20. + + 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[list[AppNotebookCellRun]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + offset=offset, + limit=limit, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 20, +) -> list[AppNotebookCellRun] | None: + """list a cell's run history (newest first) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 20. + + 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: + list[AppNotebookCellRun] + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + offset=offset, + limit=limit, + ) + ).parsed diff --git a/nuon/api/notebooks/get_notebooks.py b/nuon/api/notebooks/get_notebooks.py new file mode 100644 index 00000000..e6a4c40b --- /dev/null +++ b/nuon/api/notebooks/get_notebooks.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.app_notebook import AppNotebook +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + install_id: str, + *, + offset: int | Unset = 0, + limit: int | Unset = 10, + q: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["offset"] = offset + + params["limit"] = limit + + params["q"] = q + + 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": "/v1/installs/{install_id}/notebooks".format( + install_id=quote(str(install_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> list[AppNotebook] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppNotebook.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + 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[list[AppNotebook]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + q: str | Unset = UNSET, +) -> Response[list[AppNotebook]]: + """list notebooks for an install + + Args: + install_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + q (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[list[AppNotebook]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + offset=offset, + limit=limit, + q=q, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + q: str | Unset = UNSET, +) -> list[AppNotebook] | None: + """list notebooks for an install + + Args: + install_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + q (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: + list[AppNotebook] + """ + + return sync_detailed( + install_id=install_id, + client=client, + offset=offset, + limit=limit, + q=q, + ).parsed + + +async def asyncio_detailed( + install_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + q: str | Unset = UNSET, +) -> Response[list[AppNotebook]]: + """list notebooks for an install + + Args: + install_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + q (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[list[AppNotebook]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + offset=offset, + limit=limit, + q=q, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + *, + client: AuthenticatedClient, + offset: int | Unset = 0, + limit: int | Unset = 10, + q: str | Unset = UNSET, +) -> list[AppNotebook] | None: + """list notebooks for an install + + Args: + install_id (str): + offset (int | Unset): Default: 0. + limit (int | Unset): Default: 10. + q (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: + list[AppNotebook] + """ + + return ( + await asyncio_detailed( + install_id=install_id, + client=client, + offset=offset, + limit=limit, + q=q, + ) + ).parsed diff --git a/nuon/api/notebooks/reorder_notebook_cells.py b/nuon/api/notebooks/reorder_notebook_cells.py new file mode 100644 index 00000000..fa25090f --- /dev/null +++ b/nuon/api/notebooks/reorder_notebook_cells.py @@ -0,0 +1,194 @@ +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.app_notebook import AppNotebook +from ...models.service_reorder_cells_request import ServiceReorderCellsRequest +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + *, + body: ServiceReorderCellsRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells/reorder".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebook | None: + if response.status_code == 200: + response_200 = AppNotebook.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[AppNotebook]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceReorderCellsRequest, +) -> Response[AppNotebook]: + """reorder a notebook's cells + + accepts the full ordered list of cell IDs and assigns positions + + Args: + install_id (str): + notebook_id (str): + body (ServiceReorderCellsRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceReorderCellsRequest, +) -> AppNotebook | None: + """reorder a notebook's cells + + accepts the full ordered list of cell IDs and assigns positions + + Args: + install_id (str): + notebook_id (str): + body (ServiceReorderCellsRequest): + + 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: + AppNotebook + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceReorderCellsRequest, +) -> Response[AppNotebook]: + """reorder a notebook's cells + + accepts the full ordered list of cell IDs and assigns positions + + Args: + install_id (str): + notebook_id (str): + body (ServiceReorderCellsRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceReorderCellsRequest, +) -> AppNotebook | None: + """reorder a notebook's cells + + accepts the full ordered list of cell IDs and assigns positions + + Args: + install_id (str): + notebook_id (str): + body (ServiceReorderCellsRequest): + + 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: + AppNotebook + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/notebooks/run_notebook_cell.py b/nuon/api/notebooks/run_notebook_cell.py new file mode 100644 index 00000000..c0cdb65a --- /dev/null +++ b/nuon/api/notebooks/run_notebook_cell.py @@ -0,0 +1,213 @@ +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.app_notebook_cell_run import AppNotebookCellRun +from ...models.service_run_cell_request import ServiceRunCellRequest +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + install_id: str, + notebook_id: str, + cell_id: str, + *, + body: ServiceRunCellRequest | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells/{cell_id}/runs".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + cell_id=quote(str(cell_id), safe=""), + ), + } + + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebookCellRun | None: + if response.status_code == 202: + response_202 = AppNotebookCellRun.from_dict(response.json()) + + return response_202 + + 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[AppNotebookCellRun]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceRunCellRequest | Unset = UNSET, +) -> Response[AppNotebookCellRun]: + """run a notebook cell on the install's runner + + dispatches the cell to the notebook's warm Temporal workflow and records a NotebookCellRun linking + to the underlying execution + log stream. Returns once the run is queued, not when it finishes. + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceRunCellRequest | 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[AppNotebookCellRun] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceRunCellRequest | Unset = UNSET, +) -> AppNotebookCellRun | None: + """run a notebook cell on the install's runner + + dispatches the cell to the notebook's warm Temporal workflow and records a NotebookCellRun linking + to the underlying execution + log stream. Returns once the run is queued, not when it finishes. + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceRunCellRequest | 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: + AppNotebookCellRun + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceRunCellRequest | Unset = UNSET, +) -> Response[AppNotebookCellRun]: + """run a notebook cell on the install's runner + + dispatches the cell to the notebook's warm Temporal workflow and records a NotebookCellRun linking + to the underlying execution + log stream. Returns once the run is queued, not when it finishes. + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceRunCellRequest | 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[AppNotebookCellRun] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceRunCellRequest | Unset = UNSET, +) -> AppNotebookCellRun | None: + """run a notebook cell on the install's runner + + dispatches the cell to the notebook's warm Temporal workflow and records a NotebookCellRun linking + to the underlying execution + log stream. Returns once the run is queued, not when it finishes. + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceRunCellRequest | 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: + AppNotebookCellRun + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/notebooks/update_notebook.py b/nuon/api/notebooks/update_notebook.py new file mode 100644 index 00000000..939b678c --- /dev/null +++ b/nuon/api/notebooks/update_notebook.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.app_notebook import AppNotebook +from ...models.service_update_notebook_request import ServiceUpdateNotebookRequest +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + *, + body: ServiceUpdateNotebookRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebook | None: + if response.status_code == 200: + response_200 = AppNotebook.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[AppNotebook]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateNotebookRequest, +) -> Response[AppNotebook]: + """update a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceUpdateNotebookRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateNotebookRequest, +) -> AppNotebook | None: + """update a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceUpdateNotebookRequest): + + 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: + AppNotebook + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateNotebookRequest, +) -> Response[AppNotebook]: + """update a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceUpdateNotebookRequest): + + 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[AppNotebook] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateNotebookRequest, +) -> AppNotebook | None: + """update a notebook + + Args: + install_id (str): + notebook_id (str): + body (ServiceUpdateNotebookRequest): + + 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: + AppNotebook + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/notebooks/update_notebook_cell.py b/nuon/api/notebooks/update_notebook_cell.py new file mode 100644 index 00000000..228e9abf --- /dev/null +++ b/nuon/api/notebooks/update_notebook_cell.py @@ -0,0 +1,200 @@ +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.app_notebook_cell import AppNotebookCell +from ...models.service_update_cell_request import ServiceUpdateCellRequest +from ...types import Response + + +def _get_kwargs( + install_id: str, + notebook_id: str, + cell_id: str, + *, + body: ServiceUpdateCellRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/v1/installs/{install_id}/notebooks/{notebook_id}/cells/{cell_id}".format( + install_id=quote(str(install_id), safe=""), + notebook_id=quote(str(notebook_id), safe=""), + cell_id=quote(str(cell_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AppNotebookCell | None: + if response.status_code == 200: + response_200 = AppNotebookCell.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[AppNotebookCell]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateCellRequest, +) -> Response[AppNotebookCell]: + """edit a cell (bumps its revision) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceUpdateCellRequest): + + 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[AppNotebookCell] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateCellRequest, +) -> AppNotebookCell | None: + """edit a cell (bumps its revision) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceUpdateCellRequest): + + 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: + AppNotebookCell + """ + + return sync_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateCellRequest, +) -> Response[AppNotebookCell]: + """edit a cell (bumps its revision) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceUpdateCellRequest): + + 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[AppNotebookCell] + """ + + kwargs = _get_kwargs( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + notebook_id: str, + cell_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateCellRequest, +) -> AppNotebookCell | None: + """edit a cell (bumps its revision) + + Args: + install_id (str): + notebook_id (str): + cell_id (str): + body (ServiceUpdateCellRequest): + + 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: + AppNotebookCell + """ + + return ( + await asyncio_detailed( + install_id=install_id, + notebook_id=notebook_id, + cell_id=cell_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/runbooks/create_runbook_run.py b/nuon/api/runbooks/create_runbook_run.py index 1f0c511e..b0ba6599 100644 --- a/nuon/api/runbooks/create_runbook_run.py +++ b/nuon/api/runbooks/create_runbook_run.py @@ -7,14 +7,18 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.app_install_runbook_run import AppInstallRunbookRun +from ...models.service_create_runbook_run_request import ServiceCreateRunbookRunRequest from ...models.stderr_err_response import StderrErrResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( install_id: str, runbook_id: str, + *, + body: ServiceCreateRunbookRunRequest | Unset = UNSET, ) -> dict[str, Any]: + headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", @@ -24,6 +28,12 @@ def _get_kwargs( ), } + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers return _kwargs @@ -82,12 +92,14 @@ def sync_detailed( runbook_id: str, *, client: AuthenticatedClient, + body: ServiceCreateRunbookRunRequest | Unset = UNSET, ) -> Response[AppInstallRunbookRun | StderrErrResponse]: """run a runbook on an install Args: install_id (str): runbook_id (str): + body (ServiceCreateRunbookRunRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,6 +112,7 @@ def sync_detailed( kwargs = _get_kwargs( install_id=install_id, runbook_id=runbook_id, + body=body, ) response = client.get_httpx_client().request( @@ -114,12 +127,14 @@ def sync( runbook_id: str, *, client: AuthenticatedClient, + body: ServiceCreateRunbookRunRequest | Unset = UNSET, ) -> AppInstallRunbookRun | StderrErrResponse | None: """run a runbook on an install Args: install_id (str): runbook_id (str): + body (ServiceCreateRunbookRunRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,6 +148,7 @@ def sync( install_id=install_id, runbook_id=runbook_id, client=client, + body=body, ).parsed @@ -141,12 +157,14 @@ async def asyncio_detailed( runbook_id: str, *, client: AuthenticatedClient, + body: ServiceCreateRunbookRunRequest | Unset = UNSET, ) -> Response[AppInstallRunbookRun | StderrErrResponse]: """run a runbook on an install Args: install_id (str): runbook_id (str): + body (ServiceCreateRunbookRunRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,6 +177,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( install_id=install_id, runbook_id=runbook_id, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -171,12 +190,14 @@ async def asyncio( runbook_id: str, *, client: AuthenticatedClient, + body: ServiceCreateRunbookRunRequest | Unset = UNSET, ) -> AppInstallRunbookRun | StderrErrResponse | None: """run a runbook on an install Args: install_id (str): runbook_id (str): + body (ServiceCreateRunbookRunRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,5 +212,6 @@ async def asyncio( install_id=install_id, runbook_id=runbook_id, client=client, + body=body, ) ).parsed diff --git a/nuon/api/runbooks/get_install_runbooks.py b/nuon/api/runbooks/get_install_runbooks.py index 4d6a326d..babbc13e 100644 --- a/nuon/api/runbooks/get_install_runbooks.py +++ b/nuon/api/runbooks/get_install_runbooks.py @@ -16,6 +16,7 @@ def _get_kwargs( *, offset: int | Unset = 0, limit: int | Unset = 10, + q: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -24,6 +25,8 @@ def _get_kwargs( params["limit"] = limit + params["q"] = q + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -98,6 +101,7 @@ def sync_detailed( client: AuthenticatedClient, offset: int | Unset = 0, limit: int | Unset = 10, + q: str | Unset = UNSET, ) -> Response[StderrErrResponse | list[AppInstallRunbook]]: """get runbooks for an install @@ -105,6 +109,7 @@ def sync_detailed( install_id (str): offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. + q (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -118,6 +123,7 @@ def sync_detailed( install_id=install_id, offset=offset, limit=limit, + q=q, ) response = client.get_httpx_client().request( @@ -133,6 +139,7 @@ def sync( client: AuthenticatedClient, offset: int | Unset = 0, limit: int | Unset = 10, + q: str | Unset = UNSET, ) -> StderrErrResponse | list[AppInstallRunbook] | None: """get runbooks for an install @@ -140,6 +147,7 @@ def sync( install_id (str): offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. + q (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,6 +162,7 @@ def sync( client=client, offset=offset, limit=limit, + q=q, ).parsed @@ -163,6 +172,7 @@ async def asyncio_detailed( client: AuthenticatedClient, offset: int | Unset = 0, limit: int | Unset = 10, + q: str | Unset = UNSET, ) -> Response[StderrErrResponse | list[AppInstallRunbook]]: """get runbooks for an install @@ -170,6 +180,7 @@ async def asyncio_detailed( install_id (str): offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. + q (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -183,6 +194,7 @@ async def asyncio_detailed( install_id=install_id, offset=offset, limit=limit, + q=q, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -196,6 +208,7 @@ async def asyncio( client: AuthenticatedClient, offset: int | Unset = 0, limit: int | Unset = 10, + q: str | Unset = UNSET, ) -> StderrErrResponse | list[AppInstallRunbook] | None: """get runbooks for an install @@ -203,6 +216,7 @@ async def asyncio( install_id (str): offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. + q (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -218,5 +232,6 @@ async def asyncio( client=client, offset=offset, limit=limit, + q=q, ) ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index 318bd652..3c4fbbb8 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -109,7 +109,7 @@ from .app_install_inputs import AppInstallInputs from .app_install_inputs_redacted_values import AppInstallInputsRedactedValues from .app_install_inputs_values import AppInstallInputsValues -from .app_install_lifecycle_status import AppInstallLifecycleStatus +from .app_install_lifecycle_phase import AppInstallLifecyclePhase from .app_install_links import AppInstallLinks from .app_install_metadata import AppInstallMetadata from .app_install_role_selection_record import AppInstallRoleSelectionRecord @@ -117,6 +117,8 @@ from .app_install_roles import AppInstallRoles from .app_install_runbook import AppInstallRunbook from .app_install_runbook_run import AppInstallRunbookRun +from .app_install_runbook_run_runbook_inputs import AppInstallRunbookRunRunbookInputs +from .app_install_runbook_run_runbook_inputs_redacted import AppInstallRunbookRunRunbookInputsRedacted from .app_install_sandbox import AppInstallSandbox from .app_install_sandbox_run import AppInstallSandboxRun from .app_install_sandbox_run_outputs import AppInstallSandboxRunOutputs @@ -138,6 +140,11 @@ from .app_latest_runner_heart_beat import AppLatestRunnerHeartBeat from .app_log_stream import AppLogStream from .app_log_stream_attrs import AppLogStreamAttrs +from .app_notebook import AppNotebook +from .app_notebook_cell import AppNotebookCell +from .app_notebook_cell_env_vars import AppNotebookCellEnvVars +from .app_notebook_cell_run import AppNotebookCellRun +from .app_notebook_cell_run_env_vars import AppNotebookCellRunEnvVars from .app_notifications_config import AppNotificationsConfig from .app_oci_artifact import AppOCIArtifact from .app_oci_artifact_annotations import AppOCIArtifactAnnotations @@ -176,8 +183,10 @@ from .app_role_type import AppRoleType from .app_runbook import AppRunbook from .app_runbook_config import AppRunbookConfig +from .app_runbook_input import AppRunbookInput from .app_runbook_step_config import AppRunbookStepConfig from .app_runbook_step_config_env_vars import AppRunbookStepConfigEnvVars +from .app_runbook_step_selection import AppRunbookStepSelection from .app_runner import AppRunner from .app_runner_group import AppRunnerGroup from .app_runner_group_settings import AppRunnerGroupSettings @@ -455,6 +464,8 @@ from .service_create_app_secret_request import ServiceCreateAppSecretRequest from .service_create_app_secrets_config_request import ServiceCreateAppSecretsConfigRequest from .service_create_app_stack_config_request import ServiceCreateAppStackConfigRequest +from .service_create_cell_request import ServiceCreateCellRequest +from .service_create_cell_request_env_vars import ServiceCreateCellRequestEnvVars from .service_create_channel_subscription_request import ServiceCreateChannelSubscriptionRequest from .service_create_channel_subscription_request_interests import ServiceCreateChannelSubscriptionRequestInterests from .service_create_channel_subscription_request_match import ServiceCreateChannelSubscriptionRequestMatch @@ -515,6 +526,7 @@ from .service_create_kubernetes_manifest_component_config_request_operation_roles import ( ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles, ) +from .service_create_notebook_request import ServiceCreateNotebookRequest from .service_create_org_invite_request import ServiceCreateOrgInviteRequest from .service_create_org_link_request import ServiceCreateOrgLinkRequest from .service_create_org_request import ServiceCreateOrgRequest @@ -526,8 +538,12 @@ ServiceCreatePulumiComponentConfigRequestOperationRoles, ) from .service_create_runbook_config_request import ServiceCreateRunbookConfigRequest +from .service_create_runbook_input_request import ServiceCreateRunbookInputRequest from .service_create_runbook_request import ServiceCreateRunbookRequest from .service_create_runbook_request_labels import ServiceCreateRunbookRequestLabels +from .service_create_runbook_run_request import ServiceCreateRunbookRunRequest +from .service_create_runbook_run_request_inputs import ServiceCreateRunbookRunRequestInputs +from .service_create_runbook_run_step_selection import ServiceCreateRunbookRunStepSelection from .service_create_runbook_step_config_request import ServiceCreateRunbookStepConfigRequest from .service_create_runbook_step_config_request_env_vars import ServiceCreateRunbookStepConfigRequestEnvVars from .service_create_runner_bootstrap_token_response import ServiceCreateRunnerBootstrapTokenResponse @@ -588,11 +604,13 @@ from .service_remove_component_labels_request import ServiceRemoveComponentLabelsRequest from .service_remove_install_labels_request import ServiceRemoveInstallLabelsRequest from .service_remove_org_user_request import ServiceRemoveOrgUserRequest +from .service_reorder_cells_request import ServiceReorderCellsRequest from .service_reprovision_install_request import ServiceReprovisionInstallRequest from .service_reprovision_install_sandbox_request import ServiceReprovisionInstallSandboxRequest from .service_retry_workflow_request import ServiceRetryWorkflowRequest from .service_retry_workflow_response import ServiceRetryWorkflowResponse from .service_retry_workflow_step_response import ServiceRetryWorkflowStepResponse +from .service_run_cell_request import ServiceRunCellRequest from .service_runner_card_details_response import ServiceRunnerCardDetailsResponse from .service_runner_connection_status import ServiceRunnerConnectionStatus from .service_series_point import ServiceSeriesPoint @@ -612,6 +630,8 @@ from .service_update_app_config_installs_request import ServiceUpdateAppConfigInstallsRequest from .service_update_app_config_request import ServiceUpdateAppConfigRequest from .service_update_app_request import ServiceUpdateAppRequest +from .service_update_cell_request import ServiceUpdateCellRequest +from .service_update_cell_request_env_vars import ServiceUpdateCellRequestEnvVars from .service_update_channel_subscription_request import ServiceUpdateChannelSubscriptionRequest from .service_update_channel_subscription_request_interests import ServiceUpdateChannelSubscriptionRequestInterests from .service_update_channel_subscription_request_match import ServiceUpdateChannelSubscriptionRequestMatch @@ -626,6 +646,8 @@ from .service_update_install_inputs_request_inputs import ServiceUpdateInstallInputsRequestInputs from .service_update_install_request import ServiceUpdateInstallRequest from .service_update_install_role_request import ServiceUpdateInstallRoleRequest +from .service_update_notebook_request import ServiceUpdateNotebookRequest +from .service_update_notebook_request_status import ServiceUpdateNotebookRequestStatus from .service_update_org_features_request import ServiceUpdateOrgFeaturesRequest from .service_update_org_features_request_features import ServiceUpdateOrgFeaturesRequestFeatures from .service_update_org_request import ServiceUpdateOrgRequest @@ -791,7 +813,7 @@ "AppInstallInputs", "AppInstallInputsRedactedValues", "AppInstallInputsValues", - "AppInstallLifecycleStatus", + "AppInstallLifecyclePhase", "AppInstallLinks", "AppInstallMetadata", "AppInstallRoles", @@ -799,6 +821,8 @@ "AppInstallRoleUsage", "AppInstallRunbook", "AppInstallRunbookRun", + "AppInstallRunbookRunRunbookInputs", + "AppInstallRunbookRunRunbookInputsRedacted", "AppInstallSandbox", "AppInstallSandboxRun", "AppInstallSandboxRunOutputs", @@ -820,6 +844,11 @@ "AppLatestRunnerHeartBeat", "AppLogStream", "AppLogStreamAttrs", + "AppNotebook", + "AppNotebookCell", + "AppNotebookCellEnvVars", + "AppNotebookCellRun", + "AppNotebookCellRunEnvVars", "AppNotificationsConfig", "AppOCIArtifact", "AppOCIArtifactAnnotations", @@ -858,8 +887,10 @@ "AppRoleType", "AppRunbook", "AppRunbookConfig", + "AppRunbookInput", "AppRunbookStepConfig", "AppRunbookStepConfigEnvVars", + "AppRunbookStepSelection", "AppRunner", "AppRunnerGroup", "AppRunnerGroupSettings", @@ -1127,6 +1158,8 @@ "ServiceCreateAppSecretRequest", "ServiceCreateAppSecretsConfigRequest", "ServiceCreateAppStackConfigRequest", + "ServiceCreateCellRequest", + "ServiceCreateCellRequestEnvVars", "ServiceCreateChannelSubscriptionRequest", "ServiceCreateChannelSubscriptionRequestInterests", "ServiceCreateChannelSubscriptionRequestMatch", @@ -1171,6 +1204,7 @@ "ServiceCreateJobComponentConfigRequestOperationRoles", "ServiceCreateKubernetesManifestComponentConfigRequest", "ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles", + "ServiceCreateNotebookRequest", "ServiceCreateOrgInviteRequest", "ServiceCreateOrgLinkRequest", "ServiceCreateOrgRequest", @@ -1180,8 +1214,12 @@ "ServiceCreatePulumiComponentConfigRequestEnvVars", "ServiceCreatePulumiComponentConfigRequestOperationRoles", "ServiceCreateRunbookConfigRequest", + "ServiceCreateRunbookInputRequest", "ServiceCreateRunbookRequest", "ServiceCreateRunbookRequestLabels", + "ServiceCreateRunbookRunRequest", + "ServiceCreateRunbookRunRequestInputs", + "ServiceCreateRunbookRunStepSelection", "ServiceCreateRunbookStepConfigRequest", "ServiceCreateRunbookStepConfigRequestEnvVars", "ServiceCreateRunnerBootstrapTokenResponse", @@ -1236,11 +1274,13 @@ "ServiceRemoveComponentLabelsRequest", "ServiceRemoveInstallLabelsRequest", "ServiceRemoveOrgUserRequest", + "ServiceReorderCellsRequest", "ServiceReprovisionInstallRequest", "ServiceReprovisionInstallSandboxRequest", "ServiceRetryWorkflowRequest", "ServiceRetryWorkflowResponse", "ServiceRetryWorkflowStepResponse", + "ServiceRunCellRequest", "ServiceRunnerCardDetailsResponse", "ServiceRunnerConnectionStatus", "ServiceSeriesPoint", @@ -1260,6 +1300,8 @@ "ServiceUpdateAppConfigInstallsRequest", "ServiceUpdateAppConfigRequest", "ServiceUpdateAppRequest", + "ServiceUpdateCellRequest", + "ServiceUpdateCellRequestEnvVars", "ServiceUpdateChannelSubscriptionRequest", "ServiceUpdateChannelSubscriptionRequestInterests", "ServiceUpdateChannelSubscriptionRequestMatch", @@ -1274,6 +1316,8 @@ "ServiceUpdateInstallInputsRequestInputs", "ServiceUpdateInstallRequest", "ServiceUpdateInstallRoleRequest", + "ServiceUpdateNotebookRequest", + "ServiceUpdateNotebookRequestStatus", "ServiceUpdateOrgFeaturesRequest", "ServiceUpdateOrgFeaturesRequestFeatures", "ServiceUpdateOrgRequest", diff --git a/nuon/models/app_component_build.py b/nuon/models/app_component_build.py index 11358379..43be8c2e 100644 --- a/nuon/models/app_component_build.py +++ b/nuon/models/app_component_build.py @@ -42,10 +42,40 @@ class AppComponentBuild: id (str | Unset): install_deploys (list[AppInstallDeploy] | Unset): log_stream (AppLogStream | Unset): + no_op (bool | Unset): NoOp is true when the runner detected SourceDigest matches the previous + build's SourceDigest and skipped the artifact push. + + Downstream contract: + - The build is still marked Active because the bytes it represents + are deployable (they live in the install registry under the prior + build that pushed them). + - No new install deploys are auto-queued for a NoOp build; the + dep-aware deploy path handles fan-out for installs that depend + on the underlying image. + - pollForDeployableBuild treats NoOp builds as Active without any + special-casing because the deployable artifact at the same + SourceDigest is already present in the install registry from the + prior build. policy_reports (list[AppPolicyReport] | Unset): queue_signal (AppQueueSignal | Unset): releases (list[AppComponentRelease] | Unset): + resolved_at (str | Unset): ResolvedAt is when the runner resolved SourceRef to SourceDigest. + resolved_tag (str | Unset): ResolvedTag is the tag the runner actually pulled from. For digest-pinned + refs this is empty. For mutable/semver refs this is the concrete tag the + runner selected (e.g. "1.25.5" even if SourceRef pinned "1.25.3" with a + "~1.25.0" update_policy constraint). runner_job (AppRunnerJob | Unset): + source_digest (str | Unset): SourceDigest is the manifest list digest of the resolved source ref, + e.g. "sha256:abc...". This is the canonical content address of what was + pulled and is used for build dedup. + source_image (str | Unset): SourceImage is the repository portion of SourceRef without tag/digest, e.g. "nginx". + source_media_type (str | Unset): SourceMediaType records the media type of the resolved manifest (image, + image index, OCI artifact, etc.) for downstream rendering decisions. + source_ref (str | Unset): Source identity for image-type builds. + + SourceRef is what the user wrote in the spec, e.g. "nginx:1.25.3" or + "myimage@sha256:...". Always populated for image-type builds so we have a + permanent record of what was requested at build time. status (str | Unset): status_description (str | Unset): status_v2 (AppCompositeStatus | Unset): @@ -66,10 +96,17 @@ class AppComponentBuild: id: str | Unset = UNSET install_deploys: list[AppInstallDeploy] | Unset = UNSET log_stream: AppLogStream | Unset = UNSET + no_op: bool | Unset = UNSET policy_reports: list[AppPolicyReport] | Unset = UNSET queue_signal: AppQueueSignal | Unset = UNSET releases: list[AppComponentRelease] | Unset = UNSET + resolved_at: str | Unset = UNSET + resolved_tag: str | Unset = UNSET runner_job: AppRunnerJob | Unset = UNSET + source_digest: str | Unset = UNSET + source_image: str | Unset = UNSET + source_media_type: str | Unset = UNSET + source_ref: str | Unset = UNSET status: str | Unset = UNSET status_description: str | Unset = UNSET status_v2: AppCompositeStatus | Unset = UNSET @@ -115,6 +152,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.log_stream, Unset): log_stream = self.log_stream.to_dict() + no_op = self.no_op + policy_reports: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.policy_reports, Unset): policy_reports = [] @@ -133,10 +172,22 @@ def to_dict(self) -> dict[str, Any]: releases_item = releases_item_data.to_dict() releases.append(releases_item) + resolved_at = self.resolved_at + + resolved_tag = self.resolved_tag + runner_job: dict[str, Any] | Unset = UNSET if not isinstance(self.runner_job, Unset): runner_job = self.runner_job.to_dict() + source_digest = self.source_digest + + source_image = self.source_image + + source_media_type = self.source_media_type + + source_ref = self.source_ref + status = self.status status_description = self.status_description @@ -180,14 +231,28 @@ def to_dict(self) -> dict[str, Any]: field_dict["install_deploys"] = install_deploys if log_stream is not UNSET: field_dict["log_stream"] = log_stream + if no_op is not UNSET: + field_dict["no_op"] = no_op if policy_reports is not UNSET: field_dict["policy_reports"] = policy_reports if queue_signal is not UNSET: field_dict["queue_signal"] = queue_signal if releases is not UNSET: field_dict["releases"] = releases + if resolved_at is not UNSET: + field_dict["resolved_at"] = resolved_at + if resolved_tag is not UNSET: + field_dict["resolved_tag"] = resolved_tag if runner_job is not UNSET: field_dict["runner_job"] = runner_job + if source_digest is not UNSET: + field_dict["source_digest"] = source_digest + if source_image is not UNSET: + field_dict["source_image"] = source_image + if source_media_type is not UNSET: + field_dict["source_media_type"] = source_media_type + if source_ref is not UNSET: + field_dict["source_ref"] = source_ref if status is not UNSET: field_dict["status"] = status if status_description is not UNSET: @@ -263,6 +328,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: log_stream = AppLogStream.from_dict(_log_stream) + no_op = d.pop("no_op", UNSET) + _policy_reports = d.pop("policy_reports", UNSET) policy_reports: list[AppPolicyReport] | Unset = UNSET if _policy_reports is not UNSET: @@ -288,6 +355,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: releases.append(releases_item) + resolved_at = d.pop("resolved_at", UNSET) + + resolved_tag = d.pop("resolved_tag", UNSET) + _runner_job = d.pop("runner_job", UNSET) runner_job: AppRunnerJob | Unset if isinstance(_runner_job, Unset): @@ -295,6 +366,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: runner_job = AppRunnerJob.from_dict(_runner_job) + source_digest = d.pop("source_digest", UNSET) + + source_image = d.pop("source_image", UNSET) + + source_media_type = d.pop("source_media_type", UNSET) + + source_ref = d.pop("source_ref", UNSET) + status = d.pop("status", UNSET) status_description = d.pop("status_description", UNSET) @@ -329,10 +408,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id=id, install_deploys=install_deploys, log_stream=log_stream, + no_op=no_op, policy_reports=policy_reports, queue_signal=queue_signal, releases=releases, + resolved_at=resolved_at, + resolved_tag=resolved_tag, runner_job=runner_job, + source_digest=source_digest, + source_image=source_image, + source_media_type=source_media_type, + source_ref=source_ref, status=status, status_description=status_description, status_v2=status_v2, diff --git a/nuon/models/app_external_image_component_config.py b/nuon/models/app_external_image_component_config.py index eb4dfc55..9d275d27 100644 --- a/nuon/models/app_external_image_component_config.py +++ b/nuon/models/app_external_image_component_config.py @@ -30,6 +30,14 @@ class AppExternalImageComponentConfig: id (str | Unset): image_url (str | Unset): tag (str | Unset): + update_policy (str | Unset): UpdatePolicy is an optional Masterminds-compatible semver constraint + (e.g. "~1.25.0", "^2", ">=1.0.0,<2.0.0") that, when set, causes the + runner to list tags from the source registry, filter to those that + parse as semver and satisfy the constraint, and pick the highest + matching tag at build time. Tag is then ignored as the source ref; + the resolved tag is recorded on ComponentBuild.ResolvedTag. + + When empty, the runner uses Tag literally. updated_at (str | Unset): """ @@ -42,6 +50,7 @@ class AppExternalImageComponentConfig: id: str | Unset = UNSET image_url: str | Unset = UNSET tag: str | Unset = UNSET + update_policy: str | Unset = UNSET updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -70,6 +79,8 @@ def to_dict(self) -> dict[str, Any]: tag = self.tag + update_policy = self.update_policy + updated_at = self.updated_at field_dict: dict[str, Any] = {} @@ -93,6 +104,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["image_url"] = image_url if tag is not UNSET: field_dict["tag"] = tag + if update_policy is not UNSET: + field_dict["update_policy"] = update_policy if updated_at is not UNSET: field_dict["updated_at"] = updated_at @@ -138,6 +151,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tag = d.pop("tag", UNSET) + update_policy = d.pop("update_policy", UNSET) + updated_at = d.pop("updated_at", UNSET) app_external_image_component_config = cls( @@ -150,6 +165,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id=id, image_url=image_url, tag=tag, + update_policy=update_policy, updated_at=updated_at, ) diff --git a/nuon/models/app_install.py b/nuon/models/app_install.py index 129a4870..63a091ce 100644 --- a/nuon/models/app_install.py +++ b/nuon/models/app_install.py @@ -21,7 +21,7 @@ from ..models.app_install_config import AppInstallConfig from ..models.app_install_event import AppInstallEvent from ..models.app_install_inputs import AppInstallInputs - from ..models.app_install_lifecycle_status import AppInstallLifecycleStatus + from ..models.app_install_lifecycle_phase import AppInstallLifecyclePhase from ..models.app_install_links import AppInstallLinks from ..models.app_install_metadata import AppInstallMetadata from ..models.app_install_roles import AppInstallRoles @@ -69,7 +69,7 @@ class AppInstall: install_stack (AppInstallStack | Unset): install_states (list[AppInstallState] | Unset): labels (GithubComNuoncoNuonPkgLabelsLabels | Unset): - lifecycle_status (AppInstallLifecycleStatus | Unset): + lifecycle_phase (AppInstallLifecyclePhase | Unset): links (AppInstallLinks | Unset): metadata (AppInstallMetadata | Unset): name (str | Unset): @@ -82,8 +82,6 @@ class AppInstall: sandbox_mode (SqlNullBool | Unset): sandbox_status (str | Unset): sandbox_status_description (str | Unset): - status (str | Unset): TODO(jm): deprecate these fields once the terraform provider has been updated - status_description (str | Unset): updated_at (str | Unset): workflow_id (str | Unset): WorkflowID is populated by handlers that create a workflow. Not persisted. workflows (list[AppWorkflow] | Unset): @@ -115,7 +113,7 @@ class AppInstall: install_stack: AppInstallStack | Unset = UNSET install_states: list[AppInstallState] | Unset = UNSET labels: GithubComNuoncoNuonPkgLabelsLabels | Unset = UNSET - lifecycle_status: AppInstallLifecycleStatus | Unset = UNSET + lifecycle_phase: AppInstallLifecyclePhase | Unset = UNSET links: AppInstallLinks | Unset = UNSET metadata: AppInstallMetadata | Unset = UNSET name: str | Unset = UNSET @@ -128,8 +126,6 @@ class AppInstall: sandbox_mode: SqlNullBool | Unset = UNSET sandbox_status: str | Unset = UNSET sandbox_status_description: str | Unset = UNSET - status: str | Unset = UNSET - status_description: str | Unset = UNSET updated_at: str | Unset = UNSET workflow_id: str | Unset = UNSET workflows: list[AppWorkflow] | Unset = UNSET @@ -246,9 +242,9 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.labels, Unset): labels = self.labels.to_dict() - lifecycle_status: dict[str, Any] | Unset = UNSET - if not isinstance(self.lifecycle_status, Unset): - lifecycle_status = self.lifecycle_status.to_dict() + lifecycle_phase: dict[str, Any] | Unset = UNSET + if not isinstance(self.lifecycle_phase, Unset): + lifecycle_phase = self.lifecycle_phase.to_dict() links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): @@ -287,10 +283,6 @@ def to_dict(self) -> dict[str, Any]: sandbox_status_description = self.sandbox_status_description - status = self.status - - status_description = self.status_description - updated_at = self.updated_at workflow_id = self.workflow_id @@ -357,8 +349,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["install_states"] = install_states if labels is not UNSET: field_dict["labels"] = labels - if lifecycle_status is not UNSET: - field_dict["lifecycle_status"] = lifecycle_status + if lifecycle_phase is not UNSET: + field_dict["lifecycle_phase"] = lifecycle_phase if links is not UNSET: field_dict["links"] = links if metadata is not UNSET: @@ -383,10 +375,6 @@ def to_dict(self) -> dict[str, Any]: field_dict["sandbox_status"] = sandbox_status if sandbox_status_description is not UNSET: field_dict["sandbox_status_description"] = sandbox_status_description - if status is not UNSET: - field_dict["status"] = status - if status_description is not UNSET: - field_dict["status_description"] = status_description if updated_at is not UNSET: field_dict["updated_at"] = updated_at if workflow_id is not UNSET: @@ -410,7 +398,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_install_config import AppInstallConfig from ..models.app_install_event import AppInstallEvent from ..models.app_install_inputs import AppInstallInputs - from ..models.app_install_lifecycle_status import AppInstallLifecycleStatus + from ..models.app_install_lifecycle_phase import AppInstallLifecyclePhase from ..models.app_install_links import AppInstallLinks from ..models.app_install_metadata import AppInstallMetadata from ..models.app_install_roles import AppInstallRoles @@ -577,12 +565,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: labels = GithubComNuoncoNuonPkgLabelsLabels.from_dict(_labels) - _lifecycle_status = d.pop("lifecycle_status", UNSET) - lifecycle_status: AppInstallLifecycleStatus | Unset - if isinstance(_lifecycle_status, Unset): - lifecycle_status = UNSET + _lifecycle_phase = d.pop("lifecycle_phase", UNSET) + lifecycle_phase: AppInstallLifecyclePhase | Unset + if isinstance(_lifecycle_phase, Unset): + lifecycle_phase = UNSET else: - lifecycle_status = AppInstallLifecycleStatus.from_dict(_lifecycle_status) + lifecycle_phase = AppInstallLifecyclePhase.from_dict(_lifecycle_phase) _links = d.pop("links", UNSET) links: AppInstallLinks | Unset @@ -635,10 +623,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: sandbox_status_description = d.pop("sandbox_status_description", UNSET) - status = d.pop("status", UNSET) - - status_description = d.pop("status_description", UNSET) - updated_at = d.pop("updated_at", UNSET) workflow_id = d.pop("workflow_id", UNSET) @@ -679,7 +663,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_stack=install_stack, install_states=install_states, labels=labels, - lifecycle_status=lifecycle_status, + lifecycle_phase=lifecycle_phase, links=links, metadata=metadata, name=name, @@ -692,8 +676,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: sandbox_mode=sandbox_mode, sandbox_status=sandbox_status, sandbox_status_description=sandbox_status_description, - status=status, - status_description=status_description, updated_at=updated_at, workflow_id=workflow_id, workflows=workflows, diff --git a/nuon/models/app_install_lifecycle_status.py b/nuon/models/app_install_lifecycle_phase.py similarity index 81% rename from nuon/models/app_install_lifecycle_status.py rename to nuon/models/app_install_lifecycle_phase.py index 5a86da37..5fd8cb71 100644 --- a/nuon/models/app_install_lifecycle_status.py +++ b/nuon/models/app_install_lifecycle_phase.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AppInstallLifecycleStatus") +T = TypeVar("T", bound="AppInstallLifecyclePhase") @_attrs_define -class AppInstallLifecycleStatus: +class AppInstallLifecyclePhase: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - app_install_lifecycle_status = cls() + app_install_lifecycle_phase = cls() - app_install_lifecycle_status.additional_properties = d - return app_install_lifecycle_status + app_install_lifecycle_phase.additional_properties = d + return app_install_lifecycle_phase @property def additional_keys(self) -> list[str]: diff --git a/nuon/models/app_install_runbook_run.py b/nuon/models/app_install_runbook_run.py index e3fc84d2..b7d36d32 100644 --- a/nuon/models/app_install_runbook_run.py +++ b/nuon/models/app_install_runbook_run.py @@ -12,7 +12,10 @@ from ..models.app_account import AppAccount from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_runbook import AppInstallRunbook + from ..models.app_install_runbook_run_runbook_inputs import AppInstallRunbookRunRunbookInputs + from ..models.app_install_runbook_run_runbook_inputs_redacted import AppInstallRunbookRunRunbookInputsRedacted from ..models.app_runbook_config import AppRunbookConfig + from ..models.app_runbook_step_selection import AppRunbookStepSelection from ..models.app_workflow import AppWorkflow @@ -35,9 +38,14 @@ class AppInstallRunbookRun: install_workflow_id (str | Unset): runbook_config (AppRunbookConfig | Unset): runbook_config_id (str | Unset): + runbook_inputs (AppInstallRunbookRunRunbookInputs | Unset): + runbook_inputs_redacted (AppInstallRunbookRunRunbookInputsRedacted | Unset): status (str | Unset): status_description (str | Unset): status_v2 (AppCompositeStatus | Unset): + step_selections (list[AppRunbookStepSelection] | Unset): StepSelections records which runbook steps are + enabled/disabled for this run. + Steps explicitly disabled here are not generated by the runbook workflow. triggered_by_id (str | Unset): updated_at (str | Unset): """ @@ -54,9 +62,12 @@ class AppInstallRunbookRun: install_workflow_id: str | Unset = UNSET runbook_config: AppRunbookConfig | Unset = UNSET runbook_config_id: str | Unset = UNSET + runbook_inputs: AppInstallRunbookRunRunbookInputs | Unset = UNSET + runbook_inputs_redacted: AppInstallRunbookRunRunbookInputsRedacted | Unset = UNSET status: str | Unset = UNSET status_description: str | Unset = UNSET status_v2: AppCompositeStatus | Unset = UNSET + step_selections: list[AppRunbookStepSelection] | Unset = UNSET triggered_by_id: str | Unset = UNSET updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -94,6 +105,14 @@ def to_dict(self) -> dict[str, Any]: runbook_config_id = self.runbook_config_id + runbook_inputs: dict[str, Any] | Unset = UNSET + if not isinstance(self.runbook_inputs, Unset): + runbook_inputs = self.runbook_inputs.to_dict() + + runbook_inputs_redacted: dict[str, Any] | Unset = UNSET + if not isinstance(self.runbook_inputs_redacted, Unset): + runbook_inputs_redacted = self.runbook_inputs_redacted.to_dict() + status = self.status status_description = self.status_description @@ -102,6 +121,13 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.status_v2, Unset): status_v2 = self.status_v2.to_dict() + step_selections: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.step_selections, Unset): + step_selections = [] + for step_selections_item_data in self.step_selections: + step_selections_item = step_selections_item_data.to_dict() + step_selections.append(step_selections_item) + triggered_by_id = self.triggered_by_id updated_at = self.updated_at @@ -133,12 +159,18 @@ def to_dict(self) -> dict[str, Any]: field_dict["runbook_config"] = runbook_config if runbook_config_id is not UNSET: field_dict["runbook_config_id"] = runbook_config_id + if runbook_inputs is not UNSET: + field_dict["runbook_inputs"] = runbook_inputs + if runbook_inputs_redacted is not UNSET: + field_dict["runbook_inputs_redacted"] = runbook_inputs_redacted if status is not UNSET: field_dict["status"] = status if status_description is not UNSET: field_dict["status_description"] = status_description if status_v2 is not UNSET: field_dict["status_v2"] = status_v2 + if step_selections is not UNSET: + field_dict["step_selections"] = step_selections if triggered_by_id is not UNSET: field_dict["triggered_by_id"] = triggered_by_id if updated_at is not UNSET: @@ -151,7 +183,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_account import AppAccount from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_runbook import AppInstallRunbook + from ..models.app_install_runbook_run_runbook_inputs import AppInstallRunbookRunRunbookInputs + from ..models.app_install_runbook_run_runbook_inputs_redacted import AppInstallRunbookRunRunbookInputsRedacted from ..models.app_runbook_config import AppRunbookConfig + from ..models.app_runbook_step_selection import AppRunbookStepSelection from ..models.app_workflow import AppWorkflow d = dict(src_dict) @@ -199,6 +234,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: runbook_config_id = d.pop("runbook_config_id", UNSET) + _runbook_inputs = d.pop("runbook_inputs", UNSET) + runbook_inputs: AppInstallRunbookRunRunbookInputs | Unset + if isinstance(_runbook_inputs, Unset): + runbook_inputs = UNSET + else: + runbook_inputs = AppInstallRunbookRunRunbookInputs.from_dict(_runbook_inputs) + + _runbook_inputs_redacted = d.pop("runbook_inputs_redacted", UNSET) + runbook_inputs_redacted: AppInstallRunbookRunRunbookInputsRedacted | Unset + if isinstance(_runbook_inputs_redacted, Unset): + runbook_inputs_redacted = UNSET + else: + runbook_inputs_redacted = AppInstallRunbookRunRunbookInputsRedacted.from_dict(_runbook_inputs_redacted) + status = d.pop("status", UNSET) status_description = d.pop("status_description", UNSET) @@ -210,6 +259,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: status_v2 = AppCompositeStatus.from_dict(_status_v2) + _step_selections = d.pop("step_selections", UNSET) + step_selections: list[AppRunbookStepSelection] | Unset = UNSET + if _step_selections is not UNSET: + step_selections = [] + for step_selections_item_data in _step_selections: + step_selections_item = AppRunbookStepSelection.from_dict(step_selections_item_data) + + step_selections.append(step_selections_item) + triggered_by_id = d.pop("triggered_by_id", UNSET) updated_at = d.pop("updated_at", UNSET) @@ -227,9 +285,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_workflow_id=install_workflow_id, runbook_config=runbook_config, runbook_config_id=runbook_config_id, + runbook_inputs=runbook_inputs, + runbook_inputs_redacted=runbook_inputs_redacted, status=status, status_description=status_description, status_v2=status_v2, + step_selections=step_selections, triggered_by_id=triggered_by_id, updated_at=updated_at, ) diff --git a/nuon/models/app_install_runbook_run_runbook_inputs.py b/nuon/models/app_install_runbook_run_runbook_inputs.py new file mode 100644 index 00000000..28fc2c06 --- /dev/null +++ b/nuon/models/app_install_runbook_run_runbook_inputs.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="AppInstallRunbookRunRunbookInputs") + + +@_attrs_define +class AppInstallRunbookRunRunbookInputs: + """ """ + + 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) + app_install_runbook_run_runbook_inputs = cls() + + app_install_runbook_run_runbook_inputs.additional_properties = d + return app_install_runbook_run_runbook_inputs + + @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/nuon/models/app_install_runbook_run_runbook_inputs_redacted.py b/nuon/models/app_install_runbook_run_runbook_inputs_redacted.py new file mode 100644 index 00000000..744788af --- /dev/null +++ b/nuon/models/app_install_runbook_run_runbook_inputs_redacted.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="AppInstallRunbookRunRunbookInputsRedacted") + + +@_attrs_define +class AppInstallRunbookRunRunbookInputsRedacted: + """ """ + + 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) + app_install_runbook_run_runbook_inputs_redacted = cls() + + app_install_runbook_run_runbook_inputs_redacted.additional_properties = d + return app_install_runbook_run_runbook_inputs_redacted + + @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/nuon/models/app_notebook.py b/nuon/models/app_notebook.py new file mode 100644 index 00000000..28fd0a82 --- /dev/null +++ b/nuon/models/app_notebook.py @@ -0,0 +1,205 @@ +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.app_account import AppAccount + from ..models.app_notebook_cell import AppNotebookCell + from ..models.app_queue import AppQueue + + +T = TypeVar("T", bound="AppNotebook") + + +@_attrs_define +class AppNotebook: + """ + Attributes: + cell_count (int | Unset): + cells (list[AppNotebookCell] | Unset): + created_at (str | Unset): + created_by (AppAccount | Unset): + created_by_id (str | Unset): + description (str | Unset): + id (str | Unset): + install_id (str | Unset): + latest_run_at (str | Unset): + name (str | Unset): + queue (AppQueue | Unset): + status (str | Unset): + updated_at (str | Unset): + """ + + cell_count: int | Unset = UNSET + cells: list[AppNotebookCell] | Unset = UNSET + created_at: str | Unset = UNSET + created_by: AppAccount | Unset = UNSET + created_by_id: str | Unset = UNSET + description: str | Unset = UNSET + id: str | Unset = UNSET + install_id: str | Unset = UNSET + latest_run_at: str | Unset = UNSET + name: str | Unset = UNSET + queue: AppQueue | Unset = UNSET + status: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cell_count = self.cell_count + + cells: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.cells, Unset): + cells = [] + for cells_item_data in self.cells: + cells_item = cells_item_data.to_dict() + cells.append(cells_item) + + created_at = self.created_at + + created_by: dict[str, Any] | Unset = UNSET + if not isinstance(self.created_by, Unset): + created_by = self.created_by.to_dict() + + created_by_id = self.created_by_id + + description = self.description + + id = self.id + + install_id = self.install_id + + latest_run_at = self.latest_run_at + + name = self.name + + queue: dict[str, Any] | Unset = UNSET + if not isinstance(self.queue, Unset): + queue = self.queue.to_dict() + + status = self.status + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if cell_count is not UNSET: + field_dict["cell_count"] = cell_count + if cells is not UNSET: + field_dict["cells"] = cells + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by is not UNSET: + field_dict["created_by"] = created_by + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if description is not UNSET: + field_dict["description"] = description + if id is not UNSET: + field_dict["id"] = id + if install_id is not UNSET: + field_dict["install_id"] = install_id + if latest_run_at is not UNSET: + field_dict["latest_run_at"] = latest_run_at + if name is not UNSET: + field_dict["name"] = name + if queue is not UNSET: + field_dict["queue"] = queue + if status is not UNSET: + field_dict["status"] = status + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_account import AppAccount + from ..models.app_notebook_cell import AppNotebookCell + from ..models.app_queue import AppQueue + + d = dict(src_dict) + cell_count = d.pop("cell_count", UNSET) + + _cells = d.pop("cells", UNSET) + cells: list[AppNotebookCell] | Unset = UNSET + if _cells is not UNSET: + cells = [] + for cells_item_data in _cells: + cells_item = AppNotebookCell.from_dict(cells_item_data) + + cells.append(cells_item) + + created_at = d.pop("created_at", UNSET) + + _created_by = d.pop("created_by", UNSET) + created_by: AppAccount | Unset + if isinstance(_created_by, Unset): + created_by = UNSET + else: + created_by = AppAccount.from_dict(_created_by) + + created_by_id = d.pop("created_by_id", UNSET) + + description = d.pop("description", UNSET) + + id = d.pop("id", UNSET) + + install_id = d.pop("install_id", UNSET) + + latest_run_at = d.pop("latest_run_at", UNSET) + + name = d.pop("name", UNSET) + + _queue = d.pop("queue", UNSET) + queue: AppQueue | Unset + if isinstance(_queue, Unset): + queue = UNSET + else: + queue = AppQueue.from_dict(_queue) + + status = d.pop("status", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_notebook = cls( + cell_count=cell_count, + cells=cells, + created_at=created_at, + created_by=created_by, + created_by_id=created_by_id, + description=description, + id=id, + install_id=install_id, + latest_run_at=latest_run_at, + name=name, + queue=queue, + status=status, + updated_at=updated_at, + ) + + app_notebook.additional_properties = d + return app_notebook + + @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/nuon/models/app_notebook_cell.py b/nuon/models/app_notebook_cell.py new file mode 100644 index 00000000..3f0dbf36 --- /dev/null +++ b/nuon/models/app_notebook_cell.py @@ -0,0 +1,218 @@ +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.app_notebook_cell_env_vars import AppNotebookCellEnvVars + from ..models.app_notebook_cell_run import AppNotebookCellRun + from ..models.sql_null_bool import SqlNullBool + + +T = TypeVar("T", bound="AppNotebookCell") + + +@_attrs_define +class AppNotebookCell: + """ + Attributes: + command (str | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + enable_kube_config (SqlNullBool | Unset): + env_vars (AppNotebookCellEnvVars | Unset): + id (str | Unset): + inline_contents (str | Unset): + latest_run (AppNotebookCellRun | Unset): + name (str | Unset): + notebook_id (str | Unset): + position (int | Unset): Position is the 0-based ordering of this cell within the notebook. + revision (int | Unset): Revision increments on every edit; runs snapshot the revision they ran. + role (str | Unset): + timeout (int | Unset): + updated_at (str | Unset): + """ + + command: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + enable_kube_config: SqlNullBool | Unset = UNSET + env_vars: AppNotebookCellEnvVars | Unset = UNSET + id: str | Unset = UNSET + inline_contents: str | Unset = UNSET + latest_run: AppNotebookCellRun | Unset = UNSET + name: str | Unset = UNSET + notebook_id: str | Unset = UNSET + position: int | Unset = UNSET + revision: int | Unset = UNSET + role: str | Unset = UNSET + timeout: int | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + command = self.command + + created_at = self.created_at + + created_by_id = self.created_by_id + + enable_kube_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.enable_kube_config, Unset): + enable_kube_config = self.enable_kube_config.to_dict() + + env_vars: dict[str, Any] | Unset = UNSET + if not isinstance(self.env_vars, Unset): + env_vars = self.env_vars.to_dict() + + id = self.id + + inline_contents = self.inline_contents + + latest_run: dict[str, Any] | Unset = UNSET + if not isinstance(self.latest_run, Unset): + latest_run = self.latest_run.to_dict() + + name = self.name + + notebook_id = self.notebook_id + + position = self.position + + revision = self.revision + + role = self.role + + timeout = self.timeout + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if enable_kube_config is not UNSET: + field_dict["enable_kube_config"] = enable_kube_config + if env_vars is not UNSET: + field_dict["env_vars"] = env_vars + if id is not UNSET: + field_dict["id"] = id + if inline_contents is not UNSET: + field_dict["inline_contents"] = inline_contents + if latest_run is not UNSET: + field_dict["latest_run"] = latest_run + if name is not UNSET: + field_dict["name"] = name + if notebook_id is not UNSET: + field_dict["notebook_id"] = notebook_id + if position is not UNSET: + field_dict["position"] = position + if revision is not UNSET: + field_dict["revision"] = revision + if role is not UNSET: + field_dict["role"] = role + if timeout is not UNSET: + field_dict["timeout"] = timeout + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_notebook_cell_env_vars import AppNotebookCellEnvVars + from ..models.app_notebook_cell_run import AppNotebookCellRun + from ..models.sql_null_bool import SqlNullBool + + d = dict(src_dict) + command = d.pop("command", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + _enable_kube_config = d.pop("enable_kube_config", UNSET) + enable_kube_config: SqlNullBool | Unset + if isinstance(_enable_kube_config, Unset): + enable_kube_config = UNSET + else: + enable_kube_config = SqlNullBool.from_dict(_enable_kube_config) + + _env_vars = d.pop("env_vars", UNSET) + env_vars: AppNotebookCellEnvVars | Unset + if isinstance(_env_vars, Unset): + env_vars = UNSET + else: + env_vars = AppNotebookCellEnvVars.from_dict(_env_vars) + + id = d.pop("id", UNSET) + + inline_contents = d.pop("inline_contents", UNSET) + + _latest_run = d.pop("latest_run", UNSET) + latest_run: AppNotebookCellRun | Unset + if isinstance(_latest_run, Unset): + latest_run = UNSET + else: + latest_run = AppNotebookCellRun.from_dict(_latest_run) + + name = d.pop("name", UNSET) + + notebook_id = d.pop("notebook_id", UNSET) + + position = d.pop("position", UNSET) + + revision = d.pop("revision", UNSET) + + role = d.pop("role", UNSET) + + timeout = d.pop("timeout", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_notebook_cell = cls( + command=command, + created_at=created_at, + created_by_id=created_by_id, + enable_kube_config=enable_kube_config, + env_vars=env_vars, + id=id, + inline_contents=inline_contents, + latest_run=latest_run, + name=name, + notebook_id=notebook_id, + position=position, + revision=revision, + role=role, + timeout=timeout, + updated_at=updated_at, + ) + + app_notebook_cell.additional_properties = d + return app_notebook_cell + + @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/nuon/models/app_notebook_cell_env_vars.py b/nuon/models/app_notebook_cell_env_vars.py new file mode 100644 index 00000000..87b2001e --- /dev/null +++ b/nuon/models/app_notebook_cell_env_vars.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="AppNotebookCellEnvVars") + + +@_attrs_define +class AppNotebookCellEnvVars: + """ """ + + 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) + app_notebook_cell_env_vars = cls() + + app_notebook_cell_env_vars.additional_properties = d + return app_notebook_cell_env_vars + + @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/nuon/models/app_notebook_cell_run.py b/nuon/models/app_notebook_cell_run.py new file mode 100644 index 00000000..0f1339d8 --- /dev/null +++ b/nuon/models/app_notebook_cell_run.py @@ -0,0 +1,283 @@ +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.app_account import AppAccount + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_notebook_cell_run_env_vars import AppNotebookCellRunEnvVars + + +T = TypeVar("T", bound="AppNotebookCellRun") + + +@_attrs_define +class AppNotebookCellRun: + """ + Attributes: + cell_id (str | Unset): + cell_revision (int | Unset): CellRevision records which revision of the cell this run executed. + command (str | Unset): + created_at (str | Unset): + created_by (AppAccount | Unset): + created_by_id (str | Unset): + env_vars (AppNotebookCellRunEnvVars | Unset): + id (str | Unset): + idempotency_key (str | Unset): IdempotencyKey deduplicates run requests (HTTP retries / update retries). + A server-side key is always generated, so the composite unique index on + (notebook_id, idempotency_key) in Indexes() never sees an empty key. + inline_contents (str | Unset): + install_action_workflow_run_id (str | Unset): Link to the existing execution/audit artifacts. + install_id (str | Unset): + log_stream_id (str | Unset): + name (str | Unset): Cell config snapshot at run time. + notebook_id (str | Unset): + runner_job_id (str | Unset): + status (str | Unset): + status_description (str | Unset): + status_v2 (AppCompositeStatus | Unset): + triggered_by_id (str | Unset): + triggered_by_type (str | Unset): + updated_at (str | Unset): + """ + + cell_id: str | Unset = UNSET + cell_revision: int | Unset = UNSET + command: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by: AppAccount | Unset = UNSET + created_by_id: str | Unset = UNSET + env_vars: AppNotebookCellRunEnvVars | Unset = UNSET + id: str | Unset = UNSET + idempotency_key: str | Unset = UNSET + inline_contents: str | Unset = UNSET + install_action_workflow_run_id: str | Unset = UNSET + install_id: str | Unset = UNSET + log_stream_id: str | Unset = UNSET + name: str | Unset = UNSET + notebook_id: str | Unset = UNSET + runner_job_id: str | Unset = UNSET + status: str | Unset = UNSET + status_description: str | Unset = UNSET + status_v2: AppCompositeStatus | Unset = UNSET + triggered_by_id: str | Unset = UNSET + triggered_by_type: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cell_id = self.cell_id + + cell_revision = self.cell_revision + + command = self.command + + created_at = self.created_at + + created_by: dict[str, Any] | Unset = UNSET + if not isinstance(self.created_by, Unset): + created_by = self.created_by.to_dict() + + created_by_id = self.created_by_id + + env_vars: dict[str, Any] | Unset = UNSET + if not isinstance(self.env_vars, Unset): + env_vars = self.env_vars.to_dict() + + id = self.id + + idempotency_key = self.idempotency_key + + inline_contents = self.inline_contents + + install_action_workflow_run_id = self.install_action_workflow_run_id + + install_id = self.install_id + + log_stream_id = self.log_stream_id + + name = self.name + + notebook_id = self.notebook_id + + runner_job_id = self.runner_job_id + + status = self.status + + status_description = self.status_description + + status_v2: dict[str, Any] | Unset = UNSET + if not isinstance(self.status_v2, Unset): + status_v2 = self.status_v2.to_dict() + + triggered_by_id = self.triggered_by_id + + triggered_by_type = self.triggered_by_type + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if cell_id is not UNSET: + field_dict["cell_id"] = cell_id + if cell_revision is not UNSET: + field_dict["cell_revision"] = cell_revision + if command is not UNSET: + field_dict["command"] = command + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by is not UNSET: + field_dict["created_by"] = created_by + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if env_vars is not UNSET: + field_dict["env_vars"] = env_vars + if id is not UNSET: + field_dict["id"] = id + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if inline_contents is not UNSET: + field_dict["inline_contents"] = inline_contents + if install_action_workflow_run_id is not UNSET: + field_dict["install_action_workflow_run_id"] = install_action_workflow_run_id + if install_id is not UNSET: + field_dict["install_id"] = install_id + if log_stream_id is not UNSET: + field_dict["log_stream_id"] = log_stream_id + if name is not UNSET: + field_dict["name"] = name + if notebook_id is not UNSET: + field_dict["notebook_id"] = notebook_id + if runner_job_id is not UNSET: + field_dict["runner_job_id"] = runner_job_id + if status is not UNSET: + field_dict["status"] = status + if status_description is not UNSET: + field_dict["status_description"] = status_description + if status_v2 is not UNSET: + field_dict["status_v2"] = status_v2 + if triggered_by_id is not UNSET: + field_dict["triggered_by_id"] = triggered_by_id + if triggered_by_type is not UNSET: + field_dict["triggered_by_type"] = triggered_by_type + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_account import AppAccount + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_notebook_cell_run_env_vars import AppNotebookCellRunEnvVars + + d = dict(src_dict) + cell_id = d.pop("cell_id", UNSET) + + cell_revision = d.pop("cell_revision", UNSET) + + command = d.pop("command", UNSET) + + created_at = d.pop("created_at", UNSET) + + _created_by = d.pop("created_by", UNSET) + created_by: AppAccount | Unset + if isinstance(_created_by, Unset): + created_by = UNSET + else: + created_by = AppAccount.from_dict(_created_by) + + created_by_id = d.pop("created_by_id", UNSET) + + _env_vars = d.pop("env_vars", UNSET) + env_vars: AppNotebookCellRunEnvVars | Unset + if isinstance(_env_vars, Unset): + env_vars = UNSET + else: + env_vars = AppNotebookCellRunEnvVars.from_dict(_env_vars) + + id = d.pop("id", UNSET) + + idempotency_key = d.pop("idempotency_key", UNSET) + + inline_contents = d.pop("inline_contents", UNSET) + + install_action_workflow_run_id = d.pop("install_action_workflow_run_id", UNSET) + + install_id = d.pop("install_id", UNSET) + + log_stream_id = d.pop("log_stream_id", UNSET) + + name = d.pop("name", UNSET) + + notebook_id = d.pop("notebook_id", UNSET) + + runner_job_id = d.pop("runner_job_id", UNSET) + + status = d.pop("status", UNSET) + + status_description = d.pop("status_description", UNSET) + + _status_v2 = d.pop("status_v2", UNSET) + status_v2: AppCompositeStatus | Unset + if isinstance(_status_v2, Unset): + status_v2 = UNSET + else: + status_v2 = AppCompositeStatus.from_dict(_status_v2) + + triggered_by_id = d.pop("triggered_by_id", UNSET) + + triggered_by_type = d.pop("triggered_by_type", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_notebook_cell_run = cls( + cell_id=cell_id, + cell_revision=cell_revision, + command=command, + created_at=created_at, + created_by=created_by, + created_by_id=created_by_id, + env_vars=env_vars, + id=id, + idempotency_key=idempotency_key, + inline_contents=inline_contents, + install_action_workflow_run_id=install_action_workflow_run_id, + install_id=install_id, + log_stream_id=log_stream_id, + name=name, + notebook_id=notebook_id, + runner_job_id=runner_job_id, + status=status, + status_description=status_description, + status_v2=status_v2, + triggered_by_id=triggered_by_id, + triggered_by_type=triggered_by_type, + updated_at=updated_at, + ) + + app_notebook_cell_run.additional_properties = d + return app_notebook_cell_run + + @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/nuon/models/app_notebook_cell_run_env_vars.py b/nuon/models/app_notebook_cell_run_env_vars.py new file mode 100644 index 00000000..fa1f1751 --- /dev/null +++ b/nuon/models/app_notebook_cell_run_env_vars.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="AppNotebookCellRunEnvVars") + + +@_attrs_define +class AppNotebookCellRunEnvVars: + """ """ + + 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) + app_notebook_cell_run_env_vars = cls() + + app_notebook_cell_run_env_vars.additional_properties = d + return app_notebook_cell_run_env_vars + + @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/nuon/models/app_runbook_config.py b/nuon/models/app_runbook_config.py index 844cb78f..d19a8d5b 100644 --- a/nuon/models/app_runbook_config.py +++ b/nuon/models/app_runbook_config.py @@ -9,6 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.app_runbook_input import AppRunbookInput from ..models.app_runbook_step_config import AppRunbookStepConfig @@ -24,6 +25,7 @@ class AppRunbookConfig: created_at (str | Unset): created_by_id (str | Unset): id (str | Unset): + inputs (list[AppRunbookInput] | Unset): readme (str | Unset): runbook_id (str | Unset): steps (list[AppRunbookStepConfig] | Unset): @@ -35,6 +37,7 @@ class AppRunbookConfig: created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET id: str | Unset = UNSET + inputs: list[AppRunbookInput] | Unset = UNSET readme: str | Unset = UNSET runbook_id: str | Unset = UNSET steps: list[AppRunbookStepConfig] | Unset = UNSET @@ -52,6 +55,13 @@ def to_dict(self) -> dict[str, Any]: id = self.id + inputs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.inputs, Unset): + inputs = [] + for inputs_item_data in self.inputs: + inputs_item = inputs_item_data.to_dict() + inputs.append(inputs_item) + readme = self.readme runbook_id = self.runbook_id @@ -78,6 +88,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["created_by_id"] = created_by_id if id is not UNSET: field_dict["id"] = id + if inputs is not UNSET: + field_dict["inputs"] = inputs if readme is not UNSET: field_dict["readme"] = readme if runbook_id is not UNSET: @@ -91,6 +103,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_runbook_input import AppRunbookInput from ..models.app_runbook_step_config import AppRunbookStepConfig d = dict(src_dict) @@ -104,6 +117,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) + _inputs = d.pop("inputs", UNSET) + inputs: list[AppRunbookInput] | Unset = UNSET + if _inputs is not UNSET: + inputs = [] + for inputs_item_data in _inputs: + inputs_item = AppRunbookInput.from_dict(inputs_item_data) + + inputs.append(inputs_item) + readme = d.pop("readme", UNSET) runbook_id = d.pop("runbook_id", UNSET) @@ -125,6 +147,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at=created_at, created_by_id=created_by_id, id=id, + inputs=inputs, readme=readme, runbook_id=runbook_id, steps=steps, diff --git a/nuon/models/app_runbook_input.py b/nuon/models/app_runbook_input.py new file mode 100644 index 00000000..60929dac --- /dev/null +++ b/nuon/models/app_runbook_input.py @@ -0,0 +1,169 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppRunbookInput") + + +@_attrs_define +class AppRunbookInput: + """ + Attributes: + created_at (str | Unset): + created_by_id (str | Unset): + default (str | Unset): + description (str | Unset): + display_name (str | Unset): + id (str | Unset): + idx (int | Unset): + name (str | Unset): + required (bool | Unset): + runbook_config_id (str | Unset): + sensitive (bool | Unset): + type_ (str | Unset): + updated_at (str | Unset): + """ + + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + default: str | Unset = UNSET + description: str | Unset = UNSET + display_name: str | Unset = UNSET + id: str | Unset = UNSET + idx: int | Unset = UNSET + name: str | Unset = UNSET + required: bool | Unset = UNSET + runbook_config_id: str | Unset = UNSET + sensitive: bool | Unset = UNSET + type_: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + created_by_id = self.created_by_id + + default = self.default + + description = self.description + + display_name = self.display_name + + id = self.id + + idx = self.idx + + name = self.name + + required = self.required + + runbook_config_id = self.runbook_config_id + + sensitive = self.sensitive + + type_ = self.type_ + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if created_by_id is not UNSET: + field_dict["created_by_id"] = created_by_id + if default is not UNSET: + field_dict["default"] = default + if description is not UNSET: + field_dict["description"] = description + if display_name is not UNSET: + field_dict["display_name"] = display_name + if id is not UNSET: + field_dict["id"] = id + if idx is not UNSET: + field_dict["idx"] = idx + if name is not UNSET: + field_dict["name"] = name + if required is not UNSET: + field_dict["required"] = required + if runbook_config_id is not UNSET: + field_dict["runbook_config_id"] = runbook_config_id + if sensitive is not UNSET: + field_dict["sensitive"] = sensitive + if type_ is not UNSET: + field_dict["type"] = type_ + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + default = d.pop("default", UNSET) + + description = d.pop("description", UNSET) + + display_name = d.pop("display_name", UNSET) + + id = d.pop("id", UNSET) + + idx = d.pop("idx", UNSET) + + name = d.pop("name", UNSET) + + required = d.pop("required", UNSET) + + runbook_config_id = d.pop("runbook_config_id", UNSET) + + sensitive = d.pop("sensitive", UNSET) + + type_ = d.pop("type", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_runbook_input = cls( + created_at=created_at, + created_by_id=created_by_id, + default=default, + description=description, + display_name=display_name, + id=id, + idx=idx, + name=name, + required=required, + runbook_config_id=runbook_config_id, + sensitive=sensitive, + type_=type_, + updated_at=updated_at, + ) + + app_runbook_input.additional_properties = d + return app_runbook_input + + @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/nuon/models/app_runbook_step_config.py b/nuon/models/app_runbook_step_config.py index 9aaa2fde..d6db0120 100644 --- a/nuon/models/app_runbook_step_config.py +++ b/nuon/models/app_runbook_step_config.py @@ -21,10 +21,10 @@ class AppRunbookStepConfig: Attributes: action_workflow_id (str | Unset): action reference field command (str | Unset): inline action fields - component_name (str | Unset): deploy fields + component_name (str | Unset): deploy / tear-down fields created_at (str | Unset): created_by_id (str | Unset): - deploy_dependencies (bool | Unset): + deploy_dependents (bool | Unset): env_vars (AppRunbookStepConfigEnvVars | Unset): id (str | Unset): idx (int | Unset): @@ -32,6 +32,8 @@ class AppRunbookStepConfig: name (str | Unset): role (str | Unset): runbook_config_id (str | Unset): + skip_component_deploys (bool | Unset): sandbox lifecycle fields + tear_down_dependents (bool | Unset): timeout (int | Unset): type_ (str | Unset): updated_at (str | Unset): @@ -42,7 +44,7 @@ class AppRunbookStepConfig: component_name: str | Unset = UNSET created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET - deploy_dependencies: bool | Unset = UNSET + deploy_dependents: bool | Unset = UNSET env_vars: AppRunbookStepConfigEnvVars | Unset = UNSET id: str | Unset = UNSET idx: int | Unset = UNSET @@ -50,6 +52,8 @@ class AppRunbookStepConfig: name: str | Unset = UNSET role: str | Unset = UNSET runbook_config_id: str | Unset = UNSET + skip_component_deploys: bool | Unset = UNSET + tear_down_dependents: bool | Unset = UNSET timeout: int | Unset = UNSET type_: str | Unset = UNSET updated_at: str | Unset = UNSET @@ -66,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: created_by_id = self.created_by_id - deploy_dependencies = self.deploy_dependencies + deploy_dependents = self.deploy_dependents env_vars: dict[str, Any] | Unset = UNSET if not isinstance(self.env_vars, Unset): @@ -84,6 +88,10 @@ def to_dict(self) -> dict[str, Any]: runbook_config_id = self.runbook_config_id + skip_component_deploys = self.skip_component_deploys + + tear_down_dependents = self.tear_down_dependents + timeout = self.timeout type_ = self.type_ @@ -103,8 +111,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["created_at"] = created_at if created_by_id is not UNSET: field_dict["created_by_id"] = created_by_id - if deploy_dependencies is not UNSET: - field_dict["deploy_dependencies"] = deploy_dependencies + if deploy_dependents is not UNSET: + field_dict["deploy_dependents"] = deploy_dependents if env_vars is not UNSET: field_dict["env_vars"] = env_vars if id is not UNSET: @@ -119,6 +127,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["role"] = role if runbook_config_id is not UNSET: field_dict["runbook_config_id"] = runbook_config_id + if skip_component_deploys is not UNSET: + field_dict["skip_component_deploys"] = skip_component_deploys + if tear_down_dependents is not UNSET: + field_dict["tear_down_dependents"] = tear_down_dependents if timeout is not UNSET: field_dict["timeout"] = timeout if type_ is not UNSET: @@ -143,7 +155,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_id = d.pop("created_by_id", UNSET) - deploy_dependencies = d.pop("deploy_dependencies", UNSET) + deploy_dependents = d.pop("deploy_dependents", UNSET) _env_vars = d.pop("env_vars", UNSET) env_vars: AppRunbookStepConfigEnvVars | Unset @@ -164,6 +176,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: runbook_config_id = d.pop("runbook_config_id", UNSET) + skip_component_deploys = d.pop("skip_component_deploys", UNSET) + + tear_down_dependents = d.pop("tear_down_dependents", UNSET) + timeout = d.pop("timeout", UNSET) type_ = d.pop("type", UNSET) @@ -176,7 +192,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_name=component_name, created_at=created_at, created_by_id=created_by_id, - deploy_dependencies=deploy_dependencies, + deploy_dependents=deploy_dependents, env_vars=env_vars, id=id, idx=idx, @@ -184,6 +200,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, role=role, runbook_config_id=runbook_config_id, + skip_component_deploys=skip_component_deploys, + tear_down_dependents=tear_down_dependents, timeout=timeout, type_=type_, updated_at=updated_at, diff --git a/nuon/models/app_runbook_step_selection.py b/nuon/models/app_runbook_step_selection.py new file mode 100644 index 00000000..7b224e31 --- /dev/null +++ b/nuon/models/app_runbook_step_selection.py @@ -0,0 +1,79 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppRunbookStepSelection") + + +@_attrs_define +class AppRunbookStepSelection: + """ + Attributes: + enabled (bool | Unset): + name (str | Unset): + step_id (str | Unset): + """ + + enabled: bool | Unset = UNSET + name: str | Unset = UNSET + step_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + enabled = self.enabled + + name = self.name + + step_id = self.step_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enabled is not UNSET: + field_dict["enabled"] = enabled + if name is not UNSET: + field_dict["name"] = name + if step_id is not UNSET: + field_dict["step_id"] = step_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enabled = d.pop("enabled", UNSET) + + name = d.pop("name", UNSET) + + step_id = d.pop("step_id", UNSET) + + app_runbook_step_selection = cls( + enabled=enabled, + name=name, + step_id=step_id, + ) + + app_runbook_step_selection.additional_properties = d + return app_runbook_step_selection + + @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/nuon/models/plantypes_container_image_pull_plan.py b/nuon/models/plantypes_container_image_pull_plan.py index 5b449d75..4ace56de 100644 --- a/nuon/models/plantypes_container_image_pull_plan.py +++ b/nuon/models/plantypes_container_image_pull_plan.py @@ -20,33 +20,57 @@ class PlantypesContainerImagePullPlan: """ Attributes: image (str | Unset): + previous_source_digest (str | Unset): PreviousSourceDigest is the SourceDigest of the most recent prior Active + ComponentBuild for the same component, used by the runner as a dedup + hint. When the resolver returns a manifest descriptor whose digest matches + this value, the runner skips the Copy step and reports NoOp=true. + + Empty when there is no prior active build, or when the prior build has + no SourceDigest recorded (legacy builds). repo_config (ConfigsOCIRegistryRepository | Unset): tag (str | Unset): + update_policy (str | Unset): UpdatePolicy is an optional Masterminds-compatible semver constraint + (e.g. "~1.25.0") propagated from the user's component config. When + non-empty, the runner lists tags from the source registry, filters to + those satisfying the constraint, and selects the highest matching + tag at build time. Tag is then ignored as the source ref. + + Empty for components that don't use update_policy. """ image: str | Unset = UNSET + previous_source_digest: str | Unset = UNSET repo_config: ConfigsOCIRegistryRepository | Unset = UNSET tag: str | Unset = UNSET + update_policy: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: image = self.image + previous_source_digest = self.previous_source_digest + repo_config: dict[str, Any] | Unset = UNSET if not isinstance(self.repo_config, Unset): repo_config = self.repo_config.to_dict() tag = self.tag + update_policy = self.update_policy + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) if image is not UNSET: field_dict["image"] = image + if previous_source_digest is not UNSET: + field_dict["previous_source_digest"] = previous_source_digest if repo_config is not UNSET: field_dict["repo_config"] = repo_config if tag is not UNSET: field_dict["tag"] = tag + if update_policy is not UNSET: + field_dict["update_policy"] = update_policy return field_dict @@ -57,6 +81,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) image = d.pop("image", UNSET) + previous_source_digest = d.pop("previous_source_digest", UNSET) + _repo_config = d.pop("repo_config", UNSET) repo_config: ConfigsOCIRegistryRepository | Unset if isinstance(_repo_config, Unset): @@ -66,10 +92,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tag = d.pop("tag", UNSET) + update_policy = d.pop("update_policy", UNSET) + plantypes_container_image_pull_plan = cls( image=image, + previous_source_digest=previous_source_digest, repo_config=repo_config, tag=tag, + update_policy=update_policy, ) plantypes_container_image_pull_plan.additional_properties = d diff --git a/nuon/models/plantypes_deploy_plan.py b/nuon/models/plantypes_deploy_plan.py index 7a6a9abb..a052c4ee 100644 --- a/nuon/models/plantypes_deploy_plan.py +++ b/nuon/models/plantypes_deploy_plan.py @@ -39,6 +39,12 @@ class PlantypesDeployPlan: noop (PlantypesNoopDeployPlan | Unset): pulumi (PlantypesPulumiDeployPlan | Unset): sandbox_mode (PlantypesSandboxMode | Unset): + src_digest (str | Unset): SrcDigest is the manifest digest of the source artifact in the install + registry, e.g. "sha256:abc...". Populated for image-type component + builds with source identity recorded; empty for + non-image builds and legacy image builds. When non-empty, runners + should prefer this over SrcTag for content-addressed pulls and for + rendering digest-pinned image references in pod specs. terraform (PlantypesTerraformDeployPlan | Unset): """ @@ -56,6 +62,7 @@ class PlantypesDeployPlan: noop: PlantypesNoopDeployPlan | Unset = UNSET pulumi: PlantypesPulumiDeployPlan | Unset = UNSET sandbox_mode: PlantypesSandboxMode | Unset = UNSET + src_digest: str | Unset = UNSET terraform: PlantypesTerraformDeployPlan | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -98,6 +105,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.sandbox_mode, Unset): sandbox_mode = self.sandbox_mode.to_dict() + src_digest = self.src_digest + terraform: dict[str, Any] | Unset = UNSET if not isinstance(self.terraform, Unset): terraform = self.terraform.to_dict() @@ -134,6 +143,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["pulumi"] = pulumi if sandbox_mode is not UNSET: field_dict["sandbox_mode"] = sandbox_mode + if src_digest is not UNSET: + field_dict["src_digest"] = src_digest if terraform is not UNSET: field_dict["terraform"] = terraform @@ -203,6 +214,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: sandbox_mode = PlantypesSandboxMode.from_dict(_sandbox_mode) + src_digest = d.pop("src_digest", UNSET) + _terraform = d.pop("terraform", UNSET) terraform: PlantypesTerraformDeployPlan | Unset if isinstance(_terraform, Unset): @@ -225,6 +238,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: noop=noop, pulumi=pulumi, sandbox_mode=sandbox_mode, + src_digest=src_digest, terraform=terraform, ) diff --git a/nuon/models/plantypes_helm_deploy_plan.py b/nuon/models/plantypes_helm_deploy_plan.py index fd7d729c..3a838049 100644 --- a/nuon/models/plantypes_helm_deploy_plan.py +++ b/nuon/models/plantypes_helm_deploy_plan.py @@ -39,6 +39,9 @@ class PlantypesHelmDeployPlan: take_ownership (bool | Unset): values (list[PlantypesHelmValue] | Unset): values_files (list[str] | Unset): + values_override (str | Unset): ValuesOverride is the install-level Helm values override (raw YAML). It is + merged as the highest-precedence layer at deploy time, winning over both + ValuesFiles and Values. Empty means no override (exact no-op). """ aws_auth: GithubComNuoncoNuonPkgAwsCredentialsConfig | Unset = UNSET @@ -53,6 +56,7 @@ class PlantypesHelmDeployPlan: take_ownership: bool | Unset = UNSET values: list[PlantypesHelmValue] | Unset = UNSET values_files: list[str] | Unset = UNSET + values_override: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -95,6 +99,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.values_files, Unset): values_files = self.values_files + values_override = self.values_override + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -122,6 +128,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["values"] = values if values_files is not UNSET: field_dict["values_files"] = values_files + if values_override is not UNSET: + field_dict["values_override"] = values_override return field_dict @@ -191,6 +199,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values_files = cast(list[str], d.pop("values_files", UNSET)) + values_override = d.pop("values_override", UNSET) + plantypes_helm_deploy_plan = cls( aws_auth=aws_auth, azure_auth=azure_auth, @@ -204,6 +214,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: take_ownership=take_ownership, values=values, values_files=values_files, + values_override=values_override, ) plantypes_helm_deploy_plan.additional_properties = d diff --git a/nuon/models/service_create_cell_request.py b/nuon/models/service_create_cell_request.py new file mode 100644 index 00000000..b0725d10 --- /dev/null +++ b/nuon/models/service_create_cell_request.py @@ -0,0 +1,139 @@ +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.service_create_cell_request_env_vars import ServiceCreateCellRequestEnvVars + + +T = TypeVar("T", bound="ServiceCreateCellRequest") + + +@_attrs_define +class ServiceCreateCellRequest: + """ + Attributes: + command (str | Unset): + enable_kube_config (bool | None | Unset): + env_vars (ServiceCreateCellRequestEnvVars | Unset): + inline_contents (str | Unset): + name (str | Unset): + role (str | Unset): + timeout (int | Unset): + """ + + command: str | Unset = UNSET + enable_kube_config: bool | None | Unset = UNSET + env_vars: ServiceCreateCellRequestEnvVars | Unset = UNSET + inline_contents: str | Unset = UNSET + name: str | Unset = UNSET + role: str | Unset = UNSET + timeout: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + command = self.command + + enable_kube_config: bool | None | Unset + if isinstance(self.enable_kube_config, Unset): + enable_kube_config = UNSET + else: + enable_kube_config = self.enable_kube_config + + env_vars: dict[str, Any] | Unset = UNSET + if not isinstance(self.env_vars, Unset): + env_vars = self.env_vars.to_dict() + + inline_contents = self.inline_contents + + name = self.name + + role = self.role + + timeout = self.timeout + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if enable_kube_config is not UNSET: + field_dict["enable_kube_config"] = enable_kube_config + if env_vars is not UNSET: + field_dict["env_vars"] = env_vars + if inline_contents is not UNSET: + field_dict["inline_contents"] = inline_contents + if name is not UNSET: + field_dict["name"] = name + if role is not UNSET: + field_dict["role"] = role + if timeout is not UNSET: + field_dict["timeout"] = timeout + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_create_cell_request_env_vars import ServiceCreateCellRequestEnvVars + + d = dict(src_dict) + command = d.pop("command", UNSET) + + def _parse_enable_kube_config(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + enable_kube_config = _parse_enable_kube_config(d.pop("enable_kube_config", UNSET)) + + _env_vars = d.pop("env_vars", UNSET) + env_vars: ServiceCreateCellRequestEnvVars | Unset + if isinstance(_env_vars, Unset): + env_vars = UNSET + else: + env_vars = ServiceCreateCellRequestEnvVars.from_dict(_env_vars) + + inline_contents = d.pop("inline_contents", UNSET) + + name = d.pop("name", UNSET) + + role = d.pop("role", UNSET) + + timeout = d.pop("timeout", UNSET) + + service_create_cell_request = cls( + command=command, + enable_kube_config=enable_kube_config, + env_vars=env_vars, + inline_contents=inline_contents, + name=name, + role=role, + timeout=timeout, + ) + + service_create_cell_request.additional_properties = d + return service_create_cell_request + + @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/nuon/models/service_create_cell_request_env_vars.py b/nuon/models/service_create_cell_request_env_vars.py new file mode 100644 index 00000000..795b68ba --- /dev/null +++ b/nuon/models/service_create_cell_request_env_vars.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="ServiceCreateCellRequestEnvVars") + + +@_attrs_define +class ServiceCreateCellRequestEnvVars: + """ """ + + 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) + service_create_cell_request_env_vars = cls() + + service_create_cell_request_env_vars.additional_properties = d + return service_create_cell_request_env_vars + + @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/nuon/models/service_create_external_image_component_config_request.py b/nuon/models/service_create_external_image_component_config_request.py index 5a891cf1..2e71a656 100644 --- a/nuon/models/service_create_external_image_component_config_request.py +++ b/nuon/models/service_create_external_image_component_config_request.py @@ -25,7 +25,6 @@ class ServiceCreateExternalImageComponentConfigRequest: """ Attributes: image_url (str): - tag (str): app_config_id (str | Unset): auto_approve_on_policies_passing (bool | Unset): aws_ecr_image_config (ServiceAwsECRImageConfigRequest | Unset): @@ -39,10 +38,14 @@ class ServiceCreateExternalImageComponentConfigRequest: operation_roles (ServiceCreateExternalImageComponentConfigRequestOperationRoles | Unset): references (list[str] | Unset): skip_noops (bool | Unset): + tag (str | Unset): + update_policy (str | Unset): UpdatePolicy is an optional Masterminds-compatible semver constraint + (e.g. "~1.25.0", "^2"). When set, the runner lists tags from the + source registry, filters to those satisfying the constraint, and + uses the highest matching tag. Tag becomes optional in this case. """ image_url: str - tag: str app_config_id: str | Unset = UNSET auto_approve_on_policies_passing: bool | Unset = UNSET aws_ecr_image_config: ServiceAwsECRImageConfigRequest | Unset = UNSET @@ -56,13 +59,13 @@ class ServiceCreateExternalImageComponentConfigRequest: operation_roles: ServiceCreateExternalImageComponentConfigRequestOperationRoles | Unset = UNSET references: list[str] | Unset = UNSET skip_noops: bool | Unset = UNSET + tag: str | Unset = UNSET + update_policy: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: image_url = self.image_url - tag = self.tag - app_config_id = self.app_config_id auto_approve_on_policies_passing = self.auto_approve_on_policies_passing @@ -101,12 +104,15 @@ def to_dict(self) -> dict[str, Any]: skip_noops = self.skip_noops + tag = self.tag + + update_policy = self.update_policy + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "image_url": image_url, - "tag": tag, } ) if app_config_id is not UNSET: @@ -135,6 +141,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["references"] = references if skip_noops is not UNSET: field_dict["skip_noops"] = skip_noops + if tag is not UNSET: + field_dict["tag"] = tag + if update_policy is not UNSET: + field_dict["update_policy"] = update_policy return field_dict @@ -150,8 +160,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) image_url = d.pop("image_url") - tag = d.pop("tag") - app_config_id = d.pop("app_config_id", UNSET) auto_approve_on_policies_passing = d.pop("auto_approve_on_policies_passing", UNSET) @@ -198,9 +206,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: skip_noops = d.pop("skip_noops", UNSET) + tag = d.pop("tag", UNSET) + + update_policy = d.pop("update_policy", UNSET) + service_create_external_image_component_config_request = cls( image_url=image_url, - tag=tag, app_config_id=app_config_id, auto_approve_on_policies_passing=auto_approve_on_policies_passing, aws_ecr_image_config=aws_ecr_image_config, @@ -214,6 +225,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: operation_roles=operation_roles, references=references, skip_noops=skip_noops, + tag=tag, + update_policy=update_policy, ) service_create_external_image_component_config_request.additional_properties = d diff --git a/nuon/models/service_create_notebook_request.py b/nuon/models/service_create_notebook_request.py new file mode 100644 index 00000000..b7361ccd --- /dev/null +++ b/nuon/models/service_create_notebook_request.py @@ -0,0 +1,70 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceCreateNotebookRequest") + + +@_attrs_define +class ServiceCreateNotebookRequest: + """ + Attributes: + description (str | Unset): + name (str | Unset): + """ + + description: str | Unset = UNSET + name: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + description = self.description + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + 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) + description = d.pop("description", UNSET) + + name = d.pop("name", UNSET) + + service_create_notebook_request = cls( + description=description, + name=name, + ) + + service_create_notebook_request.additional_properties = d + return service_create_notebook_request + + @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/nuon/models/service_create_runbook_config_request.py b/nuon/models/service_create_runbook_config_request.py index 1263d334..f0ddde9a 100644 --- a/nuon/models/service_create_runbook_config_request.py +++ b/nuon/models/service_create_runbook_config_request.py @@ -9,6 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.service_create_runbook_input_request import ServiceCreateRunbookInputRequest from ..models.service_create_runbook_step_config_request import ServiceCreateRunbookStepConfigRequest @@ -21,11 +22,13 @@ class ServiceCreateRunbookConfigRequest: Attributes: steps (list[ServiceCreateRunbookStepConfigRequest]): app_config_id (str | Unset): + inputs (list[ServiceCreateRunbookInputRequest] | Unset): readme (str | Unset): """ steps: list[ServiceCreateRunbookStepConfigRequest] app_config_id: str | Unset = UNSET + inputs: list[ServiceCreateRunbookInputRequest] | Unset = UNSET readme: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -37,6 +40,13 @@ def to_dict(self) -> dict[str, Any]: app_config_id = self.app_config_id + inputs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.inputs, Unset): + inputs = [] + for inputs_item_data in self.inputs: + inputs_item = inputs_item_data.to_dict() + inputs.append(inputs_item) + readme = self.readme field_dict: dict[str, Any] = {} @@ -48,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: ) if app_config_id is not UNSET: field_dict["app_config_id"] = app_config_id + if inputs is not UNSET: + field_dict["inputs"] = inputs if readme is not UNSET: field_dict["readme"] = readme @@ -55,6 +67,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_create_runbook_input_request import ServiceCreateRunbookInputRequest from ..models.service_create_runbook_step_config_request import ServiceCreateRunbookStepConfigRequest d = dict(src_dict) @@ -67,11 +80,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_config_id = d.pop("app_config_id", UNSET) + _inputs = d.pop("inputs", UNSET) + inputs: list[ServiceCreateRunbookInputRequest] | Unset = UNSET + if _inputs is not UNSET: + inputs = [] + for inputs_item_data in _inputs: + inputs_item = ServiceCreateRunbookInputRequest.from_dict(inputs_item_data) + + inputs.append(inputs_item) + readme = d.pop("readme", UNSET) service_create_runbook_config_request = cls( steps=steps, app_config_id=app_config_id, + inputs=inputs, readme=readme, ) diff --git a/nuon/models/service_create_runbook_input_request.py b/nuon/models/service_create_runbook_input_request.py new file mode 100644 index 00000000..996ba8ef --- /dev/null +++ b/nuon/models/service_create_runbook_input_request.py @@ -0,0 +1,117 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceCreateRunbookInputRequest") + + +@_attrs_define +class ServiceCreateRunbookInputRequest: + """ + Attributes: + name (str): + default (str | Unset): + description (str | Unset): + display_name (str | Unset): + required (bool | Unset): + sensitive (bool | Unset): + type_ (str | Unset): + """ + + name: str + default: str | Unset = UNSET + description: str | Unset = UNSET + display_name: str | Unset = UNSET + required: bool | Unset = UNSET + sensitive: bool | Unset = UNSET + type_: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + default = self.default + + description = self.description + + display_name = self.display_name + + required = self.required + + sensitive = self.sensitive + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + } + ) + if default is not UNSET: + field_dict["default"] = default + if description is not UNSET: + field_dict["description"] = description + if display_name is not UNSET: + field_dict["display_name"] = display_name + if required is not UNSET: + field_dict["required"] = required + if sensitive is not UNSET: + field_dict["sensitive"] = sensitive + 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: + d = dict(src_dict) + name = d.pop("name") + + default = d.pop("default", UNSET) + + description = d.pop("description", UNSET) + + display_name = d.pop("display_name", UNSET) + + required = d.pop("required", UNSET) + + sensitive = d.pop("sensitive", UNSET) + + type_ = d.pop("type", UNSET) + + service_create_runbook_input_request = cls( + name=name, + default=default, + description=description, + display_name=display_name, + required=required, + sensitive=sensitive, + type_=type_, + ) + + service_create_runbook_input_request.additional_properties = d + return service_create_runbook_input_request + + @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/nuon/models/service_create_runbook_run_request.py b/nuon/models/service_create_runbook_run_request.py new file mode 100644 index 00000000..06729cb6 --- /dev/null +++ b/nuon/models/service_create_runbook_run_request.py @@ -0,0 +1,97 @@ +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.service_create_runbook_run_request_inputs import ServiceCreateRunbookRunRequestInputs + from ..models.service_create_runbook_run_step_selection import ServiceCreateRunbookRunStepSelection + + +T = TypeVar("T", bound="ServiceCreateRunbookRunRequest") + + +@_attrs_define +class ServiceCreateRunbookRunRequest: + """ + Attributes: + inputs (ServiceCreateRunbookRunRequestInputs | Unset): + steps (list[ServiceCreateRunbookRunStepSelection] | Unset): + """ + + inputs: ServiceCreateRunbookRunRequestInputs | Unset = UNSET + steps: list[ServiceCreateRunbookRunStepSelection] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + inputs: dict[str, Any] | Unset = UNSET + if not isinstance(self.inputs, Unset): + inputs = self.inputs.to_dict() + + steps: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.steps, Unset): + steps = [] + for steps_item_data in self.steps: + steps_item = steps_item_data.to_dict() + steps.append(steps_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if inputs is not UNSET: + field_dict["inputs"] = inputs + if steps is not UNSET: + field_dict["steps"] = steps + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_create_runbook_run_request_inputs import ServiceCreateRunbookRunRequestInputs + from ..models.service_create_runbook_run_step_selection import ServiceCreateRunbookRunStepSelection + + d = dict(src_dict) + _inputs = d.pop("inputs", UNSET) + inputs: ServiceCreateRunbookRunRequestInputs | Unset + if isinstance(_inputs, Unset): + inputs = UNSET + else: + inputs = ServiceCreateRunbookRunRequestInputs.from_dict(_inputs) + + _steps = d.pop("steps", UNSET) + steps: list[ServiceCreateRunbookRunStepSelection] | Unset = UNSET + if _steps is not UNSET: + steps = [] + for steps_item_data in _steps: + steps_item = ServiceCreateRunbookRunStepSelection.from_dict(steps_item_data) + + steps.append(steps_item) + + service_create_runbook_run_request = cls( + inputs=inputs, + steps=steps, + ) + + service_create_runbook_run_request.additional_properties = d + return service_create_runbook_run_request + + @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/nuon/models/service_create_runbook_run_request_inputs.py b/nuon/models/service_create_runbook_run_request_inputs.py new file mode 100644 index 00000000..af22e92a --- /dev/null +++ b/nuon/models/service_create_runbook_run_request_inputs.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="ServiceCreateRunbookRunRequestInputs") + + +@_attrs_define +class ServiceCreateRunbookRunRequestInputs: + """ """ + + 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) + service_create_runbook_run_request_inputs = cls() + + service_create_runbook_run_request_inputs.additional_properties = d + return service_create_runbook_run_request_inputs + + @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/nuon/models/service_create_runbook_run_step_selection.py b/nuon/models/service_create_runbook_run_step_selection.py new file mode 100644 index 00000000..459b30f7 --- /dev/null +++ b/nuon/models/service_create_runbook_run_step_selection.py @@ -0,0 +1,72 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceCreateRunbookRunStepSelection") + + +@_attrs_define +class ServiceCreateRunbookRunStepSelection: + """ + Attributes: + step_id (str): + enabled (bool | Unset): + """ + + step_id: str + enabled: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + step_id = self.step_id + + enabled = self.enabled + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "step_id": step_id, + } + ) + if enabled is not UNSET: + field_dict["enabled"] = enabled + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + step_id = d.pop("step_id") + + enabled = d.pop("enabled", UNSET) + + service_create_runbook_run_step_selection = cls( + step_id=step_id, + enabled=enabled, + ) + + service_create_runbook_run_step_selection.additional_properties = d + return service_create_runbook_run_step_selection + + @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/nuon/models/service_create_runbook_step_config_request.py b/nuon/models/service_create_runbook_step_config_request.py index 078c3a9d..b49fe931 100644 --- a/nuon/models/service_create_runbook_step_config_request.py +++ b/nuon/models/service_create_runbook_step_config_request.py @@ -26,11 +26,13 @@ class ServiceCreateRunbookStepConfigRequest: action_name (str | Unset): command (str | Unset): component_name (str | Unset): - deploy_dependencies (bool | Unset): + deploy_dependents (bool | Unset): env_vars (ServiceCreateRunbookStepConfigRequestEnvVars | Unset): idx (int | Unset): inline_contents (str | Unset): role (str | Unset): + skip_component_deploys (bool | Unset): + tear_down_dependents (bool | Unset): timeout (int | Unset): """ @@ -39,11 +41,13 @@ class ServiceCreateRunbookStepConfigRequest: action_name: str | Unset = UNSET command: str | Unset = UNSET component_name: str | Unset = UNSET - deploy_dependencies: bool | Unset = UNSET + deploy_dependents: bool | Unset = UNSET env_vars: ServiceCreateRunbookStepConfigRequestEnvVars | Unset = UNSET idx: int | Unset = UNSET inline_contents: str | Unset = UNSET role: str | Unset = UNSET + skip_component_deploys: bool | Unset = UNSET + tear_down_dependents: bool | Unset = UNSET timeout: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -58,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: component_name = self.component_name - deploy_dependencies = self.deploy_dependencies + deploy_dependents = self.deploy_dependents env_vars: dict[str, Any] | Unset = UNSET if not isinstance(self.env_vars, Unset): @@ -70,6 +74,10 @@ def to_dict(self) -> dict[str, Any]: role = self.role + skip_component_deploys = self.skip_component_deploys + + tear_down_dependents = self.tear_down_dependents + timeout = self.timeout field_dict: dict[str, Any] = {} @@ -86,8 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["command"] = command if component_name is not UNSET: field_dict["component_name"] = component_name - if deploy_dependencies is not UNSET: - field_dict["deploy_dependencies"] = deploy_dependencies + if deploy_dependents is not UNSET: + field_dict["deploy_dependents"] = deploy_dependents if env_vars is not UNSET: field_dict["env_vars"] = env_vars if idx is not UNSET: @@ -96,6 +104,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["inline_contents"] = inline_contents if role is not UNSET: field_dict["role"] = role + if skip_component_deploys is not UNSET: + field_dict["skip_component_deploys"] = skip_component_deploys + if tear_down_dependents is not UNSET: + field_dict["tear_down_dependents"] = tear_down_dependents if timeout is not UNSET: field_dict["timeout"] = timeout @@ -118,7 +130,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_name = d.pop("component_name", UNSET) - deploy_dependencies = d.pop("deploy_dependencies", UNSET) + deploy_dependents = d.pop("deploy_dependents", UNSET) _env_vars = d.pop("env_vars", UNSET) env_vars: ServiceCreateRunbookStepConfigRequestEnvVars | Unset @@ -133,6 +145,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: role = d.pop("role", UNSET) + skip_component_deploys = d.pop("skip_component_deploys", UNSET) + + tear_down_dependents = d.pop("tear_down_dependents", UNSET) + timeout = d.pop("timeout", UNSET) service_create_runbook_step_config_request = cls( @@ -141,11 +157,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: action_name=action_name, command=command, component_name=component_name, - deploy_dependencies=deploy_dependencies, + deploy_dependents=deploy_dependents, env_vars=env_vars, idx=idx, inline_contents=inline_contents, role=role, + skip_component_deploys=skip_component_deploys, + tear_down_dependents=tear_down_dependents, timeout=timeout, ) diff --git a/nuon/models/service_reorder_cells_request.py b/nuon/models/service_reorder_cells_request.py new file mode 100644 index 00000000..6ff68368 --- /dev/null +++ b/nuon/models/service_reorder_cells_request.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="ServiceReorderCellsRequest") + + +@_attrs_define +class ServiceReorderCellsRequest: + """ + Attributes: + cell_ids (list[str]): + """ + + cell_ids: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + cell_ids = self.cell_ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "cell_ids": cell_ids, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + cell_ids = cast(list[str], d.pop("cell_ids")) + + service_reorder_cells_request = cls( + cell_ids=cell_ids, + ) + + service_reorder_cells_request.additional_properties = d + return service_reorder_cells_request + + @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/nuon/models/service_run_cell_request.py b/nuon/models/service_run_cell_request.py new file mode 100644 index 00000000..a474bbe4 --- /dev/null +++ b/nuon/models/service_run_cell_request.py @@ -0,0 +1,62 @@ +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 + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceRunCellRequest") + + +@_attrs_define +class ServiceRunCellRequest: + """ + Attributes: + idempotency_key (str | Unset): IdempotencyKey deduplicates retried run requests. Optional; a server-side + key is generated when empty. + """ + + idempotency_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + idempotency_key = self.idempotency_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + idempotency_key = d.pop("idempotency_key", UNSET) + + service_run_cell_request = cls( + idempotency_key=idempotency_key, + ) + + service_run_cell_request.additional_properties = d + return service_run_cell_request + + @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/nuon/models/service_update_cell_request.py b/nuon/models/service_update_cell_request.py new file mode 100644 index 00000000..2507fbe9 --- /dev/null +++ b/nuon/models/service_update_cell_request.py @@ -0,0 +1,139 @@ +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.service_update_cell_request_env_vars import ServiceUpdateCellRequestEnvVars + + +T = TypeVar("T", bound="ServiceUpdateCellRequest") + + +@_attrs_define +class ServiceUpdateCellRequest: + """ + Attributes: + command (str | Unset): + enable_kube_config (bool | None | Unset): + env_vars (ServiceUpdateCellRequestEnvVars | Unset): + inline_contents (str | Unset): + name (str | Unset): + role (str | Unset): + timeout (int | Unset): + """ + + command: str | Unset = UNSET + enable_kube_config: bool | None | Unset = UNSET + env_vars: ServiceUpdateCellRequestEnvVars | Unset = UNSET + inline_contents: str | Unset = UNSET + name: str | Unset = UNSET + role: str | Unset = UNSET + timeout: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + command = self.command + + enable_kube_config: bool | None | Unset + if isinstance(self.enable_kube_config, Unset): + enable_kube_config = UNSET + else: + enable_kube_config = self.enable_kube_config + + env_vars: dict[str, Any] | Unset = UNSET + if not isinstance(self.env_vars, Unset): + env_vars = self.env_vars.to_dict() + + inline_contents = self.inline_contents + + name = self.name + + role = self.role + + timeout = self.timeout + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if enable_kube_config is not UNSET: + field_dict["enable_kube_config"] = enable_kube_config + if env_vars is not UNSET: + field_dict["env_vars"] = env_vars + if inline_contents is not UNSET: + field_dict["inline_contents"] = inline_contents + if name is not UNSET: + field_dict["name"] = name + if role is not UNSET: + field_dict["role"] = role + if timeout is not UNSET: + field_dict["timeout"] = timeout + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_update_cell_request_env_vars import ServiceUpdateCellRequestEnvVars + + d = dict(src_dict) + command = d.pop("command", UNSET) + + def _parse_enable_kube_config(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + enable_kube_config = _parse_enable_kube_config(d.pop("enable_kube_config", UNSET)) + + _env_vars = d.pop("env_vars", UNSET) + env_vars: ServiceUpdateCellRequestEnvVars | Unset + if isinstance(_env_vars, Unset): + env_vars = UNSET + else: + env_vars = ServiceUpdateCellRequestEnvVars.from_dict(_env_vars) + + inline_contents = d.pop("inline_contents", UNSET) + + name = d.pop("name", UNSET) + + role = d.pop("role", UNSET) + + timeout = d.pop("timeout", UNSET) + + service_update_cell_request = cls( + command=command, + enable_kube_config=enable_kube_config, + env_vars=env_vars, + inline_contents=inline_contents, + name=name, + role=role, + timeout=timeout, + ) + + service_update_cell_request.additional_properties = d + return service_update_cell_request + + @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/nuon/models/service_update_cell_request_env_vars.py b/nuon/models/service_update_cell_request_env_vars.py new file mode 100644 index 00000000..f35858a6 --- /dev/null +++ b/nuon/models/service_update_cell_request_env_vars.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="ServiceUpdateCellRequestEnvVars") + + +@_attrs_define +class ServiceUpdateCellRequestEnvVars: + """ """ + + 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) + service_update_cell_request_env_vars = cls() + + service_update_cell_request_env_vars.additional_properties = d + return service_update_cell_request_env_vars + + @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/nuon/models/service_update_notebook_request.py b/nuon/models/service_update_notebook_request.py new file mode 100644 index 00000000..8356697f --- /dev/null +++ b/nuon/models/service_update_notebook_request.py @@ -0,0 +1,87 @@ +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 + +from ..models.service_update_notebook_request_status import ServiceUpdateNotebookRequestStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceUpdateNotebookRequest") + + +@_attrs_define +class ServiceUpdateNotebookRequest: + """ + Attributes: + description (str | Unset): + name (str | Unset): + status (ServiceUpdateNotebookRequestStatus | Unset): + """ + + description: str | Unset = UNSET + name: str | Unset = UNSET + status: ServiceUpdateNotebookRequestStatus | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + description = self.description + + name = self.name + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + if name is not UNSET: + field_dict["name"] = name + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + description = d.pop("description", UNSET) + + name = d.pop("name", UNSET) + + _status = d.pop("status", UNSET) + status: ServiceUpdateNotebookRequestStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = ServiceUpdateNotebookRequestStatus(_status) + + service_update_notebook_request = cls( + description=description, + name=name, + status=status, + ) + + service_update_notebook_request.additional_properties = d + return service_update_notebook_request + + @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/nuon/models/service_update_notebook_request_status.py b/nuon/models/service_update_notebook_request_status.py new file mode 100644 index 00000000..3bc91a8c --- /dev/null +++ b/nuon/models/service_update_notebook_request_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ServiceUpdateNotebookRequestStatus(str, Enum): + ACTIVE = "active" + ARCHIVED = "archived" + + def __str__(self) -> str: + return str(self.value) diff --git a/pyproject.toml b/pyproject.toml index 79309d2e..e40ee833 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1001" +version = "0.19.1006" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index a1929df0..1af99c90 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1001 +0.19.1006