diff --git a/nuon/api/accounts/create_static_token.py b/nuon/api/accounts/create_static_token.py index cbfc9ebc..2b4d38e6 100644 --- a/nuon/api/accounts/create_static_token.py +++ b/nuon/api/accounts/create_static_token.py @@ -67,7 +67,8 @@ def sync_detailed( Creates a long-lived static API token scoped to your current org. Each token gets its own dedicated service account, and only grants access to the current org. The role param controls the token's - permissions (org_admin, org_support, org_read_only, or org_builder) and defaults to org_read_only. + permissions (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to + org_read_only. Args: body (ServiceCreateStaticTokenRequest): @@ -100,7 +101,8 @@ def sync( Creates a long-lived static API token scoped to your current org. Each token gets its own dedicated service account, and only grants access to the current org. The role param controls the token's - permissions (org_admin, org_support, org_read_only, or org_builder) and defaults to org_read_only. + permissions (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to + org_read_only. Args: body (ServiceCreateStaticTokenRequest): @@ -128,7 +130,8 @@ async def asyncio_detailed( Creates a long-lived static API token scoped to your current org. Each token gets its own dedicated service account, and only grants access to the current org. The role param controls the token's - permissions (org_admin, org_support, org_read_only, or org_builder) and defaults to org_read_only. + permissions (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to + org_read_only. Args: body (ServiceCreateStaticTokenRequest): @@ -159,7 +162,8 @@ async def asyncio( Creates a long-lived static API token scoped to your current org. Each token gets its own dedicated service account, and only grants access to the current org. The role param controls the token's - permissions (org_admin, org_support, org_read_only, or org_builder) and defaults to org_read_only. + permissions (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to + org_read_only. Args: body (ServiceCreateStaticTokenRequest): diff --git a/nuon/api/accounts/list_roles.py b/nuon/api/accounts/list_roles.py index bf44d0ca..ec0c9e26 100644 --- a/nuon/api/accounts/list_roles.py +++ b/nuon/api/accounts/list_roles.py @@ -5,16 +5,26 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.service_role_info import ServiceRoleInfo +from ...models.app_role import AppRole from ...models.stderr_err_response import StderrErrResponse -from ...types import Response +from ...types import UNSET, Response, Unset -def _get_kwargs() -> dict[str, Any]: +def _get_kwargs( + *, + context: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["context"] = context + + 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/roles", + "params": params, } return _kwargs @@ -22,12 +32,12 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> StderrErrResponse | list[ServiceRoleInfo] | None: +) -> StderrErrResponse | list[AppRole] | None: if response.status_code == 200: response_200 = [] _response_200 = response.json() for response_200_item_data in _response_200: - response_200_item = ServiceRoleInfo.from_dict(response_200_item_data) + response_200_item = AppRole.from_dict(response_200_item_data) response_200.append(response_200_item) @@ -51,7 +61,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[StderrErrResponse | list[ServiceRoleInfo]]: +) -> Response[StderrErrResponse | list[AppRole]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,22 +73,31 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[StderrErrResponse | list[ServiceRoleInfo]]: - """List assignable roles + context: str | Unset = UNSET, +) -> Response[StderrErrResponse | list[AppRole]]: + """List your org's roles + + List your org's roles. Each role carries its display metadata (`title`, + `description`) and the assignment surfaces it may be offered on via the + `applies_to` field (`team`, `service_account`, `api_token`, + `oidc_trust_policy`). A role with no `applies_to` entries exists and may be + displayed, but cannot be newly assigned. Pass `?context=` to filter + to the roles assignable on a single surface. - List the roles that can be assigned to members and service accounts in an - organization. Each role indicates which principal types it applies to via the - `applies_to` field (`user`, `service_account`, or both). + Args: + context (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[StderrErrResponse | list[ServiceRoleInfo]] + Response[StderrErrResponse | list[AppRole]] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + context=context, + ) response = client.get_httpx_client().request( **kwargs, @@ -90,45 +109,62 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> StderrErrResponse | list[ServiceRoleInfo] | None: - """List assignable roles + context: str | Unset = UNSET, +) -> StderrErrResponse | list[AppRole] | None: + """List your org's roles + + List your org's roles. Each role carries its display metadata (`title`, + `description`) and the assignment surfaces it may be offered on via the + `applies_to` field (`team`, `service_account`, `api_token`, + `oidc_trust_policy`). A role with no `applies_to` entries exists and may be + displayed, but cannot be newly assigned. Pass `?context=` to filter + to the roles assignable on a single surface. - List the roles that can be assigned to members and service accounts in an - organization. Each role indicates which principal types it applies to via the - `applies_to` field (`user`, `service_account`, or both). + Args: + context (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: - StderrErrResponse | list[ServiceRoleInfo] + StderrErrResponse | list[AppRole] """ return sync_detailed( client=client, + context=context, ).parsed async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[StderrErrResponse | list[ServiceRoleInfo]]: - """List assignable roles + context: str | Unset = UNSET, +) -> Response[StderrErrResponse | list[AppRole]]: + """List your org's roles + + List your org's roles. Each role carries its display metadata (`title`, + `description`) and the assignment surfaces it may be offered on via the + `applies_to` field (`team`, `service_account`, `api_token`, + `oidc_trust_policy`). A role with no `applies_to` entries exists and may be + displayed, but cannot be newly assigned. Pass `?context=` to filter + to the roles assignable on a single surface. - List the roles that can be assigned to members and service accounts in an - organization. Each role indicates which principal types it applies to via the - `applies_to` field (`user`, `service_account`, or both). + Args: + context (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[StderrErrResponse | list[ServiceRoleInfo]] + Response[StderrErrResponse | list[AppRole]] """ - kwargs = _get_kwargs() + kwargs = _get_kwargs( + context=context, + ) response = await client.get_async_httpx_client().request(**kwargs) @@ -138,23 +174,31 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> StderrErrResponse | list[ServiceRoleInfo] | None: - """List assignable roles + context: str | Unset = UNSET, +) -> StderrErrResponse | list[AppRole] | None: + """List your org's roles + + List your org's roles. Each role carries its display metadata (`title`, + `description`) and the assignment surfaces it may be offered on via the + `applies_to` field (`team`, `service_account`, `api_token`, + `oidc_trust_policy`). A role with no `applies_to` entries exists and may be + displayed, but cannot be newly assigned. Pass `?context=` to filter + to the roles assignable on a single surface. - List the roles that can be assigned to members and service accounts in an - organization. Each role indicates which principal types it applies to via the - `applies_to` field (`user`, `service_account`, or both). + Args: + context (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: - StderrErrResponse | list[ServiceRoleInfo] + StderrErrResponse | list[AppRole] """ return ( await asyncio_detailed( client=client, + context=context, ) ).parsed diff --git a/nuon/api/apps/create_app_installs_config.py b/nuon/api/apps/create_app_installs_config.py new file mode 100644 index 00000000..e8bc42bf --- /dev/null +++ b/nuon/api/apps/create_app_installs_config.py @@ -0,0 +1,210 @@ +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_app_installs_config import AppAppInstallsConfig +from ...models.service_create_app_installs_config_request import ServiceCreateAppInstallsConfigRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + *, + body: ServiceCreateAppInstallsConfigRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/apps/{app_id}/installs-configs".format( + app_id=quote(str(app_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 +) -> AppAppInstallsConfig | StderrErrResponse | None: + if response.status_code == 201: + response_201 = AppAppInstallsConfig.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[AppAppInstallsConfig | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateAppInstallsConfigRequest, +) -> Response[AppAppInstallsConfig | StderrErrResponse]: + """create a new installs config for an app + + Creates a new installs config record (source=ui). The latest record is always used. + + Args: + app_id (str): + body (ServiceCreateAppInstallsConfigRequest): + + 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[AppAppInstallsConfig | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateAppInstallsConfigRequest, +) -> AppAppInstallsConfig | StderrErrResponse | None: + """create a new installs config for an app + + Creates a new installs config record (source=ui). The latest record is always used. + + Args: + app_id (str): + body (ServiceCreateAppInstallsConfigRequest): + + 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: + AppAppInstallsConfig | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + app_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateAppInstallsConfigRequest, +) -> Response[AppAppInstallsConfig | StderrErrResponse]: + """create a new installs config for an app + + Creates a new installs config record (source=ui). The latest record is always used. + + Args: + app_id (str): + body (ServiceCreateAppInstallsConfigRequest): + + 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[AppAppInstallsConfig | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + *, + client: AuthenticatedClient, + body: ServiceCreateAppInstallsConfigRequest, +) -> AppAppInstallsConfig | StderrErrResponse | None: + """create a new installs config for an app + + Creates a new installs config record (source=ui). The latest record is always used. + + Args: + app_id (str): + body (ServiceCreateAppInstallsConfigRequest): + + 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: + AppAppInstallsConfig | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/apps/delete_app_installs_config.py b/nuon/api/apps/delete_app_installs_config.py new file mode 100644 index 00000000..94452d35 --- /dev/null +++ b/nuon/api/apps/delete_app_installs_config.py @@ -0,0 +1,203 @@ +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.delete_app_installs_config_response_200 import DeleteAppInstallsConfigResponse200 +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + config_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/apps/{app_id}/installs-configs/{config_id}".format( + app_id=quote(str(app_id), safe=""), + config_id=quote(str(config_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAppInstallsConfigResponse200 | StderrErrResponse | None: + if response.status_code == 200: + response_200 = DeleteAppInstallsConfigResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[DeleteAppInstallsConfigResponse200 | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteAppInstallsConfigResponse200 | StderrErrResponse]: + """soft-delete an installs config + + Soft-deletes an installs config record. The next latest record becomes active. + + Args: + app_id (str): + config_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[DeleteAppInstallsConfigResponse200 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + config_id=config_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, +) -> DeleteAppInstallsConfigResponse200 | StderrErrResponse | None: + """soft-delete an installs config + + Soft-deletes an installs config record. The next latest record becomes active. + + Args: + app_id (str): + config_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: + DeleteAppInstallsConfigResponse200 | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + config_id=config_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteAppInstallsConfigResponse200 | StderrErrResponse]: + """soft-delete an installs config + + Soft-deletes an installs config record. The next latest record becomes active. + + Args: + app_id (str): + config_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[DeleteAppInstallsConfigResponse200 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + config_id=config_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + config_id: str, + *, + client: AuthenticatedClient, +) -> DeleteAppInstallsConfigResponse200 | StderrErrResponse | None: + """soft-delete an installs config + + Soft-deletes an installs config record. The next latest record becomes active. + + Args: + app_id (str): + config_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: + DeleteAppInstallsConfigResponse200 | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + config_id=config_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_app_install_sync.py b/nuon/api/apps/get_app_install_sync.py new file mode 100644 index 00000000..1c653fcc --- /dev/null +++ b/nuon/api/apps/get_app_install_sync.py @@ -0,0 +1,203 @@ +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_app_install_config_sync import AppAppInstallConfigSync +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + sync_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/install-syncs/{sync_id}".format( + app_id=quote(str(app_id), safe=""), + sync_id=quote(str(sync_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppAppInstallConfigSync | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppAppInstallConfigSync.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[AppAppInstallConfigSync | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + sync_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallConfigSync | StderrErrResponse]: + """get a single app install config sync + + Returns a single app install config sync record with child install config syncs. + + Args: + app_id (str): + sync_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[AppAppInstallConfigSync | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + sync_id=sync_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + sync_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallConfigSync | StderrErrResponse | None: + """get a single app install config sync + + Returns a single app install config sync record with child install config syncs. + + Args: + app_id (str): + sync_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: + AppAppInstallConfigSync | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + sync_id=sync_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + sync_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallConfigSync | StderrErrResponse]: + """get a single app install config sync + + Returns a single app install config sync record with child install config syncs. + + Args: + app_id (str): + sync_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[AppAppInstallConfigSync | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + sync_id=sync_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + sync_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallConfigSync | StderrErrResponse | None: + """get a single app install config sync + + Returns a single app install config sync record with child install config syncs. + + Args: + app_id (str): + sync_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: + AppAppInstallConfigSync | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + sync_id=sync_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_app_install_syncs.py b/nuon/api/apps/get_app_install_syncs.py new file mode 100644 index 00000000..f6c72a7e --- /dev/null +++ b/nuon/api/apps/get_app_install_syncs.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_app_install_config_sync import AppAppInstallConfigSync +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/install-syncs".format( + app_id=quote(str(app_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppAppInstallConfigSync] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppAppInstallConfigSync.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[StderrErrResponse | list[AppAppInstallConfigSync]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppAppInstallConfigSync]]: + """list app install config syncs + + Returns a list of app install config sync records for the given app. + + Args: + app_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[StderrErrResponse | list[AppAppInstallConfigSync]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppAppInstallConfigSync] | None: + """list app install config syncs + + Returns a list of app install config sync records for the given app. + + Args: + app_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: + StderrErrResponse | list[AppAppInstallConfigSync] + """ + + return sync_detailed( + app_id=app_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppAppInstallConfigSync]]: + """list app install config syncs + + Returns a list of app install config sync records for the given app. + + Args: + app_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[StderrErrResponse | list[AppAppInstallConfigSync]] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppAppInstallConfigSync] | None: + """list app install config syncs + + Returns a list of app install config sync records for the given app. + + Args: + app_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: + StderrErrResponse | list[AppAppInstallConfigSync] + """ + + return ( + await asyncio_detailed( + app_id=app_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/get_app_installs_config.py b/nuon/api/apps/get_app_installs_config.py new file mode 100644 index 00000000..563372d1 --- /dev/null +++ b/nuon/api/apps/get_app_installs_config.py @@ -0,0 +1,189 @@ +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_app_installs_config import AppAppInstallsConfig +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/apps/{app_id}/installs-configs".format( + app_id=quote(str(app_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppAppInstallsConfig | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppAppInstallsConfig.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[AppAppInstallsConfig | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallsConfig | StderrErrResponse]: + """get latest installs config for an app + + Returns the latest installs config (git source for install config files). + + Args: + app_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[AppAppInstallsConfig | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallsConfig | StderrErrResponse | None: + """get latest installs config for an app + + Returns the latest installs config (git source for install config files). + + Args: + app_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: + AppAppInstallsConfig | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallsConfig | StderrErrResponse]: + """get latest installs config for an app + + Returns the latest installs config (git source for install config files). + + Args: + app_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[AppAppInstallsConfig | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallsConfig | StderrErrResponse | None: + """get latest installs config for an app + + Returns the latest installs config (git source for install config files). + + Args: + app_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: + AppAppInstallsConfig | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + client=client, + ) + ).parsed diff --git a/nuon/api/apps/respond_install_creation_approval.py b/nuon/api/apps/respond_install_creation_approval.py new file mode 100644 index 00000000..693e106e --- /dev/null +++ b/nuon/api/apps/respond_install_creation_approval.py @@ -0,0 +1,242 @@ +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.respond_install_creation_approval_response_202 import RespondInstallCreationApprovalResponse202 +from ...models.service_respond_install_creation_approval_request import ServiceRespondInstallCreationApprovalRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, + sync_id: str, + approval_id: str, + *, + body: ServiceRespondInstallCreationApprovalRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/apps/{app_id}/install-syncs/{sync_id}/approvals/{approval_id}/response".format( + app_id=quote(str(app_id), safe=""), + sync_id=quote(str(sync_id), safe=""), + approval_id=quote(str(approval_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 +) -> RespondInstallCreationApprovalResponse202 | StderrErrResponse | None: + if response.status_code == 202: + response_202 = RespondInstallCreationApprovalResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[RespondInstallCreationApprovalResponse202 | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + sync_id: str, + approval_id: str, + *, + client: AuthenticatedClient, + body: ServiceRespondInstallCreationApprovalRequest, +) -> Response[RespondInstallCreationApprovalResponse202 | StderrErrResponse]: + """respond to an install creation approval + + Approves or denies an install creation approval. On approve, creates the missing installs and re- + triggers the sync. On deny, marks the approval as denied. + + Args: + app_id (str): + sync_id (str): + approval_id (str): + body (ServiceRespondInstallCreationApprovalRequest): + + 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[RespondInstallCreationApprovalResponse202 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + sync_id=sync_id, + approval_id=approval_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + sync_id: str, + approval_id: str, + *, + client: AuthenticatedClient, + body: ServiceRespondInstallCreationApprovalRequest, +) -> RespondInstallCreationApprovalResponse202 | StderrErrResponse | None: + """respond to an install creation approval + + Approves or denies an install creation approval. On approve, creates the missing installs and re- + triggers the sync. On deny, marks the approval as denied. + + Args: + app_id (str): + sync_id (str): + approval_id (str): + body (ServiceRespondInstallCreationApprovalRequest): + + 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: + RespondInstallCreationApprovalResponse202 | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + sync_id=sync_id, + approval_id=approval_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + app_id: str, + sync_id: str, + approval_id: str, + *, + client: AuthenticatedClient, + body: ServiceRespondInstallCreationApprovalRequest, +) -> Response[RespondInstallCreationApprovalResponse202 | StderrErrResponse]: + """respond to an install creation approval + + Approves or denies an install creation approval. On approve, creates the missing installs and re- + triggers the sync. On deny, marks the approval as denied. + + Args: + app_id (str): + sync_id (str): + approval_id (str): + body (ServiceRespondInstallCreationApprovalRequest): + + 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[RespondInstallCreationApprovalResponse202 | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + sync_id=sync_id, + approval_id=approval_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + sync_id: str, + approval_id: str, + *, + client: AuthenticatedClient, + body: ServiceRespondInstallCreationApprovalRequest, +) -> RespondInstallCreationApprovalResponse202 | StderrErrResponse | None: + """respond to an install creation approval + + Approves or denies an install creation approval. On approve, creates the missing installs and re- + triggers the sync. On deny, marks the approval as denied. + + Args: + app_id (str): + sync_id (str): + approval_id (str): + body (ServiceRespondInstallCreationApprovalRequest): + + 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: + RespondInstallCreationApprovalResponse202 | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + sync_id=sync_id, + approval_id=approval_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/apps/trigger_app_install_sync.py b/nuon/api/apps/trigger_app_install_sync.py new file mode 100644 index 00000000..44eb8d1d --- /dev/null +++ b/nuon/api/apps/trigger_app_install_sync.py @@ -0,0 +1,189 @@ +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_app_install_config_sync import AppAppInstallConfigSync +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + app_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/apps/{app_id}/install-syncs".format( + app_id=quote(str(app_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppAppInstallConfigSync | StderrErrResponse | None: + if response.status_code == 202: + response_202 = AppAppInstallConfigSync.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + 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[AppAppInstallConfigSync | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallConfigSync | StderrErrResponse]: + """trigger app-level install config sync + + Triggers a sync of all install configs for the app from the configured git source. + + Args: + app_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[AppAppInstallConfigSync | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + app_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallConfigSync | StderrErrResponse | None: + """trigger app-level install config sync + + Triggers a sync of all install configs for the app from the configured git source. + + Args: + app_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: + AppAppInstallConfigSync | StderrErrResponse + """ + + return sync_detailed( + app_id=app_id, + client=client, + ).parsed + + +async def asyncio_detailed( + app_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppAppInstallConfigSync | StderrErrResponse]: + """trigger app-level install config sync + + Triggers a sync of all install configs for the app from the configured git source. + + Args: + app_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[AppAppInstallConfigSync | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + app_id: str, + *, + client: AuthenticatedClient, +) -> AppAppInstallConfigSync | StderrErrResponse | None: + """trigger app-level install config sync + + Triggers a sync of all install configs for the app from the configured git source. + + Args: + app_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: + AppAppInstallConfigSync | StderrErrResponse + """ + + return ( + await asyncio_detailed( + app_id=app_id, + client=client, + ) + ).parsed diff --git a/nuon/api/components/create_app_docker_build_component_config.py b/nuon/api/components/create_app_docker_build_component_config.py index bbcf75b5..eee1ce97 100644 --- a/nuon/api/components/create_app_docker_build_component_config.py +++ b/nuon/api/components/create_app_docker_build_component_config.py @@ -102,7 +102,8 @@ def sync_detailed( ) -> Response[AppDockerBuildComponentConfig | StderrErrResponse]: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: app_id (str): @@ -139,7 +140,8 @@ def sync( ) -> AppDockerBuildComponentConfig | StderrErrResponse | None: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: app_id (str): @@ -171,7 +173,8 @@ async def asyncio_detailed( ) -> Response[AppDockerBuildComponentConfig | StderrErrResponse]: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: app_id (str): @@ -206,7 +209,8 @@ async def asyncio( ) -> AppDockerBuildComponentConfig | StderrErrResponse | None: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: app_id (str): diff --git a/nuon/api/components/create_docker_build_component_config.py b/nuon/api/components/create_docker_build_component_config.py index 6eb9e04f..1ac325db 100644 --- a/nuon/api/components/create_docker_build_component_config.py +++ b/nuon/api/components/create_docker_build_component_config.py @@ -99,7 +99,8 @@ def sync_detailed( ) -> Response[AppDockerBuildComponentConfig | StderrErrResponse]: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: component_id (str): @@ -133,7 +134,8 @@ def sync( ) -> AppDockerBuildComponentConfig | StderrErrResponse | None: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: component_id (str): @@ -162,7 +164,8 @@ async def asyncio_detailed( ) -> Response[AppDockerBuildComponentConfig | StderrErrResponse]: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: component_id (str): @@ -194,7 +197,8 @@ async def asyncio( ) -> AppDockerBuildComponentConfig | StderrErrResponse | None: """create a docker build component config - Create a Docker build component config. + Deprecated: docker_build components are no longer supported. This endpoint always returns an error. + Use a container_image component to reference a pre-built image instead. Args: component_id (str): diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index 3c020fa7..cf8c7c2d 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -26,6 +26,8 @@ from .app_app_input_config import AppAppInputConfig from .app_app_input_group import AppAppInputGroup from .app_app_input_source import AppAppInputSource +from .app_app_install_config_sync import AppAppInstallConfigSync +from .app_app_installs_config import AppAppInstallsConfig from .app_app_kubernetes_context_config import AppAppKubernetesContextConfig from .app_app_kubernetes_contexts_config import AppAppKubernetesContextsConfig from .app_app_label_colors import AppAppLabelColors @@ -67,6 +69,7 @@ from .app_cloud_platform_region import AppCloudPlatformRegion from .app_component import AppComponent from .app_component_build import AppComponentBuild +from .app_component_build_composite_error import AppComponentBuildCompositeError from .app_component_config_connection import AppComponentConfigConnection from .app_component_config_connection_operation_roles import AppComponentConfigConnectionOperationRoles from .app_component_diff_entry import AppComponentDiffEntry @@ -100,6 +103,7 @@ from .app_install import AppInstall from .app_install_action_workflow import AppInstallActionWorkflow from .app_install_action_workflow_run import AppInstallActionWorkflowRun +from .app_install_action_workflow_run_composite_error import AppInstallActionWorkflowRunCompositeError from .app_install_action_workflow_run_outputs import AppInstallActionWorkflowRunOutputs from .app_install_action_workflow_run_run_env_vars import AppInstallActionWorkflowRunRunEnvVars from .app_install_action_workflow_run_status import AppInstallActionWorkflowRunStatus @@ -123,6 +127,8 @@ from .app_install_config_sync_metadata import AppInstallConfigSyncMetadata from .app_install_config_version import AppInstallConfigVersion from .app_install_config_version_metadata import AppInstallConfigVersionMetadata +from .app_install_creation_approval import AppInstallCreationApproval +from .app_install_creation_approval_status import AppInstallCreationApprovalStatus from .app_install_deploy import AppInstallDeploy from .app_install_deploy_outputs import AppInstallDeployOutputs from .app_install_deploy_type import AppInstallDeployType @@ -195,6 +201,7 @@ from .app_policy_report_owner_type import AppPolicyReportOwnerType from .app_policy_result import AppPolicyResult from .app_policy_violation import AppPolicyViolation +from .app_proposed_install import AppProposedInstall from .app_provider_type import AppProviderType from .app_public_git_vcs_config import AppPublicGitVCSConfig from .app_pulumi_component_config import AppPulumiComponentConfig @@ -326,6 +333,7 @@ from .credentials_assume_role_config import CredentialsAssumeRoleConfig from .credentials_service_principal_credentials import CredentialsServicePrincipalCredentials from .credentials_static_credentials import CredentialsStaticCredentials +from .delete_app_installs_config_response_200 import DeleteAppInstallsConfigResponse200 from .diff_diff import DiffDiff from .diff_diff_key import DiffDiffKey from .diff_diff_summary import DiffDiffSummary @@ -440,6 +448,7 @@ from .queue_status_response import QueueStatusResponse from .refs_ref import RefsRef from .refs_ref_type import RefsRefType +from .respond_install_creation_approval_response_202 import RespondInstallCreationApprovalResponse202 from .service_add_action_labels_request import ServiceAddActionLabelsRequest from .service_add_action_labels_request_labels import ServiceAddActionLabelsRequestLabels from .service_add_component_labels_request import ServiceAddComponentLabelsRequest @@ -510,6 +519,8 @@ from .service_create_app_input_config_request import ServiceCreateAppInputConfigRequest from .service_create_app_input_config_request_groups import ServiceCreateAppInputConfigRequestGroups from .service_create_app_input_config_request_inputs import ServiceCreateAppInputConfigRequestInputs +from .service_create_app_installs_config_request import ServiceCreateAppInstallsConfigRequest +from .service_create_app_installs_config_request_vcs_type import ServiceCreateAppInstallsConfigRequestVcsType from .service_create_app_kubernetes_contexts_config_request import ServiceCreateAppKubernetesContextsConfigRequest from .service_create_app_operation_role_config_request import ServiceCreateAppOperationRoleConfigRequest from .service_create_app_permissions_config_request import ServiceCreateAppPermissionsConfigRequest @@ -692,10 +703,13 @@ from .service_reprovision_install_sandbox_request import ServiceReprovisionInstallSandboxRequest from .service_reprovision_install_stack_request import ServiceReprovisionInstallStackRequest from .service_reset_install_health_baseline_response import ServiceResetInstallHealthBaselineResponse +from .service_respond_install_creation_approval_request import ServiceRespondInstallCreationApprovalRequest +from .service_respond_install_creation_approval_request_response_type import ( + ServiceRespondInstallCreationApprovalRequestResponseType, +) from .service_retry_workflow_request import ServiceRetryWorkflowRequest from .service_retry_workflow_response import ServiceRetryWorkflowResponse from .service_retry_workflow_step_response import ServiceRetryWorkflowStepResponse -from .service_role_info import ServiceRoleInfo from .service_run_cell_request import ServiceRunCellRequest from .service_runner_card_details_response import ServiceRunnerCardDetailsResponse from .service_runner_connection_status import ServiceRunnerConnectionStatus @@ -828,6 +842,8 @@ "AppAppInputConfig", "AppAppInputGroup", "AppAppInputSource", + "AppAppInstallConfigSync", + "AppAppInstallsConfig", "AppAppKubernetesContextConfig", "AppAppKubernetesContextsConfig", "AppAppLabelColors", @@ -869,6 +885,7 @@ "AppCloudPlatformRegion", "AppComponent", "AppComponentBuild", + "AppComponentBuildCompositeError", "AppComponentConfigConnection", "AppComponentConfigConnectionOperationRoles", "AppComponentDiffEntry", @@ -902,6 +919,7 @@ "AppInstall", "AppInstallActionWorkflow", "AppInstallActionWorkflowRun", + "AppInstallActionWorkflowRunCompositeError", "AppInstallActionWorkflowRunOutputs", "AppInstallActionWorkflowRunRunEnvVars", "AppInstallActionWorkflowRunStatus", @@ -925,6 +943,8 @@ "AppInstallConfigSyncMetadata", "AppInstallConfigVersion", "AppInstallConfigVersionMetadata", + "AppInstallCreationApproval", + "AppInstallCreationApprovalStatus", "AppInstallDeploy", "AppInstallDeployOutputs", "AppInstallDeployType", @@ -997,6 +1017,7 @@ "AppPolicyReportOwnerType", "AppPolicyResult", "AppPolicyViolation", + "AppProposedInstall", "AppProviderType", "AppPublicGitVCSConfig", "AppPulumiComponentConfig", @@ -1126,6 +1147,7 @@ "CredentialsAssumeRoleConfig", "CredentialsServicePrincipalCredentials", "CredentialsStaticCredentials", + "DeleteAppInstallsConfigResponse200", "DiffDiff", "DiffDiffKey", "DiffDiffSummary", @@ -1236,6 +1258,7 @@ "QueueStatusResponse", "RefsRef", "RefsRefType", + "RespondInstallCreationApprovalResponse202", "ServiceAddActionLabelsRequest", "ServiceAddActionLabelsRequestLabels", "ServiceAddComponentLabelsRequest", @@ -1302,6 +1325,8 @@ "ServiceCreateAppInputConfigRequest", "ServiceCreateAppInputConfigRequestGroups", "ServiceCreateAppInputConfigRequestInputs", + "ServiceCreateAppInstallsConfigRequest", + "ServiceCreateAppInstallsConfigRequestVcsType", "ServiceCreateAppKubernetesContextsConfigRequest", "ServiceCreateAppOperationRoleConfigRequest", "ServiceCreateAppPermissionsConfigRequest", @@ -1454,10 +1479,11 @@ "ServiceReprovisionInstallSandboxRequest", "ServiceReprovisionInstallStackRequest", "ServiceResetInstallHealthBaselineResponse", + "ServiceRespondInstallCreationApprovalRequest", + "ServiceRespondInstallCreationApprovalRequestResponseType", "ServiceRetryWorkflowRequest", "ServiceRetryWorkflowResponse", "ServiceRetryWorkflowStepResponse", - "ServiceRoleInfo", "ServiceRunCellRequest", "ServiceRunnerCardDetailsResponse", "ServiceRunnerConnectionStatus", diff --git a/nuon/models/app_app_install_config_sync.py b/nuon/models/app_app_install_config_sync.py new file mode 100644 index 00000000..84629511 --- /dev/null +++ b/nuon/models/app_app_install_config_sync.py @@ -0,0 +1,241 @@ +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_composite_status import AppCompositeStatus + from ..models.app_install_config_sync import AppInstallConfigSync + from ..models.app_install_creation_approval import AppInstallCreationApproval + from ..models.app_vcs_connection_commit import AppVCSConnectionCommit + from ..models.app_workflow import AppWorkflow + + +T = TypeVar("T", bound="AppAppInstallConfigSync") + + +@_attrs_define +class AppAppInstallConfigSync: + """ + Attributes: + app_id (str | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + id (str | Unset): + install_config_syncs (list[AppInstallConfigSync] | Unset): + install_creation_approval (AppInstallCreationApproval | Unset): + org_id (str | Unset): + queue_id (str | Unset): + queue_signal_id (str | Unset): + status (AppCompositeStatus | Unset): + triggered_by (str | Unset): + updated_at (str | Unset): + vcs_connection_commit (AppVCSConnectionCommit | Unset): + workflow (AppWorkflow | Unset): + workflow_id (str | Unset): + """ + + app_id: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + id: str | Unset = UNSET + install_config_syncs: list[AppInstallConfigSync] | Unset = UNSET + install_creation_approval: AppInstallCreationApproval | Unset = UNSET + org_id: str | Unset = UNSET + queue_id: str | Unset = UNSET + queue_signal_id: str | Unset = UNSET + status: AppCompositeStatus | Unset = UNSET + triggered_by: str | Unset = UNSET + updated_at: str | Unset = UNSET + vcs_connection_commit: AppVCSConnectionCommit | Unset = UNSET + workflow: AppWorkflow | Unset = UNSET + workflow_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_id = self.app_id + + created_at = self.created_at + + created_by_id = self.created_by_id + + id = self.id + + install_config_syncs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.install_config_syncs, Unset): + install_config_syncs = [] + for install_config_syncs_item_data in self.install_config_syncs: + install_config_syncs_item = install_config_syncs_item_data.to_dict() + install_config_syncs.append(install_config_syncs_item) + + install_creation_approval: dict[str, Any] | Unset = UNSET + if not isinstance(self.install_creation_approval, Unset): + install_creation_approval = self.install_creation_approval.to_dict() + + org_id = self.org_id + + queue_id = self.queue_id + + queue_signal_id = self.queue_signal_id + + status: dict[str, Any] | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.to_dict() + + triggered_by = self.triggered_by + + updated_at = self.updated_at + + vcs_connection_commit: dict[str, Any] | Unset = UNSET + if not isinstance(self.vcs_connection_commit, Unset): + vcs_connection_commit = self.vcs_connection_commit.to_dict() + + workflow: dict[str, Any] | Unset = UNSET + if not isinstance(self.workflow, Unset): + workflow = self.workflow.to_dict() + + workflow_id = self.workflow_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_id is not UNSET: + field_dict["app_id"] = app_id + 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 id is not UNSET: + field_dict["id"] = id + if install_config_syncs is not UNSET: + field_dict["install_config_syncs"] = install_config_syncs + if install_creation_approval is not UNSET: + field_dict["install_creation_approval"] = install_creation_approval + if org_id is not UNSET: + field_dict["org_id"] = org_id + if queue_id is not UNSET: + field_dict["queue_id"] = queue_id + if queue_signal_id is not UNSET: + field_dict["queue_signal_id"] = queue_signal_id + if status is not UNSET: + field_dict["status"] = status + if triggered_by is not UNSET: + field_dict["triggered_by"] = triggered_by + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if vcs_connection_commit is not UNSET: + field_dict["vcs_connection_commit"] = vcs_connection_commit + if workflow is not UNSET: + field_dict["workflow"] = workflow + if workflow_id is not UNSET: + field_dict["workflow_id"] = workflow_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_composite_status import AppCompositeStatus + from ..models.app_install_config_sync import AppInstallConfigSync + from ..models.app_install_creation_approval import AppInstallCreationApproval + from ..models.app_vcs_connection_commit import AppVCSConnectionCommit + from ..models.app_workflow import AppWorkflow + + d = dict(src_dict) + app_id = d.pop("app_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + id = d.pop("id", UNSET) + + _install_config_syncs = d.pop("install_config_syncs", UNSET) + install_config_syncs: list[AppInstallConfigSync] | Unset = UNSET + if _install_config_syncs is not UNSET: + install_config_syncs = [] + for install_config_syncs_item_data in _install_config_syncs: + install_config_syncs_item = AppInstallConfigSync.from_dict(install_config_syncs_item_data) + + install_config_syncs.append(install_config_syncs_item) + + _install_creation_approval = d.pop("install_creation_approval", UNSET) + install_creation_approval: AppInstallCreationApproval | Unset + if isinstance(_install_creation_approval, Unset): + install_creation_approval = UNSET + else: + install_creation_approval = AppInstallCreationApproval.from_dict(_install_creation_approval) + + org_id = d.pop("org_id", UNSET) + + queue_id = d.pop("queue_id", UNSET) + + queue_signal_id = d.pop("queue_signal_id", UNSET) + + _status = d.pop("status", UNSET) + status: AppCompositeStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppCompositeStatus.from_dict(_status) + + triggered_by = d.pop("triggered_by", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + _vcs_connection_commit = d.pop("vcs_connection_commit", UNSET) + vcs_connection_commit: AppVCSConnectionCommit | Unset + if isinstance(_vcs_connection_commit, Unset): + vcs_connection_commit = UNSET + else: + vcs_connection_commit = AppVCSConnectionCommit.from_dict(_vcs_connection_commit) + + _workflow = d.pop("workflow", UNSET) + workflow: AppWorkflow | Unset + if isinstance(_workflow, Unset): + workflow = UNSET + else: + workflow = AppWorkflow.from_dict(_workflow) + + workflow_id = d.pop("workflow_id", UNSET) + + app_app_install_config_sync = cls( + app_id=app_id, + created_at=created_at, + created_by_id=created_by_id, + id=id, + install_config_syncs=install_config_syncs, + install_creation_approval=install_creation_approval, + org_id=org_id, + queue_id=queue_id, + queue_signal_id=queue_signal_id, + status=status, + triggered_by=triggered_by, + updated_at=updated_at, + vcs_connection_commit=vcs_connection_commit, + workflow=workflow, + workflow_id=workflow_id, + ) + + app_app_install_config_sync.additional_properties = d + return app_app_install_config_sync + + @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_app_installs_config.py b/nuon/models/app_app_installs_config.py new file mode 100644 index 00000000..581cd279 --- /dev/null +++ b/nuon/models/app_app_installs_config.py @@ -0,0 +1,200 @@ +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_connected_github_vcs_config import AppConnectedGithubVCSConfig + from ..models.app_public_git_vcs_config import AppPublicGitVCSConfig + + +T = TypeVar("T", bound="AppAppInstallsConfig") + + +@_attrs_define +class AppAppInstallsConfig: + """ + Attributes: + app_id (str | Unset): + branch (str | Unset): + connected_github_vcs_config (AppConnectedGithubVCSConfig | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + directory (str | Unset): + id (str | Unset): + org_id (str | Unset): + public_git_vcs_config (AppPublicGitVCSConfig | Unset): + repo (str | Unset): + source (str | Unset): + updated_at (str | Unset): + vcs_connection_id (str | Unset): + vcs_type (str | Unset): + """ + + app_id: str | Unset = UNSET + branch: str | Unset = UNSET + connected_github_vcs_config: AppConnectedGithubVCSConfig | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + directory: str | Unset = UNSET + id: str | Unset = UNSET + org_id: str | Unset = UNSET + public_git_vcs_config: AppPublicGitVCSConfig | Unset = UNSET + repo: str | Unset = UNSET + source: str | Unset = UNSET + updated_at: str | Unset = UNSET + vcs_connection_id: str | Unset = UNSET + vcs_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_id = self.app_id + + branch = self.branch + + connected_github_vcs_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.connected_github_vcs_config, Unset): + connected_github_vcs_config = self.connected_github_vcs_config.to_dict() + + created_at = self.created_at + + created_by_id = self.created_by_id + + directory = self.directory + + id = self.id + + org_id = self.org_id + + public_git_vcs_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.public_git_vcs_config, Unset): + public_git_vcs_config = self.public_git_vcs_config.to_dict() + + repo = self.repo + + source = self.source + + updated_at = self.updated_at + + vcs_connection_id = self.vcs_connection_id + + vcs_type = self.vcs_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_id is not UNSET: + field_dict["app_id"] = app_id + if branch is not UNSET: + field_dict["branch"] = branch + if connected_github_vcs_config is not UNSET: + field_dict["connected_github_vcs_config"] = connected_github_vcs_config + 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 directory is not UNSET: + field_dict["directory"] = directory + if id is not UNSET: + field_dict["id"] = id + if org_id is not UNSET: + field_dict["org_id"] = org_id + if public_git_vcs_config is not UNSET: + field_dict["public_git_vcs_config"] = public_git_vcs_config + if repo is not UNSET: + field_dict["repo"] = repo + if source is not UNSET: + field_dict["source"] = source + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if vcs_connection_id is not UNSET: + field_dict["vcs_connection_id"] = vcs_connection_id + if vcs_type is not UNSET: + field_dict["vcs_type"] = vcs_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_connected_github_vcs_config import AppConnectedGithubVCSConfig + from ..models.app_public_git_vcs_config import AppPublicGitVCSConfig + + d = dict(src_dict) + app_id = d.pop("app_id", UNSET) + + branch = d.pop("branch", UNSET) + + _connected_github_vcs_config = d.pop("connected_github_vcs_config", UNSET) + connected_github_vcs_config: AppConnectedGithubVCSConfig | Unset + if isinstance(_connected_github_vcs_config, Unset): + connected_github_vcs_config = UNSET + else: + connected_github_vcs_config = AppConnectedGithubVCSConfig.from_dict(_connected_github_vcs_config) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + directory = d.pop("directory", UNSET) + + id = d.pop("id", UNSET) + + org_id = d.pop("org_id", UNSET) + + _public_git_vcs_config = d.pop("public_git_vcs_config", UNSET) + public_git_vcs_config: AppPublicGitVCSConfig | Unset + if isinstance(_public_git_vcs_config, Unset): + public_git_vcs_config = UNSET + else: + public_git_vcs_config = AppPublicGitVCSConfig.from_dict(_public_git_vcs_config) + + repo = d.pop("repo", UNSET) + + source = d.pop("source", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + vcs_connection_id = d.pop("vcs_connection_id", UNSET) + + vcs_type = d.pop("vcs_type", UNSET) + + app_app_installs_config = cls( + app_id=app_id, + branch=branch, + connected_github_vcs_config=connected_github_vcs_config, + created_at=created_at, + created_by_id=created_by_id, + directory=directory, + id=id, + org_id=org_id, + public_git_vcs_config=public_git_vcs_config, + repo=repo, + source=source, + updated_at=updated_at, + vcs_connection_id=vcs_connection_id, + vcs_type=vcs_type, + ) + + app_app_installs_config.additional_properties = d + return app_app_installs_config + + @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_component_build.py b/nuon/models/app_component_build.py index fe97a1ac..8205970e 100644 --- a/nuon/models/app_component_build.py +++ b/nuon/models/app_component_build.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: from ..models.app_account import AppAccount + from ..models.app_component_build_composite_error import AppComponentBuildCompositeError from ..models.app_component_config_connection import AppComponentConfigConnection from ..models.app_component_release import AppComponentRelease from ..models.app_composite_status import AppCompositeStatus @@ -38,6 +39,7 @@ class AppComponentBuild: component_config_version (int | Unset): component_id (str | Unset): Read-only fields set on the object to de-nest data component_name (str | Unset): + composite_error (AppComponentBuildCompositeError | Unset): created_at (str | Unset): created_by (AppAccount | Unset): created_by_id (str | Unset): @@ -96,6 +98,7 @@ class AppComponentBuild: component_config_version: int | Unset = UNSET component_id: str | Unset = UNSET component_name: str | Unset = UNSET + composite_error: AppComponentBuildCompositeError | Unset = UNSET created_at: str | Unset = UNSET created_by: AppAccount | Unset = UNSET created_by_id: str | Unset = UNSET @@ -143,6 +146,10 @@ def to_dict(self) -> dict[str, Any]: component_name = self.component_name + composite_error: dict[str, Any] | Unset = UNSET + if not isinstance(self.composite_error, Unset): + composite_error = self.composite_error.to_dict() + created_at = self.created_at created_by: dict[str, Any] | Unset = UNSET @@ -239,6 +246,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["component_id"] = component_id if component_name is not UNSET: field_dict["component_name"] = component_name + if composite_error is not UNSET: + field_dict["composite_error"] = composite_error if created_at is not UNSET: field_dict["created_at"] = created_at if created_by is not UNSET: @@ -293,6 +302,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_account import AppAccount + from ..models.app_component_build_composite_error import AppComponentBuildCompositeError from ..models.app_component_config_connection import AppComponentConfigConnection from ..models.app_component_release import AppComponentRelease from ..models.app_composite_status import AppCompositeStatus @@ -327,6 +337,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_name = d.pop("component_name", UNSET) + _composite_error = d.pop("composite_error", UNSET) + composite_error: AppComponentBuildCompositeError | Unset + if isinstance(_composite_error, Unset): + composite_error = UNSET + else: + composite_error = AppComponentBuildCompositeError.from_dict(_composite_error) + created_at = d.pop("created_at", UNSET) _created_by = d.pop("created_by", UNSET) @@ -436,6 +453,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: component_config_version=component_config_version, component_id=component_id, component_name=component_name, + composite_error=composite_error, created_at=created_at, created_by=created_by, created_by_id=created_by_id, diff --git a/nuon/models/app_component_build_composite_error.py b/nuon/models/app_component_build_composite_error.py new file mode 100644 index 00000000..7efab418 --- /dev/null +++ b/nuon/models/app_component_build_composite_error.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="AppComponentBuildCompositeError") + + +@_attrs_define +class AppComponentBuildCompositeError: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_component_build_composite_error = cls() + + app_component_build_composite_error.additional_properties = d + return app_component_build_composite_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/app_install_action_workflow_run.py b/nuon/models/app_install_action_workflow_run.py index 8e827fa3..7e208406 100644 --- a/nuon/models/app_install_action_workflow_run.py +++ b/nuon/models/app_install_action_workflow_run.py @@ -14,6 +14,7 @@ from ..models.app_action_workflow_config import AppActionWorkflowConfig from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_action_workflow import AppInstallActionWorkflow + from ..models.app_install_action_workflow_run_composite_error import AppInstallActionWorkflowRunCompositeError from ..models.app_install_action_workflow_run_outputs import AppInstallActionWorkflowRunOutputs from ..models.app_install_action_workflow_run_run_env_vars import AppInstallActionWorkflowRunRunEnvVars from ..models.app_install_action_workflow_run_step import AppInstallActionWorkflowRunStep @@ -31,6 +32,7 @@ class AppInstallActionWorkflowRun: """ Attributes: action_workflow_config_id (str | Unset): + composite_error (AppInstallActionWorkflowRunCompositeError | Unset): config (AppActionWorkflowConfig | Unset): created_at (str | Unset): created_by (AppAccount | Unset): @@ -64,6 +66,7 @@ class AppInstallActionWorkflowRun: """ action_workflow_config_id: str | Unset = UNSET + composite_error: AppInstallActionWorkflowRunCompositeError | Unset = UNSET config: AppActionWorkflowConfig | Unset = UNSET created_at: str | Unset = UNSET created_by: AppAccount | Unset = UNSET @@ -97,6 +100,10 @@ class AppInstallActionWorkflowRun: def to_dict(self) -> dict[str, Any]: action_workflow_config_id = self.action_workflow_config_id + composite_error: dict[str, Any] | Unset = UNSET + if not isinstance(self.composite_error, Unset): + composite_error = self.composite_error.to_dict() + config: dict[str, Any] | Unset = UNSET if not isinstance(self.config, Unset): config = self.config.to_dict() @@ -185,6 +192,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if action_workflow_config_id is not UNSET: field_dict["action_workflow_config_id"] = action_workflow_config_id + if composite_error is not UNSET: + field_dict["composite_error"] = composite_error if config is not UNSET: field_dict["config"] = config if created_at is not UNSET: @@ -250,6 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_action_workflow_config import AppActionWorkflowConfig from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_action_workflow import AppInstallActionWorkflow + from ..models.app_install_action_workflow_run_composite_error import AppInstallActionWorkflowRunCompositeError from ..models.app_install_action_workflow_run_outputs import AppInstallActionWorkflowRunOutputs from ..models.app_install_action_workflow_run_run_env_vars import AppInstallActionWorkflowRunRunEnvVars from ..models.app_install_action_workflow_run_step import AppInstallActionWorkflowRunStep @@ -261,6 +271,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) action_workflow_config_id = d.pop("action_workflow_config_id", UNSET) + _composite_error = d.pop("composite_error", UNSET) + composite_error: AppInstallActionWorkflowRunCompositeError | Unset + if isinstance(_composite_error, Unset): + composite_error = UNSET + else: + composite_error = AppInstallActionWorkflowRunCompositeError.from_dict(_composite_error) + _config = d.pop("config", UNSET) config: AppActionWorkflowConfig | Unset if isinstance(_config, Unset): @@ -381,6 +398,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_install_action_workflow_run = cls( action_workflow_config_id=action_workflow_config_id, + composite_error=composite_error, config=config, created_at=created_at, created_by=created_by, diff --git a/nuon/models/app_install_action_workflow_run_composite_error.py b/nuon/models/app_install_action_workflow_run_composite_error.py new file mode 100644 index 00000000..44f4837e --- /dev/null +++ b/nuon/models/app_install_action_workflow_run_composite_error.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="AppInstallActionWorkflowRunCompositeError") + + +@_attrs_define +class AppInstallActionWorkflowRunCompositeError: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_install_action_workflow_run_composite_error = cls() + + app_install_action_workflow_run_composite_error.additional_properties = d + return app_install_action_workflow_run_composite_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/app_install_creation_approval.py b/nuon/models/app_install_creation_approval.py new file mode 100644 index 00000000..9e12f72b --- /dev/null +++ b/nuon/models/app_install_creation_approval.py @@ -0,0 +1,177 @@ +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 ..models.app_install_creation_approval_status import AppInstallCreationApprovalStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_proposed_install import AppProposedInstall + + +T = TypeVar("T", bound="AppInstallCreationApproval") + + +@_attrs_define +class AppInstallCreationApproval: + """ + Attributes: + app_id (str | Unset): + app_install_config_sync_id (str | Unset): + approved_at (str | Unset): + approved_by_id (str | Unset): + created_at (str | Unset): + created_by_id (str | Unset): + id (str | Unset): + org_id (str | Unset): + proposed_installs (list[AppProposedInstall] | Unset): + status (AppInstallCreationApprovalStatus | Unset): + updated_at (str | Unset): + """ + + app_id: str | Unset = UNSET + app_install_config_sync_id: str | Unset = UNSET + approved_at: str | Unset = UNSET + approved_by_id: str | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + id: str | Unset = UNSET + org_id: str | Unset = UNSET + proposed_installs: list[AppProposedInstall] | Unset = UNSET + status: AppInstallCreationApprovalStatus | 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]: + app_id = self.app_id + + app_install_config_sync_id = self.app_install_config_sync_id + + approved_at = self.approved_at + + approved_by_id = self.approved_by_id + + created_at = self.created_at + + created_by_id = self.created_by_id + + id = self.id + + org_id = self.org_id + + proposed_installs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.proposed_installs, Unset): + proposed_installs = [] + for proposed_installs_item_data in self.proposed_installs: + proposed_installs_item = proposed_installs_item_data.to_dict() + proposed_installs.append(proposed_installs_item) + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_id is not UNSET: + field_dict["app_id"] = app_id + if app_install_config_sync_id is not UNSET: + field_dict["app_install_config_sync_id"] = app_install_config_sync_id + if approved_at is not UNSET: + field_dict["approved_at"] = approved_at + if approved_by_id is not UNSET: + field_dict["approved_by_id"] = approved_by_id + 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 id is not UNSET: + field_dict["id"] = id + if org_id is not UNSET: + field_dict["org_id"] = org_id + if proposed_installs is not UNSET: + field_dict["proposed_installs"] = proposed_installs + 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_proposed_install import AppProposedInstall + + d = dict(src_dict) + app_id = d.pop("app_id", UNSET) + + app_install_config_sync_id = d.pop("app_install_config_sync_id", UNSET) + + approved_at = d.pop("approved_at", UNSET) + + approved_by_id = d.pop("approved_by_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + id = d.pop("id", UNSET) + + org_id = d.pop("org_id", UNSET) + + _proposed_installs = d.pop("proposed_installs", UNSET) + proposed_installs: list[AppProposedInstall] | Unset = UNSET + if _proposed_installs is not UNSET: + proposed_installs = [] + for proposed_installs_item_data in _proposed_installs: + proposed_installs_item = AppProposedInstall.from_dict(proposed_installs_item_data) + + proposed_installs.append(proposed_installs_item) + + _status = d.pop("status", UNSET) + status: AppInstallCreationApprovalStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = AppInstallCreationApprovalStatus(_status) + + updated_at = d.pop("updated_at", UNSET) + + app_install_creation_approval = cls( + app_id=app_id, + app_install_config_sync_id=app_install_config_sync_id, + approved_at=approved_at, + approved_by_id=approved_by_id, + created_at=created_at, + created_by_id=created_by_id, + id=id, + org_id=org_id, + proposed_installs=proposed_installs, + status=status, + updated_at=updated_at, + ) + + app_install_creation_approval.additional_properties = d + return app_install_creation_approval + + @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_install_creation_approval_status.py b/nuon/models/app_install_creation_approval_status.py new file mode 100644 index 00000000..d1ecc83b --- /dev/null +++ b/nuon/models/app_install_creation_approval_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class AppInstallCreationApprovalStatus(str, Enum): + APPROVED = "approved" + DENIED = "denied" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/app_proposed_install.py b/nuon/models/app_proposed_install.py new file mode 100644 index 00000000..9a202105 --- /dev/null +++ b/nuon/models/app_proposed_install.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppProposedInstall") + + +@_attrs_define +class AppProposedInstall: + """ + Attributes: + config (list[int] | Unset): + file_path (str | Unset): + name (str | Unset): + """ + + config: list[int] | Unset = UNSET + file_path: 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]: + config: list[int] | Unset = UNSET + if not isinstance(self.config, Unset): + config = self.config + + file_path = self.file_path + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if config is not UNSET: + field_dict["config"] = config + if file_path is not UNSET: + field_dict["file_path"] = file_path + 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) + config = cast(list[int], d.pop("config", UNSET)) + + file_path = d.pop("file_path", UNSET) + + name = d.pop("name", UNSET) + + app_proposed_install = cls( + config=config, + file_path=file_path, + name=name, + ) + + app_proposed_install.additional_properties = d + return app_proposed_install + + @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_role.py b/nuon/models/app_role.py index d7ac53e0..e5541f3b 100644 --- a/nuon/models/app_role.py +++ b/nuon/models/app_role.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,25 +21,39 @@ class AppRole: """ Attributes: + applies_to (list[str] | Unset): created_by (AppAccount | Unset): created_at (str | Unset): created_by_id (str | Unset): + description (str | Unset): id (str | Unset): + managed (bool | Unset): policies (list[AppPolicy] | Unset): role_type (AppRoleType | Unset): + title (str | Unset): display + assignability metadata; the single source of truth read by + GET /v1/roles and every role picker. Managed roles are kept in sync + with standardOrgRoles by the authz reconciler. updated_at (str | Unset): """ + applies_to: list[str] | Unset = UNSET created_by: AppAccount | Unset = UNSET created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET + description: str | Unset = UNSET id: str | Unset = UNSET + managed: bool | Unset = UNSET policies: list[AppPolicy] | Unset = UNSET role_type: AppRoleType | Unset = UNSET + title: 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]: + applies_to: list[str] | Unset = UNSET + if not isinstance(self.applies_to, Unset): + applies_to = self.applies_to + created_by: dict[str, Any] | Unset = UNSET if not isinstance(self.created_by, Unset): created_by = self.created_by.to_dict() @@ -48,8 +62,12 @@ def to_dict(self) -> dict[str, Any]: created_by_id = self.created_by_id + description = self.description + id = self.id + managed = self.managed + policies: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.policies, Unset): policies = [] @@ -61,23 +79,33 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.role_type, Unset): role_type = self.role_type.value + title = self.title + updated_at = self.updated_at field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if applies_to is not UNSET: + field_dict["applies_to"] = applies_to if created_by is not UNSET: field_dict["createdBy"] = created_by 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 description is not UNSET: + field_dict["description"] = description if id is not UNSET: field_dict["id"] = id + if managed is not UNSET: + field_dict["managed"] = managed if policies is not UNSET: field_dict["policies"] = policies if role_type is not UNSET: field_dict["role_type"] = role_type + if title is not UNSET: + field_dict["title"] = title if updated_at is not UNSET: field_dict["updated_at"] = updated_at @@ -89,6 +117,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_policy import AppPolicy d = dict(src_dict) + applies_to = cast(list[str], d.pop("applies_to", UNSET)) + _created_by = d.pop("createdBy", UNSET) created_by: AppAccount | Unset if isinstance(_created_by, Unset): @@ -100,8 +130,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_by_id = d.pop("created_by_id", UNSET) + description = d.pop("description", UNSET) + id = d.pop("id", UNSET) + managed = d.pop("managed", UNSET) + _policies = d.pop("policies", UNSET) policies: list[AppPolicy] | Unset = UNSET if _policies is not UNSET: @@ -118,15 +152,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: role_type = AppRoleType(_role_type) + title = d.pop("title", UNSET) + updated_at = d.pop("updated_at", UNSET) app_role = cls( + applies_to=applies_to, created_by=created_by, created_at=created_at, created_by_id=created_by_id, + description=description, id=id, + managed=managed, policies=policies, role_type=role_type, + title=title, updated_at=updated_at, ) diff --git a/nuon/models/app_workflow_step_approval_type.py b/nuon/models/app_workflow_step_approval_type.py index e17b2905..49d512ef 100644 --- a/nuon/models/app_workflow_step_approval_type.py +++ b/nuon/models/app_workflow_step_approval_type.py @@ -5,6 +5,7 @@ class AppWorkflowStepApprovalType(str, Enum): APPROVE_ALL = "approve-all" APP_BRANCH_PLAN = "app_branch_plan" HELM_APPROVAL = "helm_approval" + INSTALL_CREATION = "install_creation" KUBERNETES_MANIFEST_APPROVAL = "kubernetes_manifest_approval" NOOP = "noop" PULUMI_PLAN = "pulumi_plan" diff --git a/nuon/models/app_workflow_type.py b/nuon/models/app_workflow_type.py index 584ba982..c510decb 100644 --- a/nuon/models/app_workflow_type.py +++ b/nuon/models/app_workflow_type.py @@ -8,6 +8,7 @@ class AppWorkflowType(str, Enum): APP_BRANCHES_MANUAL_UPDATE = "app_branches_manual_update" APP_BRANCH_CONFIG_UPDATE = "app_branch_config_update" APP_CONFIG_BUILD = "app_config_build" + APP_INSTALL_SYNC = "app_install_sync" COMPONENT_DISABLED = "component_disabled" COMPONENT_ENABLED = "component_enabled" DEPLOY_COMPONENTS = "deploy_components" diff --git a/nuon/models/delete_app_installs_config_response_200.py b/nuon/models/delete_app_installs_config_response_200.py new file mode 100644 index 00000000..2aa79c94 --- /dev/null +++ b/nuon/models/delete_app_installs_config_response_200.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="DeleteAppInstallsConfigResponse200") + + +@_attrs_define +class DeleteAppInstallsConfigResponse200: + """ """ + + 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) + delete_app_installs_config_response_200 = cls() + + delete_app_installs_config_response_200.additional_properties = d + return delete_app_installs_config_response_200 + + @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/respond_install_creation_approval_response_202.py b/nuon/models/respond_install_creation_approval_response_202.py new file mode 100644 index 00000000..87bcbbfe --- /dev/null +++ b/nuon/models/respond_install_creation_approval_response_202.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="RespondInstallCreationApprovalResponse202") + + +@_attrs_define +class RespondInstallCreationApprovalResponse202: + """ """ + + 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) + respond_install_creation_approval_response_202 = cls() + + respond_install_creation_approval_response_202.additional_properties = d + return respond_install_creation_approval_response_202 + + @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_app_installs_config_request.py b/nuon/models/service_create_app_installs_config_request.py new file mode 100644 index 00000000..98f098aa --- /dev/null +++ b/nuon/models/service_create_app_installs_config_request.py @@ -0,0 +1,98 @@ +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_create_app_installs_config_request_vcs_type import ServiceCreateAppInstallsConfigRequestVcsType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceCreateAppInstallsConfigRequest") + + +@_attrs_define +class ServiceCreateAppInstallsConfigRequest: + """ + Attributes: + branch (str): + repo (str): + vcs_type (ServiceCreateAppInstallsConfigRequestVcsType): + directory (str | Unset): + vcs_connection_id (str | Unset): + """ + + branch: str + repo: str + vcs_type: ServiceCreateAppInstallsConfigRequestVcsType + directory: str | Unset = UNSET + vcs_connection_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + branch = self.branch + + repo = self.repo + + vcs_type = self.vcs_type.value + + directory = self.directory + + vcs_connection_id = self.vcs_connection_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "branch": branch, + "repo": repo, + "vcs_type": vcs_type, + } + ) + if directory is not UNSET: + field_dict["directory"] = directory + if vcs_connection_id is not UNSET: + field_dict["vcs_connection_id"] = vcs_connection_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + branch = d.pop("branch") + + repo = d.pop("repo") + + vcs_type = ServiceCreateAppInstallsConfigRequestVcsType(d.pop("vcs_type")) + + directory = d.pop("directory", UNSET) + + vcs_connection_id = d.pop("vcs_connection_id", UNSET) + + service_create_app_installs_config_request = cls( + branch=branch, + repo=repo, + vcs_type=vcs_type, + directory=directory, + vcs_connection_id=vcs_connection_id, + ) + + service_create_app_installs_config_request.additional_properties = d + return service_create_app_installs_config_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_app_installs_config_request_vcs_type.py b/nuon/models/service_create_app_installs_config_request_vcs_type.py new file mode 100644 index 00000000..3aa42a19 --- /dev/null +++ b/nuon/models/service_create_app_installs_config_request_vcs_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ServiceCreateAppInstallsConfigRequestVcsType(str, Enum): + CONNECTED = "connected" + PUBLIC = "public" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/service_create_oidc_trust_policy_request.py b/nuon/models/service_create_oidc_trust_policy_request.py index bbdc380b..b422dcc5 100644 --- a/nuon/models/service_create_oidc_trust_policy_request.py +++ b/nuon/models/service_create_oidc_trust_policy_request.py @@ -28,8 +28,9 @@ class ServiceCreateOIDCTrustPolicyRequest: `:` segments. issuer_url (str): exact `iss` claim value; also used for OIDC discovery + JWKS fetching name (str): human-friendly name to identify the policy - role (str | Unset): org role granted to exchanged tokens. one of org_admin, org_support, - org_read_only, org_builder. defaults to org_read_only. + role (str | Unset): org role granted to exchanged tokens. must be assignable to trust + policies; see GET /v1/roles?context=oidc_trust_policy. defaults to + org_read_only. token_duration_seconds (int | Unset): lifetime of exchanged tokens in seconds. defaults to 3600, max 86400. """ diff --git a/nuon/models/service_create_static_token_request.py b/nuon/models/service_create_static_token_request.py index af7c8b98..1f12ae6a 100644 --- a/nuon/models/service_create_static_token_request.py +++ b/nuon/models/service_create_static_token_request.py @@ -17,8 +17,8 @@ class ServiceCreateStaticTokenRequest: Attributes: name (str): human-friendly name to identify the token later duration (str | Unset): defaults to one year Default: '8760h'. - role (str | Unset): org role granted to the token. one of org_admin, org_support, org_read_only, org_builder. - defaults to org_read_only. + role (str | Unset): org role granted to the token. must be assignable to API tokens; see + GET /v1/roles?context=api_token. defaults to org_read_only. """ name: str diff --git a/nuon/models/service_respond_install_creation_approval_request.py b/nuon/models/service_respond_install_creation_approval_request.py new file mode 100644 index 00000000..0f0500e6 --- /dev/null +++ b/nuon/models/service_respond_install_creation_approval_request.py @@ -0,0 +1,65 @@ +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_respond_install_creation_approval_request_response_type import ( + ServiceRespondInstallCreationApprovalRequestResponseType, +) + +T = TypeVar("T", bound="ServiceRespondInstallCreationApprovalRequest") + + +@_attrs_define +class ServiceRespondInstallCreationApprovalRequest: + """ + Attributes: + response_type (ServiceRespondInstallCreationApprovalRequestResponseType): + """ + + response_type: ServiceRespondInstallCreationApprovalRequestResponseType + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + response_type = self.response_type.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "response_type": response_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + response_type = ServiceRespondInstallCreationApprovalRequestResponseType(d.pop("response_type")) + + service_respond_install_creation_approval_request = cls( + response_type=response_type, + ) + + service_respond_install_creation_approval_request.additional_properties = d + return service_respond_install_creation_approval_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_respond_install_creation_approval_request_response_type.py b/nuon/models/service_respond_install_creation_approval_request_response_type.py new file mode 100644 index 00000000..9d971dbf --- /dev/null +++ b/nuon/models/service_respond_install_creation_approval_request_response_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ServiceRespondInstallCreationApprovalRequestResponseType(str, Enum): + APPROVE = "approve" + DENY = "deny" + + def __str__(self) -> str: + return str(self.value) diff --git a/nuon/models/service_role_info.py b/nuon/models/service_role_info.py deleted file mode 100644 index 3a41033c..00000000 --- a/nuon/models/service_role_info.py +++ /dev/null @@ -1,98 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.app_role_type import AppRoleType -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ServiceRoleInfo") - - -@_attrs_define -class ServiceRoleInfo: - """ - Attributes: - applies_to (list[str] | Unset): - description (str | Unset): - role_type (AppRoleType | Unset): - title (str | Unset): - """ - - applies_to: list[str] | Unset = UNSET - description: str | Unset = UNSET - role_type: AppRoleType | Unset = UNSET - title: str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - applies_to: list[str] | Unset = UNSET - if not isinstance(self.applies_to, Unset): - applies_to = self.applies_to - - description = self.description - - role_type: str | Unset = UNSET - if not isinstance(self.role_type, Unset): - role_type = self.role_type.value - - title = self.title - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if applies_to is not UNSET: - field_dict["applies_to"] = applies_to - if description is not UNSET: - field_dict["description"] = description - if role_type is not UNSET: - field_dict["role_type"] = role_type - if title is not UNSET: - field_dict["title"] = title - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - applies_to = cast(list[str], d.pop("applies_to", UNSET)) - - description = d.pop("description", UNSET) - - _role_type = d.pop("role_type", UNSET) - role_type: AppRoleType | Unset - if isinstance(_role_type, Unset): - role_type = UNSET - else: - role_type = AppRoleType(_role_type) - - title = d.pop("title", UNSET) - - service_role_info = cls( - applies_to=applies_to, - description=description, - role_type=role_type, - title=title, - ) - - service_role_info.additional_properties = d - return service_role_info - - @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/pyproject.toml b/pyproject.toml index 7658b634..cae9e6b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1113" +version = "0.19.1115" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index 3d69ea9e..4daaea4b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1113 +0.19.1115