Skip to content
  •  
  •  
  •  
47 changes: 47 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lint and Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install deps
run: |
python -m pip install --upgrade pip setuptools
pip install poetry

- name: Test install
run: |
poetry install --all-extras

- name: Lint (mypy)
run: |
poetry run mypy cirro_api_client

- name: Run tests (pytest)
run: |
poetry run pytest

- name: Build python package
run: |
poetry build
14 changes: 2 additions & 12 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ on:
release:
types:
- published
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-push-image:
Expand All @@ -20,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.12
- name: Set up Python 3.14
uses: actions/setup-python@v2
with:
python-version: "3.12"
python-version: 3.14

- name: Install deps
run: |
Expand All @@ -34,10 +28,6 @@ jobs:
run: |
poetry install --all-extras

- name: Pytest
run: |
poetry run pytest

- name: Build python package
run: |
poetry build
Expand Down
4 changes: 2 additions & 2 deletions 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.9+.
Python 3.10+.

## Installation & Usage
### pip install
Expand Down Expand Up @@ -115,5 +115,5 @@ client.set_httpx_client(httpx.Client(base_url="https://api.cirro.bio", proxies="
Re-generate the API client by running:

```sh
openapi-python-client update --url https://dev.cirro.bio/openapi/cirro-data-latest.yml --config config.yml --custom-template-path=templates/
openapi-python-client generate --overwrite --url http://localhost:8080/openapi/cirro-data-latest.yml --config config.yml --custom-template-path=templates/
```
1 change: 1 addition & 0 deletions cirro_api_client/v1/api/audit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Contains endpoint functions for accessing the API"""
19 changes: 11 additions & 8 deletions cirro_api_client/v1/api/audit/get_event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from http import HTTPStatus
from typing import Any, Dict, Optional
from typing import Any
from urllib.parse import quote

import httpx

Expand All @@ -11,17 +12,19 @@

def _get_kwargs(
audit_event_id: str,
) -> Dict[str, Any]:
_kwargs: Dict[str, Any] = {
) -> dict[str, Any]:
_kwargs: dict[str, Any] = {
"method": "get",
"url": f"/audit-events/{audit_event_id}",
"url": "/audit-events/{audit_event_id}".format(
audit_event_id=quote(str(audit_event_id), safe=""),
),
}

return _kwargs


def _parse_response(*, client: Client, response: httpx.Response) -> Optional[AuditEvent]:
if response.status_code == HTTPStatus.OK:
def _parse_response(*, client: Client, response: httpx.Response) -> AuditEvent | None:
if response.status_code == 200:
response_200 = AuditEvent.from_dict(response.json())

return response_200
Expand Down Expand Up @@ -75,7 +78,7 @@ def sync(
audit_event_id: str,
*,
client: Client,
) -> Optional[AuditEvent]:
) -> AuditEvent | None:
"""Get audit event

Get audit event detailed information
Expand Down Expand Up @@ -135,7 +138,7 @@ async def asyncio(
audit_event_id: str,
*,
client: Client,
) -> Optional[AuditEvent]:
) -> AuditEvent | None:
"""Get audit event

Get audit event detailed information
Expand Down
86 changes: 43 additions & 43 deletions cirro_api_client/v1/api/audit/list_events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Dict, List, Optional, Union
from typing import Any

import httpx

Expand All @@ -12,15 +12,15 @@

def _get_kwargs(
*,
username: Union[Unset, str] = UNSET,
entity_type: Union[Unset, ListEventsEntityType] = UNSET,
entity_id: Union[Unset, str] = UNSET,
) -> Dict[str, Any]:
params: Dict[str, Any] = {}
username: str | Unset = UNSET,
entity_type: ListEventsEntityType | Unset = UNSET,
entity_id: str | Unset = UNSET,
) -> dict[str, Any]:
params: dict[str, Any] = {}

params["username"] = username

json_entity_type: Union[Unset, str] = UNSET
json_entity_type: str | Unset = UNSET
if not isinstance(entity_type, Unset):
json_entity_type = entity_type.value

Expand All @@ -30,7 +30,7 @@ def _get_kwargs(

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

_kwargs: Dict[str, Any] = {
_kwargs: dict[str, Any] = {
"method": "get",
"url": "/audit-events",
"params": params,
Expand All @@ -39,8 +39,8 @@ def _get_kwargs(
return _kwargs


def _parse_response(*, client: Client, response: httpx.Response) -> Optional[List["AuditEvent"]]:
if response.status_code == HTTPStatus.OK:
def _parse_response(*, client: Client, response: httpx.Response) -> list[AuditEvent] | None:
if response.status_code == 200:
response_200 = []
_response_200 = response.json()
for response_200_item_data in _response_200:
Expand All @@ -53,7 +53,7 @@ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Lis
errors.handle_error_response(response, client.raise_on_unexpected_status)


def _build_response(*, client: Client, response: httpx.Response) -> Response[List["AuditEvent"]]:
def _build_response(*, client: Client, response: httpx.Response) -> Response[list[AuditEvent]]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -65,26 +65,26 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[Lis
def sync_detailed(
*,
client: Client,
username: Union[Unset, str] = UNSET,
entity_type: Union[Unset, ListEventsEntityType] = UNSET,
entity_id: Union[Unset, str] = UNSET,
) -> Response[List["AuditEvent"]]:
username: str | Unset = UNSET,
entity_type: ListEventsEntityType | Unset = UNSET,
entity_id: str | Unset = UNSET,
) -> Response[list[AuditEvent]]:
"""List audit events

Gets a list of audit events

Args:
username (Union[Unset, str]):
entity_type (Union[Unset, ListEventsEntityType]):
entity_id (Union[Unset, str]):
username (str | Unset):
entity_type (ListEventsEntityType | Unset):
entity_id (str | Unset):
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[List['AuditEvent']]
Response[list[AuditEvent]]
"""

kwargs = _get_kwargs(
Expand All @@ -104,26 +104,26 @@ def sync_detailed(
def sync(
*,
client: Client,
username: Union[Unset, str] = UNSET,
entity_type: Union[Unset, ListEventsEntityType] = UNSET,
entity_id: Union[Unset, str] = UNSET,
) -> Optional[List["AuditEvent"]]:
username: str | Unset = UNSET,
entity_type: ListEventsEntityType | Unset = UNSET,
entity_id: str | Unset = UNSET,
) -> list[AuditEvent] | None:
"""List audit events

Gets a list of audit events

Args:
username (Union[Unset, str]):
entity_type (Union[Unset, ListEventsEntityType]):
entity_id (Union[Unset, str]):
username (str | Unset):
entity_type (ListEventsEntityType | Unset):
entity_id (str | Unset):
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:
List['AuditEvent']
list[AuditEvent]
"""

try:
Expand All @@ -140,26 +140,26 @@ def sync(
async def asyncio_detailed(
*,
client: Client,
username: Union[Unset, str] = UNSET,
entity_type: Union[Unset, ListEventsEntityType] = UNSET,
entity_id: Union[Unset, str] = UNSET,
) -> Response[List["AuditEvent"]]:
username: str | Unset = UNSET,
entity_type: ListEventsEntityType | Unset = UNSET,
entity_id: str | Unset = UNSET,
) -> Response[list[AuditEvent]]:
"""List audit events

Gets a list of audit events

Args:
username (Union[Unset, str]):
entity_type (Union[Unset, ListEventsEntityType]):
entity_id (Union[Unset, str]):
username (str | Unset):
entity_type (ListEventsEntityType | Unset):
entity_id (str | Unset):
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[List['AuditEvent']]
Response[list[AuditEvent]]
"""

kwargs = _get_kwargs(
Expand All @@ -176,26 +176,26 @@ async def asyncio_detailed(
async def asyncio(
*,
client: Client,
username: Union[Unset, str] = UNSET,
entity_type: Union[Unset, ListEventsEntityType] = UNSET,
entity_id: Union[Unset, str] = UNSET,
) -> Optional[List["AuditEvent"]]:
username: str | Unset = UNSET,
entity_type: ListEventsEntityType | Unset = UNSET,
entity_id: str | Unset = UNSET,
) -> list[AuditEvent] | None:
"""List audit events

Gets a list of audit events

Args:
username (Union[Unset, str]):
entity_type (Union[Unset, ListEventsEntityType]):
entity_id (Union[Unset, str]):
username (str | Unset):
entity_type (ListEventsEntityType | Unset):
entity_id (str | Unset):
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:
List['AuditEvent']
list[AuditEvent]
"""

try:
Expand Down
1 change: 1 addition & 0 deletions cirro_api_client/v1/api/billing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Contains endpoint functions for accessing the API"""
Loading
Loading