Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions nuon/api/accounts/create_static_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ def sync_detailed(
client: AuthenticatedClient,
body: ServiceCreateStaticTokenRequest,
) -> Response[GithubComNuoncoNuonServicesCtlApiInternalAppAccountsServiceStaticTokenResponse]:
"""create a static API token for your org
r"""create a static API token for your org

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 (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to
org_read_only.
Creates a long-lived static API token. By default (token_identity \"service_account\") each token
gets its own dedicated service account and only grants access to the current org; the role param
controls the token's permissions (any role assignable to API tokens; see GET
/v1/roles?context=api_token) and defaults to org_read_only. With token_identity \"personal\" the
token is issued against your own account instead: it uses your account's existing roles, is not
limited to the current org, and the role param must be empty.

Args:
body (ServiceCreateStaticTokenRequest):
Expand Down Expand Up @@ -97,12 +99,14 @@ def sync(
client: AuthenticatedClient,
body: ServiceCreateStaticTokenRequest,
) -> GithubComNuoncoNuonServicesCtlApiInternalAppAccountsServiceStaticTokenResponse | None:
"""create a static API token for your org
r"""create a static API token for your org

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 (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to
org_read_only.
Creates a long-lived static API token. By default (token_identity \"service_account\") each token
gets its own dedicated service account and only grants access to the current org; the role param
controls the token's permissions (any role assignable to API tokens; see GET
/v1/roles?context=api_token) and defaults to org_read_only. With token_identity \"personal\" the
token is issued against your own account instead: it uses your account's existing roles, is not
limited to the current org, and the role param must be empty.

Args:
body (ServiceCreateStaticTokenRequest):
Expand All @@ -126,12 +130,14 @@ async def asyncio_detailed(
client: AuthenticatedClient,
body: ServiceCreateStaticTokenRequest,
) -> Response[GithubComNuoncoNuonServicesCtlApiInternalAppAccountsServiceStaticTokenResponse]:
"""create a static API token for your org
r"""create a static API token for your org

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 (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to
org_read_only.
Creates a long-lived static API token. By default (token_identity \"service_account\") each token
gets its own dedicated service account and only grants access to the current org; the role param
controls the token's permissions (any role assignable to API tokens; see GET
/v1/roles?context=api_token) and defaults to org_read_only. With token_identity \"personal\" the
token is issued against your own account instead: it uses your account's existing roles, is not
limited to the current org, and the role param must be empty.

Args:
body (ServiceCreateStaticTokenRequest):
Expand All @@ -158,12 +164,14 @@ async def asyncio(
client: AuthenticatedClient,
body: ServiceCreateStaticTokenRequest,
) -> GithubComNuoncoNuonServicesCtlApiInternalAppAccountsServiceStaticTokenResponse | None:
"""create a static API token for your org

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 (any role assignable to API tokens; see GET /v1/roles?context=api_token) and defaults to
org_read_only.
r"""create a static API token for your org

Creates a long-lived static API token. By default (token_identity \"service_account\") each token
gets its own dedicated service account and only grants access to the current org; the role param
controls the token's permissions (any role assignable to API tokens; see GET
/v1/roles?context=api_token) and defaults to org_read_only. With token_identity \"personal\" the
token is issued against your own account instead: it uses your account's existing roles, is not
limited to the current org, and the role param must be empty.

Args:
body (ServiceCreateStaticTokenRequest):
Expand Down
10 changes: 6 additions & 4 deletions nuon/api/accounts/delete_static_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def sync_detailed(
) -> Response[Any]:
"""delete a static API token

Deletes a static API token belonging to your current org, along with its dedicated service account.
Once deleted, the token can no longer be used to access the API.
Deletes a static API token belonging to your current org. For service account tokens, the dedicated
service account is deleted as well; for personal tokens, only the token is deleted and your account
is untouched. Once deleted, the token can no longer be used to access the API.

Args:
token_id (str):
Expand Down Expand Up @@ -81,8 +82,9 @@ async def asyncio_detailed(
) -> Response[Any]:
"""delete a static API token

Deletes a static API token belonging to your current org, along with its dedicated service account.
Once deleted, the token can no longer be used to access the API.
Deletes a static API token belonging to your current org. For service account tokens, the dedicated
service account is deleted as well; for personal tokens, only the token is deleted and your account
is untouched. Once deleted, the token can no longer be used to access the API.

Args:
token_id (str):
Expand Down
15 changes: 15 additions & 0 deletions nuon/api/apps/get_app_branch_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def _get_kwargs(
offset: int | Unset = 0,
limit: int | Unset = 10,
page: int | Unset = 0,
planonly: bool | Unset = True,
) -> dict[str, Any]:

params: dict[str, Any] = {}
Expand All @@ -28,6 +29,8 @@ def _get_kwargs(

params["page"] = page

params["planonly"] = planonly

params = {k: v for k, v in params.items() if v is not UNSET and v is not None}

_kwargs: dict[str, Any] = {
Expand Down Expand Up @@ -105,6 +108,7 @@ def sync_detailed(
offset: int | Unset = 0,
limit: int | Unset = 10,
page: int | Unset = 0,
planonly: bool | Unset = True,
) -> Response[StderrErrResponse | list[AppWorkflow]]:
"""get app branch workflow runs

Expand All @@ -116,6 +120,7 @@ def sync_detailed(
offset (int | Unset): Default: 0.
limit (int | Unset): Default: 10.
page (int | Unset): Default: 0.
planonly (bool | Unset): Default: True.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -131,6 +136,7 @@ def sync_detailed(
offset=offset,
limit=limit,
page=page,
planonly=planonly,
)

response = client.get_httpx_client().request(
Expand All @@ -148,6 +154,7 @@ def sync(
offset: int | Unset = 0,
limit: int | Unset = 10,
page: int | Unset = 0,
planonly: bool | Unset = True,
) -> StderrErrResponse | list[AppWorkflow] | None:
"""get app branch workflow runs

Expand All @@ -159,6 +166,7 @@ def sync(
offset (int | Unset): Default: 0.
limit (int | Unset): Default: 10.
page (int | Unset): Default: 0.
planonly (bool | Unset): Default: True.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -175,6 +183,7 @@ def sync(
offset=offset,
limit=limit,
page=page,
planonly=planonly,
).parsed


Expand All @@ -186,6 +195,7 @@ async def asyncio_detailed(
offset: int | Unset = 0,
limit: int | Unset = 10,
page: int | Unset = 0,
planonly: bool | Unset = True,
) -> Response[StderrErrResponse | list[AppWorkflow]]:
"""get app branch workflow runs

Expand All @@ -197,6 +207,7 @@ async def asyncio_detailed(
offset (int | Unset): Default: 0.
limit (int | Unset): Default: 10.
page (int | Unset): Default: 0.
planonly (bool | Unset): Default: True.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -212,6 +223,7 @@ async def asyncio_detailed(
offset=offset,
limit=limit,
page=page,
planonly=planonly,
)

response = await client.get_async_httpx_client().request(**kwargs)
Expand All @@ -227,6 +239,7 @@ async def asyncio(
offset: int | Unset = 0,
limit: int | Unset = 10,
page: int | Unset = 0,
planonly: bool | Unset = True,
) -> StderrErrResponse | list[AppWorkflow] | None:
"""get app branch workflow runs

Expand All @@ -238,6 +251,7 @@ async def asyncio(
offset (int | Unset): Default: 0.
limit (int | Unset): Default: 10.
page (int | Unset): Default: 0.
planonly (bool | Unset): Default: True.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -255,5 +269,6 @@ async def asyncio(
offset=offset,
limit=limit,
page=page,
planonly=planonly,
)
).parsed
9 changes: 9 additions & 0 deletions nuon/models/app_vcs_connection_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
class AppVCSConnectionCommit:
"""
Attributes:
author_avatar_url (str | Unset):
author_email (str | Unset):
author_name (str | Unset):
created_at (str | Unset):
Expand All @@ -28,6 +29,7 @@ class AppVCSConnectionCommit:
vcs_connection_id (str | Unset):
"""

author_avatar_url: str | Unset = UNSET
author_email: str | Unset = UNSET
author_name: str | Unset = UNSET
created_at: str | Unset = UNSET
Expand All @@ -42,6 +44,8 @@ class AppVCSConnectionCommit:
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
author_avatar_url = self.author_avatar_url

author_email = self.author_email

author_name = self.author_name
Expand All @@ -67,6 +71,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if author_avatar_url is not UNSET:
field_dict["author_avatar_url"] = author_avatar_url
if author_email is not UNSET:
field_dict["author_email"] = author_email
if author_name is not UNSET:
Expand Down Expand Up @@ -95,6 +101,8 @@ def to_dict(self) -> dict[str, Any]:
@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
author_avatar_url = d.pop("author_avatar_url", UNSET)

author_email = d.pop("author_email", UNSET)

author_name = d.pop("author_name", UNSET)
Expand All @@ -118,6 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
vcs_connection_id = d.pop("vcs_connection_id", UNSET)

app_vcs_connection_commit = cls(
author_avatar_url=author_avatar_url,
author_email=author_email,
author_name=author_name,
created_at=created_at,
Expand Down
14 changes: 13 additions & 1 deletion nuon/models/service_create_static_token_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ class ServiceCreateStaticTokenRequest:
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. must be assignable to API tokens; see
GET /v1/roles?context=api_token. defaults to org_read_only.
GET /v1/roles?context=api_token. defaults to org_read_only. must be
empty for personal tokens.
token_identity (str | Unset): "service_account" (default) creates a dedicated service account with
the given role; "personal" issues the token against your own account
and its existing roles, across all your orgs.
"""

name: str
duration: str | Unset = "8760h"
role: str | Unset = UNSET
token_identity: str | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
Expand All @@ -33,6 +38,8 @@ def to_dict(self) -> dict[str, Any]:

role = self.role

token_identity = self.token_identity

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -44,6 +51,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["duration"] = duration
if role is not UNSET:
field_dict["role"] = role
if token_identity is not UNSET:
field_dict["token_identity"] = token_identity

return field_dict

Expand All @@ -56,10 +65,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:

role = d.pop("role", UNSET)

token_identity = d.pop("token_identity", UNSET)

service_create_static_token_request = cls(
name=name,
duration=duration,
role=role,
token_identity=token_identity,
)

service_create_static_token_request.additional_properties = d
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nuon"
version = "0.19.1119"
version = "0.19.1120"
description = "A client library for accessing Nuon"
authors = []
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.1119
0.19.1120
Loading