Skip to content
Open
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
28 changes: 14 additions & 14 deletions nuon/api/apps/get_app_config_graph_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

def _get_kwargs(
app_id: str,
app_config_id: str,
config_id: str,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/v1/apps/{app_id}/configs/{app_config_id}/graph",
"url": f"/v1/apps/{app_id}/configs/{config_id}/graph",
}

return _kwargs
Expand Down Expand Up @@ -72,7 +72,7 @@ def _build_response(

def sync_detailed(
app_id: str,
app_config_id: str,
config_id: str,
*,
client: AuthenticatedClient,
) -> Response[StderrErrResponse | str]:
Expand All @@ -85,7 +85,7 @@ def sync_detailed(

Args:
app_id (str):
app_config_id (str):
config_id (str):

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -97,7 +97,7 @@ def sync_detailed(

kwargs = _get_kwargs(
app_id=app_id,
app_config_id=app_config_id,
config_id=config_id,
)

response = client.get_httpx_client().request(
Expand All @@ -109,7 +109,7 @@ def sync_detailed(

def sync(
app_id: str,
app_config_id: str,
config_id: str,
*,
client: AuthenticatedClient,
) -> StderrErrResponse | str | None:
Expand All @@ -122,7 +122,7 @@ def sync(

Args:
app_id (str):
app_config_id (str):
config_id (str):

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -134,14 +134,14 @@ def sync(

return sync_detailed(
app_id=app_id,
app_config_id=app_config_id,
config_id=config_id,
client=client,
).parsed


async def asyncio_detailed(
app_id: str,
app_config_id: str,
config_id: str,
*,
client: AuthenticatedClient,
) -> Response[StderrErrResponse | str]:
Expand All @@ -154,7 +154,7 @@ async def asyncio_detailed(

Args:
app_id (str):
app_config_id (str):
config_id (str):

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -166,7 +166,7 @@ async def asyncio_detailed(

kwargs = _get_kwargs(
app_id=app_id,
app_config_id=app_config_id,
config_id=config_id,
)

response = await client.get_async_httpx_client().request(**kwargs)
Expand All @@ -176,7 +176,7 @@ async def asyncio_detailed(

async def asyncio(
app_id: str,
app_config_id: str,
config_id: str,
*,
client: AuthenticatedClient,
) -> StderrErrResponse | str | None:
Expand All @@ -189,7 +189,7 @@ async def asyncio(

Args:
app_id (str):
app_config_id (str):
config_id (str):

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -202,7 +202,7 @@ async def asyncio(
return (
await asyncio_detailed(
app_id=app_id,
app_config_id=app_config_id,
config_id=config_id,
client=client,
)
).parsed
219 changes: 219 additions & 0 deletions nuon/api/apps/get_app_conflg_v2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
from http import HTTPStatus
from typing import Any

import httpx

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.app_app_config import AppAppConfig
from ...models.stderr_err_response import StderrErrResponse
from ...types import UNSET, Response, Unset


def _get_kwargs(
app_id: str,
config_id: str,
*,
recurse: bool | Unset = False,
) -> dict[str, Any]:
params: dict[str, Any] = {}

params["recurse"] = recurse

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

_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/v1/apps/{app_id}/configs/{config_id}",
"params": params,
}

return _kwargs


def _parse_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AppAppConfig | StderrErrResponse | None:
if response.status_code == 200:
response_200 = AppAppConfig.from_dict(response.json())

return response_200

if response.status_code == 400:
response_400 = StderrErrResponse.from_dict(response.json())

return response_400

if response.status_code == 401:
response_401 = StderrErrResponse.from_dict(response.json())

return response_401

if response.status_code == 403:
response_403 = StderrErrResponse.from_dict(response.json())

return response_403

if response.status_code == 404:
response_404 = StderrErrResponse.from_dict(response.json())

return response_404

if response.status_code == 500:
response_500 = StderrErrResponse.from_dict(response.json())

return response_500

if client.raise_on_unexpected_status:
raise errors.UnexpectedStatus(response.status_code, response.content)
else:
return None


def _build_response(
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AppAppConfig | StderrErrResponse]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
headers=response.headers,
parsed=_parse_response(client=client, response=response),
)


def sync_detailed(
app_id: str,
config_id: str,
*,
client: AuthenticatedClient,
recurse: bool | Unset = False,
) -> Response[AppAppConfig | StderrErrResponse]:
"""get an app config

Fetch an app config by id.

Args:
app_id (str):
config_id (str):
recurse (bool | Unset): Default: False.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[AppAppConfig | StderrErrResponse]
"""

kwargs = _get_kwargs(
app_id=app_id,
config_id=config_id,
recurse=recurse,
)

response = client.get_httpx_client().request(
**kwargs,
)

return _build_response(client=client, response=response)


def sync(
app_id: str,
config_id: str,
*,
client: AuthenticatedClient,
recurse: bool | Unset = False,
) -> AppAppConfig | StderrErrResponse | None:
"""get an app config

Fetch an app config by id.

Args:
app_id (str):
config_id (str):
recurse (bool | Unset): Default: False.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
AppAppConfig | StderrErrResponse
"""

return sync_detailed(
app_id=app_id,
config_id=config_id,
client=client,
recurse=recurse,
).parsed


async def asyncio_detailed(
app_id: str,
config_id: str,
*,
client: AuthenticatedClient,
recurse: bool | Unset = False,
) -> Response[AppAppConfig | StderrErrResponse]:
"""get an app config

Fetch an app config by id.

Args:
app_id (str):
config_id (str):
recurse (bool | Unset): Default: False.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[AppAppConfig | StderrErrResponse]
"""

kwargs = _get_kwargs(
app_id=app_id,
config_id=config_id,
recurse=recurse,
)

response = await client.get_async_httpx_client().request(**kwargs)

return _build_response(client=client, response=response)


async def asyncio(
app_id: str,
config_id: str,
*,
client: AuthenticatedClient,
recurse: bool | Unset = False,
) -> AppAppConfig | StderrErrResponse | None:
"""get an app config

Fetch an app config by id.

Args:
app_id (str):
config_id (str):
recurse (bool | Unset): Default: False.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
AppAppConfig | StderrErrResponse
"""

return (
await asyncio_detailed(
app_id=app_id,
config_id=config_id,
client=client,
recurse=recurse,
)
).parsed
2 changes: 1 addition & 1 deletion nuon/api/apps/update_app_config_installs_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _get_kwargs(

_kwargs: dict[str, Any] = {
"method": "post",
"url": f"/v1/apps/{app_id}/config/{config_id}/update-installs",
"url": f"/v1/apps/{app_id}/configs/{config_id}/update-installs",
}

_kwargs["json"] = body.to_dict()
Expand Down
2 changes: 1 addition & 1 deletion nuon/api/apps/update_app_conflg_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _get_kwargs(

_kwargs: dict[str, Any] = {
"method": "patch",
"url": f"/v1/apps/{app_id}/config/{config_id}",
"url": f"/v1/apps/{app_id}/configs/{config_id}",
}

_kwargs["json"] = body.to_dict()
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.705"
version = "0.19.706"
description = "A client library for accessing Nuon"
authors = []
requires-python = ">=3.10"
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.705
0.19.706
Loading