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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: read
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This Python package is automatically generated by the [OpenAPI Python Client](ht

## Requirements.

Python 3.10+.
Python 3.11+.

## Installation & Usage
### pip install
Expand Down
20 changes: 10 additions & 10 deletions cirro_api_client/v1/api/dashboards/create_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from ... import errors
from ...client import Client
from ...models.create_response import CreateResponse
from ...models.dashboard_request import DashboardRequest
from ...models.dashboard_input import DashboardInput
from ...types import Response


def _get_kwargs(
project_id: str,
*,
body: DashboardRequest,
body: DashboardInput,
) -> dict[str, Any]:
headers: dict[str, Any] = {}

Expand Down Expand Up @@ -55,15 +55,15 @@ def sync_detailed(
project_id: str,
*,
client: Client,
body: DashboardRequest,
body: DashboardInput,
) -> Response[CreateResponse]:
"""Create dashboard

Creates a dashboard

Args:
project_id (str):
body (DashboardRequest):
body (DashboardInput):
client (Client): instance of the API client

Raises:
Expand Down Expand Up @@ -91,15 +91,15 @@ def sync(
project_id: str,
*,
client: Client,
body: DashboardRequest,
body: DashboardInput,
) -> CreateResponse | None:
"""Create dashboard

Creates a dashboard

Args:
project_id (str):
body (DashboardRequest):
body (DashboardInput):
client (Client): instance of the API client

Raises:
Expand All @@ -124,15 +124,15 @@ async def asyncio_detailed(
project_id: str,
*,
client: Client,
body: DashboardRequest,
body: DashboardInput,
) -> Response[CreateResponse]:
"""Create dashboard

Creates a dashboard

Args:
project_id (str):
body (DashboardRequest):
body (DashboardInput):
client (Client): instance of the API client

Raises:
Expand All @@ -157,15 +157,15 @@ async def asyncio(
project_id: str,
*,
client: Client,
body: DashboardRequest,
body: DashboardInput,
) -> CreateResponse | None:
"""Create dashboard

Creates a dashboard

Args:
project_id (str):
body (DashboardRequest):
body (DashboardInput):
client (Client): instance of the API client

Raises:
Expand Down
172 changes: 172 additions & 0 deletions cirro_api_client/v1/api/dashboards/create_dashboard_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
from http import HTTPStatus
from typing import Any

import httpx

from ... import errors
from ...client import Client
from ...models.create_response import CreateResponse
from ...models.dashboard_input import DashboardInput
from ...types import Response


def _get_kwargs(
*,
body: DashboardInput,
) -> dict[str, Any]:
headers: dict[str, Any] = {}

_kwargs: dict[str, Any] = {
"method": "post",
"url": "/dashboards",
}

_kwargs["json"] = body.to_dict()

headers["Content-Type"] = "application/json"

_kwargs["headers"] = headers
return _kwargs


def _parse_response(*, client: Client, response: httpx.Response) -> CreateResponse | None:
if response.status_code == 201:
response_201 = CreateResponse.from_dict(response.json())

return response_201

errors.handle_error_response(response, client.raise_on_unexpected_status)


def _build_response(*, client: Client, response: httpx.Response) -> Response[CreateResponse]:
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: Client,
body: DashboardInput,
) -> Response[CreateResponse]:
"""Create dashboard template

Creates a new dashboard template

Args:
body (DashboardInput):
client (Client): instance of the API client

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[CreateResponse]
"""

kwargs = _get_kwargs(
body=body,
)

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

return _build_response(client=client, response=response)


def sync(
*,
client: Client,
body: DashboardInput,
) -> CreateResponse | None:
"""Create dashboard template

Creates a new dashboard template

Args:
body (DashboardInput):
client (Client): instance of the API client

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:
CreateResponse
"""

try:
return sync_detailed(
client=client,
body=body,
).parsed
except errors.NotFoundException:
return None


async def asyncio_detailed(
*,
client: Client,
body: DashboardInput,
) -> Response[CreateResponse]:
"""Create dashboard template

Creates a new dashboard template

Args:
body (DashboardInput):
client (Client): instance of the API client

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[CreateResponse]
"""

kwargs = _get_kwargs(
body=body,
)

response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs)

return _build_response(client=client, response=response)


async def asyncio(
*,
client: Client,
body: DashboardInput,
) -> CreateResponse | None:
"""Create dashboard template

Creates a new dashboard template

Args:
body (DashboardInput):
client (Client): instance of the API client

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:
CreateResponse
"""

try:
return (
await asyncio_detailed(
client=client,
body=body,
)
).parsed
except errors.NotFoundException:
return None
101 changes: 101 additions & 0 deletions cirro_api_client/v1/api/dashboards/delete_dashboard_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
from http import HTTPStatus
from typing import Any
from urllib.parse import quote

import httpx

from ... import errors
from ...client import Client
from ...types import Response


def _get_kwargs(
dashboard_id: str,
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "delete",
"url": "/dashboards/{dashboard_id}".format(
dashboard_id=quote(str(dashboard_id), safe=""),
),
}

return _kwargs


def _parse_response(*, client: Client, response: httpx.Response) -> Any | None:
if response.status_code == 204:
return None

errors.handle_error_response(response, client.raise_on_unexpected_status)


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


def sync_detailed(
dashboard_id: str,
*,
client: Client,
) -> Response[Any]:
"""Delete dashboard template

Deletes a dashboard template

Args:
dashboard_id (str):
client (Client): instance of the API client

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

Returns:
Response[Any]
"""

kwargs = _get_kwargs(
dashboard_id=dashboard_id,
)

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

return _build_response(client=client, response=response)


async def asyncio_detailed(
dashboard_id: str,
*,
client: Client,
) -> Response[Any]:
"""Delete dashboard template

Deletes a dashboard template

Args:
dashboard_id (str):
client (Client): instance of the API client

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

Returns:
Response[Any]
"""

kwargs = _get_kwargs(
dashboard_id=dashboard_id,
)

response = await client.get_async_httpx_client().request(auth=client.get_auth(), **kwargs)

return _build_response(client=client, response=response)
Loading
Loading