From 310b45b2985d48c5a63220329e9c1b83a9bf38ed Mon Sep 17 00:00:00 2001 From: nuonbot Date: Sun, 2 Aug 2026 21:15:08 +0000 Subject: [PATCH] ci: generate from api 0.19.1101 --- .../installs/get_install_action_workflows.py | 15 ++ nuon/api/installs/get_install_actions.py | 15 ++ nuon/api/oidc_federation/__init__.py | 1 + .../create_oidc_trust_policy.py | 187 ++++++++++++++++ .../delete_oidc_trust_policy.py | 176 +++++++++++++++ .../oidc_federation/exchange_oidc_token.py | 196 +++++++++++++++++ .../oidc_federation/get_oidc_trust_policy.py | 174 +++++++++++++++ .../list_oidc_trust_policies.py | 147 +++++++++++++ .../update_oidc_trust_policy.py | 204 ++++++++++++++++++ nuon/models/__init__.py | 20 ++ nuon/models/app_app_branch_config.py | 11 + nuon/models/app_app_config.py | 11 + nuon/models/app_app_runner_config.py | 12 ++ nuon/models/app_install_action_workflow.py | 18 ++ nuon/models/app_install_runbook.py | 18 ++ nuon/models/app_oidc_trust_policy.py | 196 +++++++++++++++++ .../app_oidc_trust_policy_claim_conditions.py | 51 +++++ nuon/models/app_token_type.py | 1 + nuon/models/service_cli_config.py | 9 + ...ervice_create_app_runner_config_request.py | 9 + ...ervice_create_oidc_trust_policy_request.py | 119 ++++++++++ ...c_trust_policy_request_claim_conditions.py | 51 +++++ .../service_exchange_oidc_token_request.py | 69 ++++++ .../service_exchange_oidc_token_response.py | 106 +++++++++ ...ervice_update_oidc_trust_policy_request.py | 143 ++++++++++++ ...c_trust_policy_request_claim_conditions.py | 47 ++++ pyproject.toml | 2 +- version.txt | 2 +- 28 files changed, 2008 insertions(+), 2 deletions(-) create mode 100644 nuon/api/oidc_federation/__init__.py create mode 100644 nuon/api/oidc_federation/create_oidc_trust_policy.py create mode 100644 nuon/api/oidc_federation/delete_oidc_trust_policy.py create mode 100644 nuon/api/oidc_federation/exchange_oidc_token.py create mode 100644 nuon/api/oidc_federation/get_oidc_trust_policy.py create mode 100644 nuon/api/oidc_federation/list_oidc_trust_policies.py create mode 100644 nuon/api/oidc_federation/update_oidc_trust_policy.py create mode 100644 nuon/models/app_oidc_trust_policy.py create mode 100644 nuon/models/app_oidc_trust_policy_claim_conditions.py create mode 100644 nuon/models/service_create_oidc_trust_policy_request.py create mode 100644 nuon/models/service_create_oidc_trust_policy_request_claim_conditions.py create mode 100644 nuon/models/service_exchange_oidc_token_request.py create mode 100644 nuon/models/service_exchange_oidc_token_response.py create mode 100644 nuon/models/service_update_oidc_trust_policy_request.py create mode 100644 nuon/models/service_update_oidc_trust_policy_request_claim_conditions.py diff --git a/nuon/api/installs/get_install_action_workflows.py b/nuon/api/installs/get_install_action_workflows.py index 05186618..cd34d41e 100644 --- a/nuon/api/installs/get_install_action_workflows.py +++ b/nuon/api/installs/get_install_action_workflows.py @@ -14,6 +14,7 @@ def _get_kwargs( install_id: str, *, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -21,6 +22,8 @@ def _get_kwargs( params: dict[str, Any] = {} + params["synced"] = synced + params["offset"] = offset params["limit"] = limit @@ -99,6 +102,7 @@ def sync_detailed( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -109,6 +113,7 @@ def sync_detailed( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -123,6 +128,7 @@ def sync_detailed( kwargs = _get_kwargs( install_id=install_id, + synced=synced, offset=offset, limit=limit, page=page, @@ -139,6 +145,7 @@ def sync( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -149,6 +156,7 @@ def sync( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -164,6 +172,7 @@ def sync( return sync_detailed( install_id=install_id, client=client, + synced=synced, offset=offset, limit=limit, page=page, @@ -174,6 +183,7 @@ async def asyncio_detailed( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -184,6 +194,7 @@ async def asyncio_detailed( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -198,6 +209,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( install_id=install_id, + synced=synced, offset=offset, limit=limit, page=page, @@ -212,6 +224,7 @@ async def asyncio( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -222,6 +235,7 @@ async def asyncio( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -238,6 +252,7 @@ async def asyncio( await asyncio_detailed( install_id=install_id, client=client, + synced=synced, offset=offset, limit=limit, page=page, diff --git a/nuon/api/installs/get_install_actions.py b/nuon/api/installs/get_install_actions.py index c4c9ac09..80b6fb77 100644 --- a/nuon/api/installs/get_install_actions.py +++ b/nuon/api/installs/get_install_actions.py @@ -14,6 +14,7 @@ def _get_kwargs( install_id: str, *, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -21,6 +22,8 @@ def _get_kwargs( params: dict[str, Any] = {} + params["synced"] = synced + params["offset"] = offset params["limit"] = limit @@ -99,6 +102,7 @@ def sync_detailed( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -109,6 +113,7 @@ def sync_detailed( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -123,6 +128,7 @@ def sync_detailed( kwargs = _get_kwargs( install_id=install_id, + synced=synced, offset=offset, limit=limit, page=page, @@ -139,6 +145,7 @@ def sync( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -149,6 +156,7 @@ def sync( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -164,6 +172,7 @@ def sync( return sync_detailed( install_id=install_id, client=client, + synced=synced, offset=offset, limit=limit, page=page, @@ -174,6 +183,7 @@ async def asyncio_detailed( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -184,6 +194,7 @@ async def asyncio_detailed( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -198,6 +209,7 @@ async def asyncio_detailed( kwargs = _get_kwargs( install_id=install_id, + synced=synced, offset=offset, limit=limit, page=page, @@ -212,6 +224,7 @@ async def asyncio( install_id: str, *, client: AuthenticatedClient, + synced: bool | Unset = True, offset: int | Unset = 0, limit: int | Unset = 10, page: int | Unset = 0, @@ -222,6 +235,7 @@ async def asyncio( Args: install_id (str): + synced (bool | Unset): Default: True. offset (int | Unset): Default: 0. limit (int | Unset): Default: 10. page (int | Unset): Default: 0. @@ -238,6 +252,7 @@ async def asyncio( await asyncio_detailed( install_id=install_id, client=client, + synced=synced, offset=offset, limit=limit, page=page, diff --git a/nuon/api/oidc_federation/__init__.py b/nuon/api/oidc_federation/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/nuon/api/oidc_federation/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/nuon/api/oidc_federation/create_oidc_trust_policy.py b/nuon/api/oidc_federation/create_oidc_trust_policy.py new file mode 100644 index 00000000..1b0f9253 --- /dev/null +++ b/nuon/api/oidc_federation/create_oidc_trust_policy.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.app_oidc_trust_policy import AppOIDCTrustPolicy +from ...models.service_create_oidc_trust_policy_request import ServiceCreateOIDCTrustPolicyRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ServiceCreateOIDCTrustPolicyRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/oidc/trust-policies", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + if response.status_code == 201: + response_201 = AppOIDCTrustPolicy.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 == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + 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[AppOIDCTrustPolicy | 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( + *, + client: AuthenticatedClient, + body: ServiceCreateOIDCTrustPolicyRequest, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """create an OIDC trust policy + + Creates an OIDC workload identity trust policy for your current org. OIDC tokens matching the + policy's issuer, audience, and claim conditions can be exchanged for short-lived Nuon API tokens. + Each policy gets a dedicated service account with the configured role. + + Args: + body (ServiceCreateOIDCTrustPolicyRequest): + + 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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ServiceCreateOIDCTrustPolicyRequest, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """create an OIDC trust policy + + Creates an OIDC workload identity trust policy for your current org. OIDC tokens matching the + policy's issuer, audience, and claim conditions can be exchanged for short-lived Nuon API tokens. + Each policy gets a dedicated service account with the configured role. + + Args: + body (ServiceCreateOIDCTrustPolicyRequest): + + 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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ServiceCreateOIDCTrustPolicyRequest, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """create an OIDC trust policy + + Creates an OIDC workload identity trust policy for your current org. OIDC tokens matching the + policy's issuer, audience, and claim conditions can be exchanged for short-lived Nuon API tokens. + Each policy gets a dedicated service account with the configured role. + + Args: + body (ServiceCreateOIDCTrustPolicyRequest): + + 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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ServiceCreateOIDCTrustPolicyRequest, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """create an OIDC trust policy + + Creates an OIDC workload identity trust policy for your current org. OIDC tokens matching the + policy's issuer, audience, and claim conditions can be exchanged for short-lived Nuon API tokens. + Each policy gets a dedicated service account with the configured role. + + Args: + body (ServiceCreateOIDCTrustPolicyRequest): + + 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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/oidc_federation/delete_oidc_trust_policy.py b/nuon/api/oidc_federation/delete_oidc_trust_policy.py new file mode 100644 index 00000000..e695915f --- /dev/null +++ b/nuon/api/oidc_federation/delete_oidc_trust_policy.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + policy_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/oidc/trust-policies/{policy_id}".format( + policy_id=quote(str(policy_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | StderrErrResponse | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + 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 client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | 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( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | StderrErrResponse]: + """delete an OIDC trust policy + + Deletes an OIDC workload identity trust policy belonging to your current org, along with its + dedicated service account. Tokens already issued under the policy stop working immediately. + + Args: + policy_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Any | StderrErrResponse | None: + """delete an OIDC trust policy + + Deletes an OIDC workload identity trust policy belonging to your current org, along with its + dedicated service account. Tokens already issued under the policy stop working immediately. + + Args: + policy_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | StderrErrResponse + """ + + return sync_detailed( + policy_id=policy_id, + client=client, + ).parsed + + +async def asyncio_detailed( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Response[Any | StderrErrResponse]: + """delete an OIDC trust policy + + Deletes an OIDC workload identity trust policy belonging to your current org, along with its + dedicated service account. Tokens already issued under the policy stop working immediately. + + Args: + policy_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Any | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Any | StderrErrResponse | None: + """delete an OIDC trust policy + + Deletes an OIDC workload identity trust policy belonging to your current org, along with its + dedicated service account. Tokens already issued under the policy stop working immediately. + + Args: + policy_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Any | StderrErrResponse + """ + + return ( + await asyncio_detailed( + policy_id=policy_id, + client=client, + ) + ).parsed diff --git a/nuon/api/oidc_federation/exchange_oidc_token.py b/nuon/api/oidc_federation/exchange_oidc_token.py new file mode 100644 index 00000000..4ed55468 --- /dev/null +++ b/nuon/api/oidc_federation/exchange_oidc_token.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_exchange_oidc_token_request import ServiceExchangeOIDCTokenRequest +from ...models.service_exchange_oidc_token_response import ServiceExchangeOIDCTokenResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + *, + body: ServiceExchangeOIDCTokenRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/oidc/token", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceExchangeOIDCTokenResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceExchangeOIDCTokenResponse.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 == 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[ServiceExchangeOIDCTokenResponse | 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( + *, + client: AuthenticatedClient | Client, + body: ServiceExchangeOIDCTokenRequest, +) -> Response[ServiceExchangeOIDCTokenResponse | StderrErrResponse]: + """exchange an OIDC token for a Nuon API token + + Exchanges an OIDC ID token (e.g. from GitHub Actions) for a short-lived Nuon API token. The token + must match an enabled OIDC trust policy in the target org: its signature is verified against the + policy issuer's JWKS, and its issuer, audience, and claims must satisfy the policy. No Nuon + credentials are required to call this endpoint. + + Args: + body (ServiceExchangeOIDCTokenRequest): + + 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[ServiceExchangeOIDCTokenResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient | Client, + body: ServiceExchangeOIDCTokenRequest, +) -> ServiceExchangeOIDCTokenResponse | StderrErrResponse | None: + """exchange an OIDC token for a Nuon API token + + Exchanges an OIDC ID token (e.g. from GitHub Actions) for a short-lived Nuon API token. The token + must match an enabled OIDC trust policy in the target org: its signature is verified against the + policy issuer's JWKS, and its issuer, audience, and claims must satisfy the policy. No Nuon + credentials are required to call this endpoint. + + Args: + body (ServiceExchangeOIDCTokenRequest): + + 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: + ServiceExchangeOIDCTokenResponse | StderrErrResponse + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient | Client, + body: ServiceExchangeOIDCTokenRequest, +) -> Response[ServiceExchangeOIDCTokenResponse | StderrErrResponse]: + """exchange an OIDC token for a Nuon API token + + Exchanges an OIDC ID token (e.g. from GitHub Actions) for a short-lived Nuon API token. The token + must match an enabled OIDC trust policy in the target org: its signature is verified against the + policy issuer's JWKS, and its issuer, audience, and claims must satisfy the policy. No Nuon + credentials are required to call this endpoint. + + Args: + body (ServiceExchangeOIDCTokenRequest): + + 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[ServiceExchangeOIDCTokenResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient | Client, + body: ServiceExchangeOIDCTokenRequest, +) -> ServiceExchangeOIDCTokenResponse | StderrErrResponse | None: + """exchange an OIDC token for a Nuon API token + + Exchanges an OIDC ID token (e.g. from GitHub Actions) for a short-lived Nuon API token. The token + must match an enabled OIDC trust policy in the target org: its signature is verified against the + policy issuer's JWKS, and its issuer, audience, and claims must satisfy the policy. No Nuon + credentials are required to call this endpoint. + + Args: + body (ServiceExchangeOIDCTokenRequest): + + 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: + ServiceExchangeOIDCTokenResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/oidc_federation/get_oidc_trust_policy.py b/nuon/api/oidc_federation/get_oidc_trust_policy.py new file mode 100644 index 00000000..058e992a --- /dev/null +++ b/nuon/api/oidc_federation/get_oidc_trust_policy.py @@ -0,0 +1,174 @@ +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_oidc_trust_policy import AppOIDCTrustPolicy +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + policy_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/oidc/trust-policies/{policy_id}".format( + policy_id=quote(str(policy_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppOIDCTrustPolicy.from_dict(response.json()) + + return response_200 + + 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 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[AppOIDCTrustPolicy | 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( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """get an OIDC trust policy + + Returns an OIDC workload identity trust policy belonging to your current org. + + Args: + policy_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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + policy_id: str, + *, + client: AuthenticatedClient, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """get an OIDC trust policy + + Returns an OIDC workload identity trust policy belonging to your current org. + + Args: + policy_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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return sync_detailed( + policy_id=policy_id, + client=client, + ).parsed + + +async def asyncio_detailed( + policy_id: str, + *, + client: AuthenticatedClient, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """get an OIDC trust policy + + Returns an OIDC workload identity trust policy belonging to your current org. + + Args: + policy_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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + policy_id: str, + *, + client: AuthenticatedClient, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """get an OIDC trust policy + + Returns an OIDC workload identity trust policy belonging to your current org. + + Args: + policy_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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return ( + await asyncio_detailed( + policy_id=policy_id, + client=client, + ) + ).parsed diff --git a/nuon/api/oidc_federation/list_oidc_trust_policies.py b/nuon/api/oidc_federation/list_oidc_trust_policies.py new file mode 100644 index 00000000..ff43f5c9 --- /dev/null +++ b/nuon/api/oidc_federation/list_oidc_trust_policies.py @@ -0,0 +1,147 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.app_oidc_trust_policy import AppOIDCTrustPolicy +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/oidc/trust-policies", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppOIDCTrustPolicy] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppOIDCTrustPolicy.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + 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[AppOIDCTrustPolicy]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppOIDCTrustPolicy]]: + """list your org's OIDC trust policies + + Lists the OIDC workload identity trust policies for your current org. + + 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[AppOIDCTrustPolicy]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppOIDCTrustPolicy] | None: + """list your org's OIDC trust policies + + Lists the OIDC workload identity trust policies for your current org. + + 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[AppOIDCTrustPolicy] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppOIDCTrustPolicy]]: + """list your org's OIDC trust policies + + Lists the OIDC workload identity trust policies for your current org. + + 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[AppOIDCTrustPolicy]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppOIDCTrustPolicy] | None: + """list your org's OIDC trust policies + + Lists the OIDC workload identity trust policies for your current org. + + 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[AppOIDCTrustPolicy] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/nuon/api/oidc_federation/update_oidc_trust_policy.py b/nuon/api/oidc_federation/update_oidc_trust_policy.py new file mode 100644 index 00000000..51aa5eda --- /dev/null +++ b/nuon/api/oidc_federation/update_oidc_trust_policy.py @@ -0,0 +1,204 @@ +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_oidc_trust_policy import AppOIDCTrustPolicy +from ...models.service_update_oidc_trust_policy_request import ServiceUpdateOIDCTrustPolicyRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + policy_id: str, + *, + body: ServiceUpdateOIDCTrustPolicyRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/v1/oidc/trust-policies/{policy_id}".format( + policy_id=quote(str(policy_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 +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppOIDCTrustPolicy.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 == 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 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[AppOIDCTrustPolicy | 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( + policy_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateOIDCTrustPolicyRequest, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """update an OIDC trust policy + + Updates an OIDC workload identity trust policy belonging to your current org. Changing the role also + updates the policy's service account role, which affects tokens already issued under the policy. + + Args: + policy_id (str): + body (ServiceUpdateOIDCTrustPolicyRequest): + + 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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + policy_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateOIDCTrustPolicyRequest, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """update an OIDC trust policy + + Updates an OIDC workload identity trust policy belonging to your current org. Changing the role also + updates the policy's service account role, which affects tokens already issued under the policy. + + Args: + policy_id (str): + body (ServiceUpdateOIDCTrustPolicyRequest): + + 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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return sync_detailed( + policy_id=policy_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + policy_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateOIDCTrustPolicyRequest, +) -> Response[AppOIDCTrustPolicy | StderrErrResponse]: + """update an OIDC trust policy + + Updates an OIDC workload identity trust policy belonging to your current org. Changing the role also + updates the policy's service account role, which affects tokens already issued under the policy. + + Args: + policy_id (str): + body (ServiceUpdateOIDCTrustPolicyRequest): + + 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[AppOIDCTrustPolicy | StderrErrResponse] + """ + + kwargs = _get_kwargs( + policy_id=policy_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + policy_id: str, + *, + client: AuthenticatedClient, + body: ServiceUpdateOIDCTrustPolicyRequest, +) -> AppOIDCTrustPolicy | StderrErrResponse | None: + """update an OIDC trust policy + + Updates an OIDC workload identity trust policy belonging to your current org. Changing the role also + updates the policy's service account role, which affects tokens already issued under the policy. + + Args: + policy_id (str): + body (ServiceUpdateOIDCTrustPolicyRequest): + + 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: + AppOIDCTrustPolicy | StderrErrResponse + """ + + return ( + await asyncio_detailed( + policy_id=policy_id, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index 072c503d..30770654 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -172,6 +172,8 @@ from .app_notifications_config import AppNotificationsConfig from .app_oci_artifact import AppOCIArtifact from .app_oci_artifact_annotations import AppOCIArtifactAnnotations +from .app_oidc_trust_policy import AppOIDCTrustPolicy +from .app_oidc_trust_policy_claim_conditions import AppOIDCTrustPolicyClaimConditions from .app_onboarding import AppOnboarding from .app_onboarding_app_config import AppOnboardingAppConfig from .app_operation_status import AppOperationStatus @@ -583,6 +585,10 @@ ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles, ) from .service_create_notebook_request import ServiceCreateNotebookRequest +from .service_create_oidc_trust_policy_request import ServiceCreateOIDCTrustPolicyRequest +from .service_create_oidc_trust_policy_request_claim_conditions import ( + ServiceCreateOIDCTrustPolicyRequestClaimConditions, +) from .service_create_org_invite_request import ServiceCreateOrgInviteRequest from .service_create_org_link_request import ServiceCreateOrgLinkRequest from .service_create_org_request import ServiceCreateOrgRequest @@ -630,6 +636,8 @@ from .service_deprovision_install_request import ServiceDeprovisionInstallRequest from .service_deprovision_install_sandbox_request import ServiceDeprovisionInstallSandboxRequest from .service_example_app import ServiceExampleApp +from .service_exchange_oidc_token_request import ServiceExchangeOIDCTokenRequest +from .service_exchange_oidc_token_response import ServiceExchangeOIDCTokenResponse from .service_force_shutdown_request import ServiceForceShutdownRequest from .service_forget_install_component_request import ServiceForgetInstallComponentRequest from .service_forget_install_request import ServiceForgetInstallRequest @@ -729,6 +737,10 @@ from .service_update_install_role_request import ServiceUpdateInstallRoleRequest from .service_update_notebook_request import ServiceUpdateNotebookRequest from .service_update_notebook_request_status import ServiceUpdateNotebookRequestStatus +from .service_update_oidc_trust_policy_request import ServiceUpdateOIDCTrustPolicyRequest +from .service_update_oidc_trust_policy_request_claim_conditions import ( + ServiceUpdateOIDCTrustPolicyRequestClaimConditions, +) from .service_update_org_account_role_request import ServiceUpdateOrgAccountRoleRequest from .service_update_org_features_request import ServiceUpdateOrgFeaturesRequest from .service_update_org_features_request_features import ServiceUpdateOrgFeaturesRequestFeatures @@ -962,6 +974,8 @@ "AppNotificationsConfig", "AppOCIArtifact", "AppOCIArtifactAnnotations", + "AppOIDCTrustPolicy", + "AppOIDCTrustPolicyClaimConditions", "AppOnboarding", "AppOnboardingAppConfig", "AppOperationStatus", @@ -1345,6 +1359,8 @@ "ServiceCreateKubernetesManifestComponentConfigRequest", "ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles", "ServiceCreateNotebookRequest", + "ServiceCreateOIDCTrustPolicyRequest", + "ServiceCreateOIDCTrustPolicyRequestClaimConditions", "ServiceCreateOrgInviteRequest", "ServiceCreateOrgLinkRequest", "ServiceCreateOrgRequest", @@ -1384,6 +1400,8 @@ "ServiceDeprovisionInstallRequest", "ServiceDeprovisionInstallSandboxRequest", "ServiceExampleApp", + "ServiceExchangeOIDCTokenRequest", + "ServiceExchangeOIDCTokenResponse", "ServiceForceShutdownRequest", "ServiceForgetInstallComponentRequest", "ServiceForgetInstallRequest", @@ -1481,6 +1499,8 @@ "ServiceUpdateInstallRoleRequest", "ServiceUpdateNotebookRequest", "ServiceUpdateNotebookRequestStatus", + "ServiceUpdateOIDCTrustPolicyRequest", + "ServiceUpdateOIDCTrustPolicyRequestClaimConditions", "ServiceUpdateOrgAccountRoleRequest", "ServiceUpdateOrgFeaturesRequest", "ServiceUpdateOrgFeaturesRequestFeatures", diff --git a/nuon/models/app_app_branch_config.py b/nuon/models/app_app_branch_config.py index ccf8af8e..e622b0e9 100644 --- a/nuon/models/app_app_branch_config.py +++ b/nuon/models/app_app_branch_config.py @@ -33,6 +33,7 @@ class AppAppBranchConfig: install_groups (list[AppAppBranchInstallGroup] | Unset): org_id (str | Unset): public_git_vcs_config (AppPublicGitVCSConfig | Unset): + runbook_ids (list[str] | Unset): updated_at (str | Unset): workflows (list[AppWorkflow] | Unset): """ @@ -48,6 +49,7 @@ class AppAppBranchConfig: install_groups: list[AppAppBranchInstallGroup] | Unset = UNSET org_id: str | Unset = UNSET public_git_vcs_config: AppPublicGitVCSConfig | Unset = UNSET + runbook_ids: list[str] | Unset = UNSET updated_at: str | Unset = UNSET workflows: list[AppWorkflow] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -88,6 +90,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.public_git_vcs_config, Unset): public_git_vcs_config = self.public_git_vcs_config.to_dict() + runbook_ids: list[str] | Unset = UNSET + if not isinstance(self.runbook_ids, Unset): + runbook_ids = self.runbook_ids + updated_at = self.updated_at workflows: list[dict[str, Any]] | Unset = UNSET @@ -122,6 +128,8 @@ def to_dict(self) -> dict[str, Any]: 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 runbook_ids is not UNSET: + field_dict["runbook_ids"] = runbook_ids if updated_at is not UNSET: field_dict["updated_at"] = updated_at if workflows is not UNSET: @@ -176,6 +184,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: public_git_vcs_config = AppPublicGitVCSConfig.from_dict(_public_git_vcs_config) + runbook_ids = cast(list[str], d.pop("runbook_ids", UNSET)) + updated_at = d.pop("updated_at", UNSET) _workflows = d.pop("workflows", UNSET) @@ -199,6 +209,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_groups=install_groups, org_id=org_id, public_git_vcs_config=public_git_vcs_config, + runbook_ids=runbook_ids, updated_at=updated_at, workflows=workflows, ) diff --git a/nuon/models/app_app_config.py b/nuon/models/app_app_config.py index 8325a84f..26d5cb9f 100644 --- a/nuon/models/app_app_config.py +++ b/nuon/models/app_app_config.py @@ -59,6 +59,7 @@ class AppAppConfig: permissions (AppAppPermissionsConfig | Unset): policies (AppAppPoliciesConfig | Unset): readme (str | Unset): + runbook_ids (list[str] | Unset): runner (AppAppRunnerConfig | Unset): sandbox (AppAppSandboxConfig | Unset): secrets (AppAppSecretsConfig | Unset): @@ -95,6 +96,7 @@ class AppAppConfig: permissions: AppAppPermissionsConfig | Unset = UNSET policies: AppAppPoliciesConfig | Unset = UNSET readme: str | Unset = UNSET + runbook_ids: list[str] | Unset = UNSET runner: AppAppRunnerConfig | Unset = UNSET sandbox: AppAppSandboxConfig | Unset = UNSET secrets: AppAppSecretsConfig | Unset = UNSET @@ -186,6 +188,10 @@ def to_dict(self) -> dict[str, Any]: readme = self.readme + runbook_ids: list[str] | Unset = UNSET + if not isinstance(self.runbook_ids, Unset): + runbook_ids = self.runbook_ids + runner: dict[str, Any] | Unset = UNSET if not isinstance(self.runner, Unset): runner = self.runner.to_dict() @@ -276,6 +282,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["policies"] = policies if readme is not UNSET: field_dict["readme"] = readme + if runbook_ids is not UNSET: + field_dict["runbook_ids"] = runbook_ids if runner is not UNSET: field_dict["runner"] = runner if sandbox is not UNSET: @@ -430,6 +438,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: readme = d.pop("readme", UNSET) + runbook_ids = cast(list[str], d.pop("runbook_ids", UNSET)) + _runner = d.pop("runner", UNSET) runner: AppAppRunnerConfig | Unset if isinstance(_runner, Unset): @@ -519,6 +529,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: permissions=permissions, policies=policies, readme=readme, + runbook_ids=runbook_ids, runner=runner, sandbox=sandbox, secrets=secrets, diff --git a/nuon/models/app_app_runner_config.py b/nuon/models/app_app_runner_config.py index 338f6c3b..6560bb52 100644 --- a/nuon/models/app_app_runner_config.py +++ b/nuon/models/app_app_runner_config.py @@ -35,6 +35,10 @@ class AppAppRunnerConfig: instance_type (str | Unset): InstanceType is the cloud machine/instance type for the install runner host, mapped per cloud platform. org_id (str | Unset): + phone_home_script_url (str | Unset): PhoneHomeScriptURL overrides the phone-home Lambda source fetched at stack + render time. Per app so a single app can be moved onto a new script version + without touching anyone else: the default is shared by every org, so changing + it ships to the whole fleet on their next stack regeneration. public_api_url (str | Unset): PublicAPIURL overrides the Nuon public API endpoint used for phone-home callbacks. runner_api_url (str | Unset): RunnerAPIURL overrides the Nuon runner API endpoint for installs using this config. @@ -53,6 +57,7 @@ class AppAppRunnerConfig: init_script: str | Unset = UNSET instance_type: str | Unset = UNSET org_id: str | Unset = UNSET + phone_home_script_url: str | Unset = UNSET public_api_url: str | Unset = UNSET runner_api_url: str | Unset = UNSET updated_at: str | Unset = UNSET @@ -89,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: org_id = self.org_id + phone_home_script_url = self.phone_home_script_url + public_api_url = self.public_api_url runner_api_url = self.runner_api_url @@ -122,6 +129,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["instance_type"] = instance_type if org_id is not UNSET: field_dict["org_id"] = org_id + if phone_home_script_url is not UNSET: + field_dict["phone_home_script_url"] = phone_home_script_url if public_api_url is not UNSET: field_dict["public_api_url"] = public_api_url if runner_api_url is not UNSET: @@ -175,6 +184,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: org_id = d.pop("org_id", UNSET) + phone_home_script_url = d.pop("phone_home_script_url", UNSET) + public_api_url = d.pop("public_api_url", UNSET) runner_api_url = d.pop("runner_api_url", UNSET) @@ -194,6 +205,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: init_script=init_script, instance_type=instance_type, org_id=org_id, + phone_home_script_url=phone_home_script_url, public_api_url=public_api_url, runner_api_url=runner_api_url, updated_at=updated_at, diff --git a/nuon/models/app_install_action_workflow.py b/nuon/models/app_install_action_workflow.py index 37fe2004..a59731c6 100644 --- a/nuon/models/app_install_action_workflow.py +++ b/nuon/models/app_install_action_workflow.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: from ..models.app_action_workflow import AppActionWorkflow + from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_action_workflow_run import AppInstallActionWorkflowRun @@ -28,6 +29,7 @@ class AppInstallActionWorkflow: install_id (str | Unset): runs (list[AppInstallActionWorkflowRun] | Unset): status (str | Unset): after query fields filled in after querying + status_v2 (AppCompositeStatus | Unset): updated_at (str | Unset): """ @@ -39,6 +41,7 @@ class AppInstallActionWorkflow: install_id: str | Unset = UNSET runs: list[AppInstallActionWorkflowRun] | Unset = UNSET status: str | Unset = UNSET + status_v2: AppCompositeStatus | Unset = UNSET updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,6 +69,10 @@ def to_dict(self) -> dict[str, Any]: status = self.status + status_v2: dict[str, Any] | Unset = UNSET + if not isinstance(self.status_v2, Unset): + status_v2 = self.status_v2.to_dict() + updated_at = self.updated_at field_dict: dict[str, Any] = {} @@ -87,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["runs"] = runs if status is not UNSET: field_dict["status"] = status + if status_v2 is not UNSET: + field_dict["status_v2"] = status_v2 if updated_at is not UNSET: field_dict["updated_at"] = updated_at @@ -95,6 +104,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_action_workflow import AppActionWorkflow + from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_action_workflow_run import AppInstallActionWorkflowRun d = dict(src_dict) @@ -126,6 +136,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status", UNSET) + _status_v2 = d.pop("status_v2", UNSET) + status_v2: AppCompositeStatus | Unset + if isinstance(_status_v2, Unset): + status_v2 = UNSET + else: + status_v2 = AppCompositeStatus.from_dict(_status_v2) + updated_at = d.pop("updated_at", UNSET) app_install_action_workflow = cls( @@ -137,6 +154,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: install_id=install_id, runs=runs, status=status, + status_v2=status_v2, updated_at=updated_at, ) diff --git a/nuon/models/app_install_runbook.py b/nuon/models/app_install_runbook.py index ffffa3ed..529b689c 100644 --- a/nuon/models/app_install_runbook.py +++ b/nuon/models/app_install_runbook.py @@ -9,6 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_runbook_run import AppInstallRunbookRun from ..models.app_runbook import AppRunbook @@ -28,6 +29,7 @@ class AppInstallRunbook: runbook_id (str | Unset): runs (list[AppInstallRunbookRun] | Unset): status (str | Unset): after query fields + status_v2 (AppCompositeStatus | Unset): updated_at (str | Unset): """ @@ -39,6 +41,7 @@ class AppInstallRunbook: runbook_id: str | Unset = UNSET runs: list[AppInstallRunbookRun] | Unset = UNSET status: str | Unset = UNSET + status_v2: AppCompositeStatus | Unset = UNSET updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,6 +69,10 @@ def to_dict(self) -> dict[str, Any]: status = self.status + status_v2: dict[str, Any] | Unset = UNSET + if not isinstance(self.status_v2, Unset): + status_v2 = self.status_v2.to_dict() + updated_at = self.updated_at field_dict: dict[str, Any] = {} @@ -87,6 +94,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["runs"] = runs if status is not UNSET: field_dict["status"] = status + if status_v2 is not UNSET: + field_dict["status_v2"] = status_v2 if updated_at is not UNSET: field_dict["updated_at"] = updated_at @@ -94,6 +103,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_composite_status import AppCompositeStatus from ..models.app_install_runbook_run import AppInstallRunbookRun from ..models.app_runbook import AppRunbook @@ -126,6 +136,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status", UNSET) + _status_v2 = d.pop("status_v2", UNSET) + status_v2: AppCompositeStatus | Unset + if isinstance(_status_v2, Unset): + status_v2 = UNSET + else: + status_v2 = AppCompositeStatus.from_dict(_status_v2) + updated_at = d.pop("updated_at", UNSET) app_install_runbook = cls( @@ -137,6 +154,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: runbook_id=runbook_id, runs=runs, status=status, + status_v2=status_v2, updated_at=updated_at, ) diff --git a/nuon/models/app_oidc_trust_policy.py b/nuon/models/app_oidc_trust_policy.py new file mode 100644 index 00000000..6ee53d16 --- /dev/null +++ b/nuon/models/app_oidc_trust_policy.py @@ -0,0 +1,196 @@ +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_oidc_trust_policy_claim_conditions import AppOIDCTrustPolicyClaimConditions + + +T = TypeVar("T", bound="AppOIDCTrustPolicy") + + +@_attrs_define +class AppOIDCTrustPolicy: + """ + Attributes: + audience (str | Unset): + claim_conditions (AppOIDCTrustPolicyClaimConditions | Unset): ClaimConditions maps claim names to patterns. All + conditions must match + for the policy to apply. Patterns are exact strings, or globs where `*` + does not cross `:` segments. + created_at (str | Unset): + created_by_id (str | Unset): + enabled (bool | Unset): + id (str | Unset): + issuer_url (str | Unset): IssuerURL is the exact `iss` claim value and the base URL used for OIDC + discovery + JWKS fetching. It is always the stored, admin-configured + value — never taken from the presented token. + last_used_at (str | Unset): + name (str | Unset): + org_id (str | Unset): + role (str | Unset): + service_account_id (str | Unset): + token_duration_seconds (int | Unset): + updated_at (str | Unset): + """ + + audience: str | Unset = UNSET + claim_conditions: AppOIDCTrustPolicyClaimConditions | Unset = UNSET + created_at: str | Unset = UNSET + created_by_id: str | Unset = UNSET + enabled: bool | Unset = UNSET + id: str | Unset = UNSET + issuer_url: str | Unset = UNSET + last_used_at: str | Unset = UNSET + name: str | Unset = UNSET + org_id: str | Unset = UNSET + role: str | Unset = UNSET + service_account_id: str | Unset = UNSET + token_duration_seconds: int | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + audience = self.audience + + claim_conditions: dict[str, Any] | Unset = UNSET + if not isinstance(self.claim_conditions, Unset): + claim_conditions = self.claim_conditions.to_dict() + + created_at = self.created_at + + created_by_id = self.created_by_id + + enabled = self.enabled + + id = self.id + + issuer_url = self.issuer_url + + last_used_at = self.last_used_at + + name = self.name + + org_id = self.org_id + + role = self.role + + service_account_id = self.service_account_id + + token_duration_seconds = self.token_duration_seconds + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if audience is not UNSET: + field_dict["audience"] = audience + if claim_conditions is not UNSET: + field_dict["claim_conditions"] = claim_conditions + 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 enabled is not UNSET: + field_dict["enabled"] = enabled + if id is not UNSET: + field_dict["id"] = id + if issuer_url is not UNSET: + field_dict["issuer_url"] = issuer_url + if last_used_at is not UNSET: + field_dict["last_used_at"] = last_used_at + if name is not UNSET: + field_dict["name"] = name + if org_id is not UNSET: + field_dict["org_id"] = org_id + if role is not UNSET: + field_dict["role"] = role + if service_account_id is not UNSET: + field_dict["service_account_id"] = service_account_id + if token_duration_seconds is not UNSET: + field_dict["token_duration_seconds"] = token_duration_seconds + 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_oidc_trust_policy_claim_conditions import AppOIDCTrustPolicyClaimConditions + + d = dict(src_dict) + audience = d.pop("audience", UNSET) + + _claim_conditions = d.pop("claim_conditions", UNSET) + claim_conditions: AppOIDCTrustPolicyClaimConditions | Unset + if isinstance(_claim_conditions, Unset): + claim_conditions = UNSET + else: + claim_conditions = AppOIDCTrustPolicyClaimConditions.from_dict(_claim_conditions) + + created_at = d.pop("created_at", UNSET) + + created_by_id = d.pop("created_by_id", UNSET) + + enabled = d.pop("enabled", UNSET) + + id = d.pop("id", UNSET) + + issuer_url = d.pop("issuer_url", UNSET) + + last_used_at = d.pop("last_used_at", UNSET) + + name = d.pop("name", UNSET) + + org_id = d.pop("org_id", UNSET) + + role = d.pop("role", UNSET) + + service_account_id = d.pop("service_account_id", UNSET) + + token_duration_seconds = d.pop("token_duration_seconds", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + app_oidc_trust_policy = cls( + audience=audience, + claim_conditions=claim_conditions, + created_at=created_at, + created_by_id=created_by_id, + enabled=enabled, + id=id, + issuer_url=issuer_url, + last_used_at=last_used_at, + name=name, + org_id=org_id, + role=role, + service_account_id=service_account_id, + token_duration_seconds=token_duration_seconds, + updated_at=updated_at, + ) + + app_oidc_trust_policy.additional_properties = d + return app_oidc_trust_policy + + @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_oidc_trust_policy_claim_conditions.py b/nuon/models/app_oidc_trust_policy_claim_conditions.py new file mode 100644 index 00000000..a63284df --- /dev/null +++ b/nuon/models/app_oidc_trust_policy_claim_conditions.py @@ -0,0 +1,51 @@ +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="AppOIDCTrustPolicyClaimConditions") + + +@_attrs_define +class AppOIDCTrustPolicyClaimConditions: + """ClaimConditions maps claim names to patterns. All conditions must match + for the policy to apply. Patterns are exact strings, or globs where `*` + does not cross `:` segments. + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_oidc_trust_policy_claim_conditions = cls() + + app_oidc_trust_policy_claim_conditions.additional_properties = d + return app_oidc_trust_policy_claim_conditions + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/app_token_type.py b/nuon/models/app_token_type.py index 74cd87a9..fa71f106 100644 --- a/nuon/models/app_token_type.py +++ b/nuon/models/app_token_type.py @@ -6,6 +6,7 @@ class AppTokenType(str, Enum): AUTH = "auth" AUTH0 = "auth0" CANARY = "canary" + FEDERATED = "federated" INTEGRATION = "integration" NUON = "nuon" STATIC = "static" diff --git a/nuon/models/service_cli_config.py b/nuon/models/service_cli_config.py index 681c9b13..ec1d6f4d 100644 --- a/nuon/models/service_cli_config.py +++ b/nuon/models/service_cli_config.py @@ -20,6 +20,7 @@ class ServiceCLIConfig: auth_domain (str | Unset): dashboard_url (str | Unset): nuon_auth_enabled (bool | Unset): + oidc_federation_enabled (bool | Unset): root_domain (str | Unset): """ @@ -28,6 +29,7 @@ class ServiceCLIConfig: auth_domain: str | Unset = UNSET dashboard_url: str | Unset = UNSET nuon_auth_enabled: bool | Unset = UNSET + oidc_federation_enabled: bool | Unset = UNSET root_domain: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -42,6 +44,8 @@ def to_dict(self) -> dict[str, Any]: nuon_auth_enabled = self.nuon_auth_enabled + oidc_federation_enabled = self.oidc_federation_enabled + root_domain = self.root_domain field_dict: dict[str, Any] = {} @@ -57,6 +61,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["dashboard_url"] = dashboard_url if nuon_auth_enabled is not UNSET: field_dict["nuon_auth_enabled"] = nuon_auth_enabled + if oidc_federation_enabled is not UNSET: + field_dict["oidc_federation_enabled"] = oidc_federation_enabled if root_domain is not UNSET: field_dict["root_domain"] = root_domain @@ -75,6 +81,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: nuon_auth_enabled = d.pop("nuon_auth_enabled", UNSET) + oidc_federation_enabled = d.pop("oidc_federation_enabled", UNSET) + root_domain = d.pop("root_domain", UNSET) service_cli_config = cls( @@ -83,6 +91,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: auth_domain=auth_domain, dashboard_url=dashboard_url, nuon_auth_enabled=nuon_auth_enabled, + oidc_federation_enabled=oidc_federation_enabled, root_domain=root_domain, ) diff --git a/nuon/models/service_create_app_runner_config_request.py b/nuon/models/service_create_app_runner_config_request.py index c9018df9..de2a7067 100644 --- a/nuon/models/service_create_app_runner_config_request.py +++ b/nuon/models/service_create_app_runner_config_request.py @@ -27,6 +27,7 @@ class ServiceCreateAppRunnerConfigRequest: helm_driver (AppAppRunnerConfigHelmDriverType | Unset): init_script_url (str | Unset): instance_type (str | Unset): + phone_home_script_url (str | Unset): PhoneHomeScriptURL overrides the phone-home Lambda source for this app. public_api_url (str | Unset): runner_api_url (str | Unset): """ @@ -37,6 +38,7 @@ class ServiceCreateAppRunnerConfigRequest: helm_driver: AppAppRunnerConfigHelmDriverType | Unset = UNSET init_script_url: str | Unset = UNSET instance_type: str | Unset = UNSET + phone_home_script_url: str | Unset = UNSET public_api_url: str | Unset = UNSET runner_api_url: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -58,6 +60,8 @@ def to_dict(self) -> dict[str, Any]: instance_type = self.instance_type + phone_home_script_url = self.phone_home_script_url + public_api_url = self.public_api_url runner_api_url = self.runner_api_url @@ -79,6 +83,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["init_script_url"] = init_script_url if instance_type is not UNSET: field_dict["instance_type"] = instance_type + if phone_home_script_url is not UNSET: + field_dict["phone_home_script_url"] = phone_home_script_url if public_api_url is not UNSET: field_dict["public_api_url"] = public_api_url if runner_api_url is not UNSET: @@ -115,6 +121,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: instance_type = d.pop("instance_type", UNSET) + phone_home_script_url = d.pop("phone_home_script_url", UNSET) + public_api_url = d.pop("public_api_url", UNSET) runner_api_url = d.pop("runner_api_url", UNSET) @@ -126,6 +134,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: helm_driver=helm_driver, init_script_url=init_script_url, instance_type=instance_type, + phone_home_script_url=phone_home_script_url, public_api_url=public_api_url, runner_api_url=runner_api_url, ) diff --git a/nuon/models/service_create_oidc_trust_policy_request.py b/nuon/models/service_create_oidc_trust_policy_request.py new file mode 100644 index 00000000..5194d3f2 --- /dev/null +++ b/nuon/models/service_create_oidc_trust_policy_request.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_create_oidc_trust_policy_request_claim_conditions import ( + ServiceCreateOIDCTrustPolicyRequestClaimConditions, + ) + + +T = TypeVar("T", bound="ServiceCreateOIDCTrustPolicyRequest") + + +@_attrs_define +class ServiceCreateOIDCTrustPolicyRequest: + """ + Attributes: + audience (str): expected `aud` claim value + claim_conditions (ServiceCreateOIDCTrustPolicyRequestClaimConditions): map of claim name -> pattern; all must + match. A `sub` condition is + required. Patterns are exact strings or globs where `*` cannot cross + `:` 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. defaults to org_read_only. + token_duration_seconds (int | Unset): lifetime of exchanged tokens in seconds. defaults to 3600, max 86400. + """ + + audience: str + claim_conditions: ServiceCreateOIDCTrustPolicyRequestClaimConditions + issuer_url: str + name: str + role: str | Unset = UNSET + token_duration_seconds: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + audience = self.audience + + claim_conditions = self.claim_conditions.to_dict() + + issuer_url = self.issuer_url + + name = self.name + + role = self.role + + token_duration_seconds = self.token_duration_seconds + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "audience": audience, + "claim_conditions": claim_conditions, + "issuer_url": issuer_url, + "name": name, + } + ) + if role is not UNSET: + field_dict["role"] = role + if token_duration_seconds is not UNSET: + field_dict["token_duration_seconds"] = token_duration_seconds + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_create_oidc_trust_policy_request_claim_conditions import ( + ServiceCreateOIDCTrustPolicyRequestClaimConditions, + ) + + d = dict(src_dict) + audience = d.pop("audience") + + claim_conditions = ServiceCreateOIDCTrustPolicyRequestClaimConditions.from_dict(d.pop("claim_conditions")) + + issuer_url = d.pop("issuer_url") + + name = d.pop("name") + + role = d.pop("role", UNSET) + + token_duration_seconds = d.pop("token_duration_seconds", UNSET) + + service_create_oidc_trust_policy_request = cls( + audience=audience, + claim_conditions=claim_conditions, + issuer_url=issuer_url, + name=name, + role=role, + token_duration_seconds=token_duration_seconds, + ) + + service_create_oidc_trust_policy_request.additional_properties = d + return service_create_oidc_trust_policy_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_oidc_trust_policy_request_claim_conditions.py b/nuon/models/service_create_oidc_trust_policy_request_claim_conditions.py new file mode 100644 index 00000000..293ce689 --- /dev/null +++ b/nuon/models/service_create_oidc_trust_policy_request_claim_conditions.py @@ -0,0 +1,51 @@ +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="ServiceCreateOIDCTrustPolicyRequestClaimConditions") + + +@_attrs_define +class ServiceCreateOIDCTrustPolicyRequestClaimConditions: + """map of claim name -> pattern; all must match. A `sub` condition is + required. Patterns are exact strings or globs where `*` cannot cross + `:` segments. + + """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + service_create_oidc_trust_policy_request_claim_conditions = cls() + + service_create_oidc_trust_policy_request_claim_conditions.additional_properties = d + return service_create_oidc_trust_policy_request_claim_conditions + + @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_exchange_oidc_token_request.py b/nuon/models/service_exchange_oidc_token_request.py new file mode 100644 index 00000000..4beadd79 --- /dev/null +++ b/nuon/models/service_exchange_oidc_token_request.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ServiceExchangeOIDCTokenRequest") + + +@_attrs_define +class ServiceExchangeOIDCTokenRequest: + """ + Attributes: + org_id (str): + token (str): + """ + + org_id: str + token: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + org_id = self.org_id + + token = self.token + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "org_id": org_id, + "token": token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + org_id = d.pop("org_id") + + token = d.pop("token") + + service_exchange_oidc_token_request = cls( + org_id=org_id, + token=token, + ) + + service_exchange_oidc_token_request.additional_properties = d + return service_exchange_oidc_token_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_exchange_oidc_token_response.py b/nuon/models/service_exchange_oidc_token_response.py new file mode 100644 index 00000000..01b2f47c --- /dev/null +++ b/nuon/models/service_exchange_oidc_token_response.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceExchangeOIDCTokenResponse") + + +@_attrs_define +class ServiceExchangeOIDCTokenResponse: + """ + Attributes: + authenticated (bool | Unset): + expires_at (str | Unset): + org_id (str | Unset): + role (str | Unset): + token (str | Unset): + trust_policy_id (str | Unset): + """ + + authenticated: bool | Unset = UNSET + expires_at: str | Unset = UNSET + org_id: str | Unset = UNSET + role: str | Unset = UNSET + token: str | Unset = UNSET + trust_policy_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + authenticated = self.authenticated + + expires_at = self.expires_at + + org_id = self.org_id + + role = self.role + + token = self.token + + trust_policy_id = self.trust_policy_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if authenticated is not UNSET: + field_dict["authenticated"] = authenticated + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if org_id is not UNSET: + field_dict["org_id"] = org_id + if role is not UNSET: + field_dict["role"] = role + if token is not UNSET: + field_dict["token"] = token + if trust_policy_id is not UNSET: + field_dict["trust_policy_id"] = trust_policy_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + authenticated = d.pop("authenticated", UNSET) + + expires_at = d.pop("expires_at", UNSET) + + org_id = d.pop("org_id", UNSET) + + role = d.pop("role", UNSET) + + token = d.pop("token", UNSET) + + trust_policy_id = d.pop("trust_policy_id", UNSET) + + service_exchange_oidc_token_response = cls( + authenticated=authenticated, + expires_at=expires_at, + org_id=org_id, + role=role, + token=token, + trust_policy_id=trust_policy_id, + ) + + service_exchange_oidc_token_response.additional_properties = d + return service_exchange_oidc_token_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_update_oidc_trust_policy_request.py b/nuon/models/service_update_oidc_trust_policy_request.py new file mode 100644 index 00000000..6ab49bb7 --- /dev/null +++ b/nuon/models/service_update_oidc_trust_policy_request.py @@ -0,0 +1,143 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_update_oidc_trust_policy_request_claim_conditions import ( + ServiceUpdateOIDCTrustPolicyRequestClaimConditions, + ) + + +T = TypeVar("T", bound="ServiceUpdateOIDCTrustPolicyRequest") + + +@_attrs_define +class ServiceUpdateOIDCTrustPolicyRequest: + """ + Attributes: + audience (str | Unset): + claim_conditions (ServiceUpdateOIDCTrustPolicyRequestClaimConditions | Unset): + enabled (bool | None | Unset): + issuer_url (str | Unset): + name (str | Unset): + role (str | Unset): + token_duration_seconds (int | Unset): + """ + + audience: str | Unset = UNSET + claim_conditions: ServiceUpdateOIDCTrustPolicyRequestClaimConditions | Unset = UNSET + enabled: bool | None | Unset = UNSET + issuer_url: str | Unset = UNSET + name: str | Unset = UNSET + role: str | Unset = UNSET + token_duration_seconds: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + audience = self.audience + + claim_conditions: dict[str, Any] | Unset = UNSET + if not isinstance(self.claim_conditions, Unset): + claim_conditions = self.claim_conditions.to_dict() + + enabled: bool | None | Unset + if isinstance(self.enabled, Unset): + enabled = UNSET + else: + enabled = self.enabled + + issuer_url = self.issuer_url + + name = self.name + + role = self.role + + token_duration_seconds = self.token_duration_seconds + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if audience is not UNSET: + field_dict["audience"] = audience + if claim_conditions is not UNSET: + field_dict["claim_conditions"] = claim_conditions + if enabled is not UNSET: + field_dict["enabled"] = enabled + if issuer_url is not UNSET: + field_dict["issuer_url"] = issuer_url + if name is not UNSET: + field_dict["name"] = name + if role is not UNSET: + field_dict["role"] = role + if token_duration_seconds is not UNSET: + field_dict["token_duration_seconds"] = token_duration_seconds + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_update_oidc_trust_policy_request_claim_conditions import ( + ServiceUpdateOIDCTrustPolicyRequestClaimConditions, + ) + + d = dict(src_dict) + audience = d.pop("audience", UNSET) + + _claim_conditions = d.pop("claim_conditions", UNSET) + claim_conditions: ServiceUpdateOIDCTrustPolicyRequestClaimConditions | Unset + if isinstance(_claim_conditions, Unset): + claim_conditions = UNSET + else: + claim_conditions = ServiceUpdateOIDCTrustPolicyRequestClaimConditions.from_dict(_claim_conditions) + + def _parse_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + enabled = _parse_enabled(d.pop("enabled", UNSET)) + + issuer_url = d.pop("issuer_url", UNSET) + + name = d.pop("name", UNSET) + + role = d.pop("role", UNSET) + + token_duration_seconds = d.pop("token_duration_seconds", UNSET) + + service_update_oidc_trust_policy_request = cls( + audience=audience, + claim_conditions=claim_conditions, + enabled=enabled, + issuer_url=issuer_url, + name=name, + role=role, + token_duration_seconds=token_duration_seconds, + ) + + service_update_oidc_trust_policy_request.additional_properties = d + return service_update_oidc_trust_policy_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_update_oidc_trust_policy_request_claim_conditions.py b/nuon/models/service_update_oidc_trust_policy_request_claim_conditions.py new file mode 100644 index 00000000..09abc463 --- /dev/null +++ b/nuon/models/service_update_oidc_trust_policy_request_claim_conditions.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="ServiceUpdateOIDCTrustPolicyRequestClaimConditions") + + +@_attrs_define +class ServiceUpdateOIDCTrustPolicyRequestClaimConditions: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + service_update_oidc_trust_policy_request_claim_conditions = cls() + + service_update_oidc_trust_policy_request_claim_conditions.additional_properties = d + return service_update_oidc_trust_policy_request_claim_conditions + + @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/pyproject.toml b/pyproject.toml index 7e72e0ee..2f7473e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1099" +version = "0.19.1101" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index c97f0a10..a0a8cc3f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1099 +0.19.1101