diff --git a/.gitignore b/.gitignore index 0aab6988..02705b29 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ pytest.ini # from nix builds /result + +# wheel build artifacts +*.data/ diff --git a/pyproject.toml b/pyproject.toml index 1f2d9a49..a13e6f5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ version = "0.3.44rc1" description = "Tower CLI and runtime environment for Tower." authors = [{ name = "Tower Computing Inc.", email = "brad@tower.dev" }] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = { file = "LICENSE" } keywords = [ "automation", @@ -25,7 +25,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -96,7 +95,7 @@ dev = [ { include-group = "test" }, "black==24.10.0", "mypy==1.13.0", - "openapi-python-client==0.24.3", + "openapi-python-client==0.28.1", "pre-commit==4.0.1", "pyiceberg[sql-sqlite]==0.9.1", ] diff --git a/src/tower/tower_api_client/api/default/acknowledge_alert.py b/src/tower/tower_api_client/api/default/acknowledge_alert.py index 5ce161a5..299a4494 100644 --- a/src/tower/tower_api_client/api/default/acknowledge_alert.py +++ b/src/tower/tower_api_client/api/default/acknowledge_alert.py @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.acknowledge_alert_response import AcknowledgeAlertResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/alerts/{alert_seq}/acknowledge".format( - alert_seq=alert_seq, + alert_seq=quote(str(alert_seq), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AcknowledgeAlertResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AcknowledgeAlertResponse | ErrorModel: if response.status_code == 200: response_200 = AcknowledgeAlertResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AcknowledgeAlertResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AcknowledgeAlertResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( alert_seq: int, *, client: AuthenticatedClient, -) -> Response[AcknowledgeAlertResponse]: +) -> Response[AcknowledgeAlertResponse | ErrorModel]: """Acknowledge alert Mark an alert as acknowledged @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AcknowledgeAlertResponse] + Response[AcknowledgeAlertResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( alert_seq: int, *, client: AuthenticatedClient, -) -> Optional[AcknowledgeAlertResponse]: +) -> AcknowledgeAlertResponse | ErrorModel | None: """Acknowledge alert Mark an alert as acknowledged @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AcknowledgeAlertResponse + AcknowledgeAlertResponse | ErrorModel """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( alert_seq: int, *, client: AuthenticatedClient, -) -> Response[AcknowledgeAlertResponse]: +) -> Response[AcknowledgeAlertResponse | ErrorModel]: """Acknowledge alert Mark an alert as acknowledged @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AcknowledgeAlertResponse] + Response[AcknowledgeAlertResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( alert_seq: int, *, client: AuthenticatedClient, -) -> Optional[AcknowledgeAlertResponse]: +) -> AcknowledgeAlertResponse | ErrorModel | None: """Acknowledge alert Mark an alert as acknowledged @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AcknowledgeAlertResponse + AcknowledgeAlertResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py b/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py index f09bcb38..e1ea26bf 100644 --- a/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py +++ b/src/tower/tower_api_client/api/default/acknowledge_all_alerts.py @@ -1,11 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.acknowledge_all_alerts_response import AcknowledgeAllAlertsResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[AcknowledgeAllAlertsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AcknowledgeAllAlertsResponse | ErrorModel: if response.status_code == 200: response_200 = AcknowledgeAllAlertsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[AcknowledgeAllAlertsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[AcknowledgeAllAlertsResponse]: +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: """Acknowledge all alerts Mark all unacknowledged alerts as acknowledged for the current user in the current account @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AcknowledgeAllAlertsResponse] + Response[AcknowledgeAllAlertsResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[AcknowledgeAllAlertsResponse]: +) -> AcknowledgeAllAlertsResponse | ErrorModel | None: """Acknowledge all alerts Mark all unacknowledged alerts as acknowledged for the current user in the current account @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AcknowledgeAllAlertsResponse + AcknowledgeAllAlertsResponse | ErrorModel """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[AcknowledgeAllAlertsResponse]: +) -> Response[AcknowledgeAllAlertsResponse | ErrorModel]: """Acknowledge all alerts Mark all unacknowledged alerts as acknowledged for the current user in the current account @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AcknowledgeAllAlertsResponse] + Response[AcknowledgeAllAlertsResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[AcknowledgeAllAlertsResponse]: +) -> AcknowledgeAllAlertsResponse | ErrorModel | None: """Acknowledge all alerts Mark all unacknowledged alerts as acknowledged for the current user in the current account @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AcknowledgeAllAlertsResponse + AcknowledgeAllAlertsResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/activate_schedules.py b/src/tower/tower_api_client/api/default/activate_schedules.py index e1cc1469..d082e662 100644 --- a/src/tower/tower_api_client/api/default/activate_schedules.py +++ b/src/tower/tower_api_client/api/default/activate_schedules.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.batch_schedule_params import BatchScheduleParams from ...models.batch_schedule_response import BatchScheduleResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/schedules/activate", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[BatchScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BatchScheduleResponse | ErrorModel: if response.status_code == 200: response_200 = BatchScheduleResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[BatchScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BatchScheduleResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Response[BatchScheduleResponse]: +) -> Response[BatchScheduleResponse | ErrorModel]: """Activate multiple schedules Activate multiple schedules to enable their execution. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BatchScheduleResponse] + Response[BatchScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Optional[BatchScheduleResponse]: +) -> BatchScheduleResponse | ErrorModel | None: """Activate multiple schedules Activate multiple schedules to enable their execution. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BatchScheduleResponse + BatchScheduleResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Response[BatchScheduleResponse]: +) -> Response[BatchScheduleResponse | ErrorModel]: """Activate multiple schedules Activate multiple schedules to enable their execution. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BatchScheduleResponse] + Response[BatchScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Optional[BatchScheduleResponse]: +) -> BatchScheduleResponse | ErrorModel | None: """Activate multiple schedules Activate multiple schedules to enable their execution. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BatchScheduleResponse + BatchScheduleResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/cancel_run.py b/src/tower/tower_api_client/api/default/cancel_run.py index 2dbc22e1..b36d2245 100644 --- a/src/tower/tower_api_client/api/default/cancel_run.py +++ b/src/tower/tower_api_client/api/default/cancel_run.py @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.cancel_run_response import CancelRunResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -16,8 +17,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/apps/{name}/runs/{seq}".format( - name=name, - seq=seq, + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), ), } @@ -25,21 +26,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CancelRunResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CancelRunResponse | ErrorModel: if response.status_code == 200: response_200 = CancelRunResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CancelRunResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CancelRunResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +54,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[CancelRunResponse]: +) -> Response[CancelRunResponse | ErrorModel]: """Cancel run Cancel a run @@ -67,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelRunResponse] + Response[CancelRunResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,7 +88,7 @@ def sync( seq: int, *, client: AuthenticatedClient, -) -> Optional[CancelRunResponse]: +) -> CancelRunResponse | ErrorModel | None: """Cancel run Cancel a run @@ -101,7 +102,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelRunResponse + CancelRunResponse | ErrorModel """ return sync_detailed( @@ -116,7 +117,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[CancelRunResponse]: +) -> Response[CancelRunResponse | ErrorModel]: """Cancel run Cancel a run @@ -130,7 +131,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CancelRunResponse] + Response[CancelRunResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -148,7 +149,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, -) -> Optional[CancelRunResponse]: +) -> CancelRunResponse | ErrorModel | None: """Cancel run Cancel a run @@ -162,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CancelRunResponse + CancelRunResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/check_webhook.py b/src/tower/tower_api_client/api/default/check_webhook.py new file mode 100644 index 00000000..147bbb13 --- /dev/null +++ b/src/tower/tower_api_client/api/default/check_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.test_webhook_response import TestWebhookResponse +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/webhooks/{name}/test".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | TestWebhookResponse: + if response.status_code == 200: + response_200 = TestWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | TestWebhookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | TestWebhookResponse]: + """Check webhook + + Args: + name (str): The name of the webhook. + + 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[ErrorModel | TestWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | TestWebhookResponse | None: + """Check webhook + + Args: + name (str): The name of the webhook. + + 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: + ErrorModel | TestWebhookResponse + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorModel | TestWebhookResponse]: + """Check webhook + + Args: + name (str): The name of the webhook. + + 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[ErrorModel | TestWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> ErrorModel | TestWebhookResponse | None: + """Check webhook + + Args: + name (str): The name of the webhook. + + 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: + ErrorModel | TestWebhookResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/claim_device_login_ticket.py b/src/tower/tower_api_client/api/default/claim_device_login_ticket.py index 0ac0ce73..24909112 100644 --- a/src/tower/tower_api_client/api/default/claim_device_login_ticket.py +++ b/src/tower/tower_api_client/api/default/claim_device_login_ticket.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.claim_device_login_ticket_params import ClaimDeviceLoginTicketParams from ...models.claim_device_login_ticket_response import ClaimDeviceLoginTicketResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/login/device/claim", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ClaimDeviceLoginTicketResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ClaimDeviceLoginTicketResponse | ErrorModel: if response.status_code == 200: response_200 = ClaimDeviceLoginTicketResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ClaimDeviceLoginTicketResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ClaimDeviceLoginTicketParams, -) -> Response[ClaimDeviceLoginTicketResponse]: +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: """Claim a device login ticket Claims a device login ticket code for the authenticated user. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ClaimDeviceLoginTicketResponse] + Response[ClaimDeviceLoginTicketResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: ClaimDeviceLoginTicketParams, -) -> Optional[ClaimDeviceLoginTicketResponse]: +) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: """Claim a device login ticket Claims a device login ticket code for the authenticated user. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ClaimDeviceLoginTicketResponse + ClaimDeviceLoginTicketResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ClaimDeviceLoginTicketParams, -) -> Response[ClaimDeviceLoginTicketResponse]: +) -> Response[ClaimDeviceLoginTicketResponse | ErrorModel]: """Claim a device login ticket Claims a device login ticket code for the authenticated user. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ClaimDeviceLoginTicketResponse] + Response[ClaimDeviceLoginTicketResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ClaimDeviceLoginTicketParams, -) -> Optional[ClaimDeviceLoginTicketResponse]: +) -> ClaimDeviceLoginTicketResponse | ErrorModel | None: """Claim a device login ticket Claims a device login ticket code for the authenticated user. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ClaimDeviceLoginTicketResponse + ClaimDeviceLoginTicketResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_account.py b/src/tower/tower_api_client/api/default/create_account.py index dcd79a51..8a9af191 100644 --- a/src/tower/tower_api_client/api/default/create_account.py +++ b/src/tower/tower_api_client/api/default/create_account.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_account_params import CreateAccountParams from ...models.create_account_response import CreateAccountResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/accounts", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateAccountResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAccountResponse | ErrorModel: if response.status_code == 200: response_200 = CreateAccountResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateAccountResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAccountResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -56,9 +55,9 @@ def _build_response( def sync_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateAccountParams, -) -> Response[CreateAccountResponse]: +) -> Response[CreateAccountResponse | ErrorModel]: """Create account This is the primary way that users register new accounts with Tower. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAccountResponse] + Response[CreateAccountResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,9 +86,9 @@ def sync_detailed( def sync( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateAccountParams, -) -> Optional[CreateAccountResponse]: +) -> CreateAccountResponse | ErrorModel | None: """Create account This is the primary way that users register new accounts with Tower. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAccountResponse + CreateAccountResponse | ErrorModel """ return sync_detailed( @@ -113,9 +112,9 @@ def sync( async def asyncio_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateAccountParams, -) -> Response[CreateAccountResponse]: +) -> Response[CreateAccountResponse | ErrorModel]: """Create account This is the primary way that users register new accounts with Tower. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAccountResponse] + Response[CreateAccountResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -142,9 +141,9 @@ async def asyncio_detailed( async def asyncio( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateAccountParams, -) -> Optional[CreateAccountResponse]: +) -> CreateAccountResponse | ErrorModel | None: """Create account This is the primary way that users register new accounts with Tower. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAccountResponse + CreateAccountResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_api_key.py b/src/tower/tower_api_client/api/default/create_api_key.py index d089a7ae..aed81bf8 100644 --- a/src/tower/tower_api_client/api/default/create_api_key.py +++ b/src/tower/tower_api_client/api/default/create_api_key.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_api_key_params import CreateAPIKeyParams from ...models.create_api_key_response import CreateAPIKeyResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/api-keys", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateAPIKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAPIKeyResponse | ErrorModel: if response.status_code == 201: response_201 = CreateAPIKeyResponse.from_dict(response.json()) return response_201 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateAPIKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAPIKeyResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateAPIKeyParams, -) -> Response[CreateAPIKeyResponse]: +) -> Response[CreateAPIKeyResponse | ErrorModel]: """Create API Key Args: @@ -69,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAPIKeyResponse] + Response[CreateAPIKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,7 +86,7 @@ def sync( *, client: AuthenticatedClient, body: CreateAPIKeyParams, -) -> Optional[CreateAPIKeyResponse]: +) -> CreateAPIKeyResponse | ErrorModel | None: """Create API Key Args: @@ -98,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAPIKeyResponse + CreateAPIKeyResponse | ErrorModel """ return sync_detailed( @@ -111,7 +110,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateAPIKeyParams, -) -> Response[CreateAPIKeyResponse]: +) -> Response[CreateAPIKeyResponse | ErrorModel]: """Create API Key Args: @@ -122,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAPIKeyResponse] + Response[CreateAPIKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -138,7 +137,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateAPIKeyParams, -) -> Optional[CreateAPIKeyResponse]: +) -> CreateAPIKeyResponse | ErrorModel | None: """Create API Key Args: @@ -149,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAPIKeyResponse + CreateAPIKeyResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_app.py b/src/tower/tower_api_client/api/default/create_app.py index 1016979e..8c9dc4ed 100644 --- a/src/tower/tower_api_client/api/default/create_app.py +++ b/src/tower/tower_api_client/api/default/create_app.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_app_params import CreateAppParams from ...models.create_app_response import CreateAppResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/apps", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAppResponse | ErrorModel: if response.status_code == 201: response_201 = CreateAppResponse.from_dict(response.json()) return response_201 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAppResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateAppParams, -) -> Response[CreateAppResponse]: +) -> Response[CreateAppResponse | ErrorModel]: """Create app Create a new app in the current account. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAppResponse] + Response[CreateAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateAppParams, -) -> Optional[CreateAppResponse]: +) -> CreateAppResponse | ErrorModel | None: """Create app Create a new app in the current account. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAppResponse + CreateAppResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateAppParams, -) -> Response[CreateAppResponse]: +) -> Response[CreateAppResponse | ErrorModel]: """Create app Create a new app in the current account. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAppResponse] + Response[CreateAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateAppParams, -) -> Optional[CreateAppResponse]: +) -> CreateAppResponse | ErrorModel | None: """Create app Create a new app in the current account. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAppResponse + CreateAppResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_authenticator.py b/src/tower/tower_api_client/api/default/create_authenticator.py index 030ef3ed..25d4e6fd 100644 --- a/src/tower/tower_api_client/api/default/create_authenticator.py +++ b/src/tower/tower_api_client/api/default/create_authenticator.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_authenticator_params import CreateAuthenticatorParams from ...models.create_authenticator_response import CreateAuthenticatorResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/authenticators", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateAuthenticatorResponse | ErrorModel: if response.status_code == 200: response_200 = CreateAuthenticatorResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateAuthenticatorResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateAuthenticatorParams, -) -> Response[CreateAuthenticatorResponse]: +) -> Response[CreateAuthenticatorResponse | ErrorModel]: """Create authenticator Associates an authenticator with your account, where the authenticator is identified by the URL with @@ -72,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAuthenticatorResponse] + Response[CreateAuthenticatorResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -90,7 +89,7 @@ def sync( *, client: AuthenticatedClient, body: CreateAuthenticatorParams, -) -> Optional[CreateAuthenticatorResponse]: +) -> CreateAuthenticatorResponse | ErrorModel | None: """Create authenticator Associates an authenticator with your account, where the authenticator is identified by the URL with @@ -104,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAuthenticatorResponse + CreateAuthenticatorResponse | ErrorModel """ return sync_detailed( @@ -117,7 +116,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateAuthenticatorParams, -) -> Response[CreateAuthenticatorResponse]: +) -> Response[CreateAuthenticatorResponse | ErrorModel]: """Create authenticator Associates an authenticator with your account, where the authenticator is identified by the URL with @@ -131,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateAuthenticatorResponse] + Response[CreateAuthenticatorResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -147,7 +146,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateAuthenticatorParams, -) -> Optional[CreateAuthenticatorResponse]: +) -> CreateAuthenticatorResponse | ErrorModel | None: """Create authenticator Associates an authenticator with your account, where the authenticator is identified by the URL with @@ -161,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateAuthenticatorResponse + CreateAuthenticatorResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_catalog.py b/src/tower/tower_api_client/api/default/create_catalog.py index 8cfb0e0b..37914243 100644 --- a/src/tower/tower_api_client/api/default/create_catalog.py +++ b/src/tower/tower_api_client/api/default/create_catalog.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_catalog_params import CreateCatalogParams from ...models.create_catalog_response import CreateCatalogResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/catalogs", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateCatalogResponse | ErrorModel: if response.status_code == 200: response_200 = CreateCatalogResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateCatalogResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateCatalogParams, -) -> Response[CreateCatalogResponse]: +) -> Response[CreateCatalogResponse | ErrorModel]: """Create catalog Create a new catalog object in the currently authenticated account. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateCatalogResponse] + Response[CreateCatalogResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateCatalogParams, -) -> Optional[CreateCatalogResponse]: +) -> CreateCatalogResponse | ErrorModel | None: """Create catalog Create a new catalog object in the currently authenticated account. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateCatalogResponse + CreateCatalogResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateCatalogParams, -) -> Response[CreateCatalogResponse]: +) -> Response[CreateCatalogResponse | ErrorModel]: """Create catalog Create a new catalog object in the currently authenticated account. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateCatalogResponse] + Response[CreateCatalogResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateCatalogParams, -) -> Optional[CreateCatalogResponse]: +) -> CreateCatalogResponse | ErrorModel | None: """Create catalog Create a new catalog object in the currently authenticated account. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateCatalogResponse + CreateCatalogResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_device_login_ticket.py b/src/tower/tower_api_client/api/default/create_device_login_ticket.py index 5aa29947..bb067340 100644 --- a/src/tower/tower_api_client/api/default/create_device_login_ticket.py +++ b/src/tower/tower_api_client/api/default/create_device_login_ticket.py @@ -1,13 +1,13 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_device_login_ticket_response import ( CreateDeviceLoginTicketResponse, ) +from ...models.error_model import ErrorModel from ...types import Response @@ -21,21 +21,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateDeviceLoginTicketResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateDeviceLoginTicketResponse | ErrorModel: if response.status_code == 200: response_200 = CreateDeviceLoginTicketResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateDeviceLoginTicketResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -46,8 +46,8 @@ def _build_response( def sync_detailed( *, - client: Union[AuthenticatedClient, Client], -) -> Response[CreateDeviceLoginTicketResponse]: + client: AuthenticatedClient | Client, +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: """Create device login ticket Creates a new device login ticket and returns the codes and urls needed for authentication. @@ -57,7 +57,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateDeviceLoginTicketResponse] + Response[CreateDeviceLoginTicketResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -71,8 +71,8 @@ def sync_detailed( def sync( *, - client: Union[AuthenticatedClient, Client], -) -> Optional[CreateDeviceLoginTicketResponse]: + client: AuthenticatedClient | Client, +) -> CreateDeviceLoginTicketResponse | ErrorModel | None: """Create device login ticket Creates a new device login ticket and returns the codes and urls needed for authentication. @@ -82,7 +82,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateDeviceLoginTicketResponse + CreateDeviceLoginTicketResponse | ErrorModel """ return sync_detailed( @@ -92,8 +92,8 @@ def sync( async def asyncio_detailed( *, - client: Union[AuthenticatedClient, Client], -) -> Response[CreateDeviceLoginTicketResponse]: + client: AuthenticatedClient | Client, +) -> Response[CreateDeviceLoginTicketResponse | ErrorModel]: """Create device login ticket Creates a new device login ticket and returns the codes and urls needed for authentication. @@ -103,7 +103,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateDeviceLoginTicketResponse] + Response[CreateDeviceLoginTicketResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -115,8 +115,8 @@ async def asyncio_detailed( async def asyncio( *, - client: Union[AuthenticatedClient, Client], -) -> Optional[CreateDeviceLoginTicketResponse]: + client: AuthenticatedClient | Client, +) -> CreateDeviceLoginTicketResponse | ErrorModel | None: """Create device login ticket Creates a new device login ticket and returns the codes and urls needed for authentication. @@ -126,7 +126,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateDeviceLoginTicketResponse + CreateDeviceLoginTicketResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_environment.py b/src/tower/tower_api_client/api/default/create_environment.py index ecf29485..b4328f20 100644 --- a/src/tower/tower_api_client/api/default/create_environment.py +++ b/src/tower/tower_api_client/api/default/create_environment.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_environment_params import CreateEnvironmentParams from ...models.create_environment_response import CreateEnvironmentResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/environments", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateEnvironmentResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateEnvironmentResponse | ErrorModel: if response.status_code == 201: response_201 = CreateEnvironmentResponse.from_dict(response.json()) return response_201 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateEnvironmentResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateEnvironmentResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateEnvironmentParams, -) -> Response[CreateEnvironmentResponse]: +) -> Response[CreateEnvironmentResponse | ErrorModel]: """Create environment Create a new environment for an app. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateEnvironmentResponse] + Response[CreateEnvironmentResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateEnvironmentParams, -) -> Optional[CreateEnvironmentResponse]: +) -> CreateEnvironmentResponse | ErrorModel | None: """Create environment Create a new environment for an app. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateEnvironmentResponse + CreateEnvironmentResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateEnvironmentParams, -) -> Response[CreateEnvironmentResponse]: +) -> Response[CreateEnvironmentResponse | ErrorModel]: """Create environment Create a new environment for an app. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateEnvironmentResponse] + Response[CreateEnvironmentResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateEnvironmentParams, -) -> Optional[CreateEnvironmentResponse]: +) -> CreateEnvironmentResponse | ErrorModel | None: """Create environment Create a new environment for an app. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateEnvironmentResponse + CreateEnvironmentResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_password_reset.py b/src/tower/tower_api_client/api/default/create_password_reset.py index c54d75de..d109aa3a 100644 --- a/src/tower/tower_api_client/api/default/create_password_reset.py +++ b/src/tower/tower_api_client/api/default/create_password_reset.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_password_reset_params import CreatePasswordResetParams from ...models.create_password_reset_response import CreatePasswordResetResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/accounts/password-reset", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreatePasswordResetResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreatePasswordResetResponse | ErrorModel: if response.status_code == 200: response_200 = CreatePasswordResetResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreatePasswordResetResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreatePasswordResetResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -56,9 +55,9 @@ def _build_response( def sync_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreatePasswordResetParams, -) -> Response[CreatePasswordResetResponse]: +) -> Response[CreatePasswordResetResponse | ErrorModel]: """Create password reset Starts the password reset process for an account. If an email address exists for the account @@ -72,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreatePasswordResetResponse] + Response[CreatePasswordResetResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -88,9 +87,9 @@ def sync_detailed( def sync( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreatePasswordResetParams, -) -> Optional[CreatePasswordResetResponse]: +) -> CreatePasswordResetResponse | ErrorModel | None: """Create password reset Starts the password reset process for an account. If an email address exists for the account @@ -104,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreatePasswordResetResponse + CreatePasswordResetResponse | ErrorModel """ return sync_detailed( @@ -115,9 +114,9 @@ def sync( async def asyncio_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreatePasswordResetParams, -) -> Response[CreatePasswordResetResponse]: +) -> Response[CreatePasswordResetResponse | ErrorModel]: """Create password reset Starts the password reset process for an account. If an email address exists for the account @@ -131,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreatePasswordResetResponse] + Response[CreatePasswordResetResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -145,9 +144,9 @@ async def asyncio_detailed( async def asyncio( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreatePasswordResetParams, -) -> Optional[CreatePasswordResetResponse]: +) -> CreatePasswordResetResponse | ErrorModel | None: """Create password reset Starts the password reset process for an account. If an email address exists for the account @@ -161,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreatePasswordResetResponse + CreatePasswordResetResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py index a5668293..9bb07efb 100644 --- a/src/tower/tower_api_client/api/default/create_sandbox_secrets.py +++ b/src/tower/tower_api_client/api/default/create_sandbox_secrets.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_sandbox_secrets_params import CreateSandboxSecretsParams from ...models.create_sandbox_secrets_response import CreateSandboxSecretsResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/sandbox/secrets", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateSandboxSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSandboxSecretsResponse | ErrorModel: if response.status_code == 200: response_200 = CreateSandboxSecretsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateSandboxSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateSandboxSecretsParams, -) -> Response[CreateSandboxSecretsResponse]: +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: """Create Tower-provided sandbox secrets Creates secrets with Tower-provided default values for the specified keys in the given environment. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateSandboxSecretsResponse] + Response[CreateSandboxSecretsResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateSandboxSecretsParams, -) -> Optional[CreateSandboxSecretsResponse]: +) -> CreateSandboxSecretsResponse | ErrorModel | None: """Create Tower-provided sandbox secrets Creates secrets with Tower-provided default values for the specified keys in the given environment. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateSandboxSecretsResponse + CreateSandboxSecretsResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateSandboxSecretsParams, -) -> Response[CreateSandboxSecretsResponse]: +) -> Response[CreateSandboxSecretsResponse | ErrorModel]: """Create Tower-provided sandbox secrets Creates secrets with Tower-provided default values for the specified keys in the given environment. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateSandboxSecretsResponse] + Response[CreateSandboxSecretsResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateSandboxSecretsParams, -) -> Optional[CreateSandboxSecretsResponse]: +) -> CreateSandboxSecretsResponse | ErrorModel | None: """Create Tower-provided sandbox secrets Creates secrets with Tower-provided default values for the specified keys in the given environment. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateSandboxSecretsResponse + CreateSandboxSecretsResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_schedule.py b/src/tower/tower_api_client/api/default/create_schedule.py index 17cbf4fd..6d78e1ac 100644 --- a/src/tower/tower_api_client/api/default/create_schedule.py +++ b/src/tower/tower_api_client/api/default/create_schedule.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_schedule_params import CreateScheduleParams from ...models.create_schedule_response import CreateScheduleResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/schedules", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateScheduleResponse | ErrorModel: if response.status_code == 201: response_201 = CreateScheduleResponse.from_dict(response.json()) return response_201 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateScheduleResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateScheduleParams, -) -> Response[CreateScheduleResponse]: +) -> Response[CreateScheduleResponse | ErrorModel]: """Create schedule Create a new schedule for an app. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateScheduleResponse] + Response[CreateScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateScheduleParams, -) -> Optional[CreateScheduleResponse]: +) -> CreateScheduleResponse | ErrorModel | None: """Create schedule Create a new schedule for an app. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateScheduleResponse + CreateScheduleResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateScheduleParams, -) -> Response[CreateScheduleResponse]: +) -> Response[CreateScheduleResponse | ErrorModel]: """Create schedule Create a new schedule for an app. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateScheduleResponse] + Response[CreateScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateScheduleParams, -) -> Optional[CreateScheduleResponse]: +) -> CreateScheduleResponse | ErrorModel | None: """Create schedule Create a new schedule for an app. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateScheduleResponse + CreateScheduleResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_secret.py b/src/tower/tower_api_client/api/default/create_secret.py index eb92e0e8..9b4975ad 100644 --- a/src/tower/tower_api_client/api/default/create_secret.py +++ b/src/tower/tower_api_client/api/default/create_secret.py @@ -1,5 +1,5 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx @@ -22,9 +22,8 @@ def _get_kwargs( "url": "/secrets", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -32,28 +31,33 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[CreateSecretResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSecretResponse | ErrorModel | None: if response.status_code == 201: response_201 = CreateSecretResponse.from_dict(response.json()) return response_201 + if response.status_code == 401: response_401 = ErrorModel.from_dict(response.json()) return response_401 + if response.status_code == 409: response_409 = ErrorModel.from_dict(response.json()) return response_409 + if response.status_code == 412: response_412 = ErrorModel.from_dict(response.json()) return response_412 + if response.status_code == 500: response_500 = ErrorModel.from_dict(response.json()) return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -61,8 +65,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[CreateSecretResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSecretResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,7 +79,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateSecretParams, -) -> Response[Union[CreateSecretResponse, ErrorModel]]: +) -> Response[CreateSecretResponse | ErrorModel]: """Create secret Creates a new secret and associates it with the current account. @@ -88,7 +92,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CreateSecretResponse, ErrorModel]] + Response[CreateSecretResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -106,7 +110,7 @@ def sync( *, client: AuthenticatedClient, body: CreateSecretParams, -) -> Optional[Union[CreateSecretResponse, ErrorModel]]: +) -> CreateSecretResponse | ErrorModel | None: """Create secret Creates a new secret and associates it with the current account. @@ -119,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CreateSecretResponse, ErrorModel] + CreateSecretResponse | ErrorModel """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateSecretParams, -) -> Response[Union[CreateSecretResponse, ErrorModel]]: +) -> Response[CreateSecretResponse | ErrorModel]: """Create secret Creates a new secret and associates it with the current account. @@ -145,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CreateSecretResponse, ErrorModel]] + Response[CreateSecretResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -161,7 +165,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateSecretParams, -) -> Optional[Union[CreateSecretResponse, ErrorModel]]: +) -> CreateSecretResponse | ErrorModel | None: """Create secret Creates a new secret and associates it with the current account. @@ -174,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CreateSecretResponse, ErrorModel] + CreateSecretResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_session.py b/src/tower/tower_api_client/api/default/create_session.py index 82bf7a01..e7d74a0c 100644 --- a/src/tower/tower_api_client/api/default/create_session.py +++ b/src/tower/tower_api_client/api/default/create_session.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_session_params import CreateSessionParams from ...models.create_session_response import CreateSessionResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/session", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateSessionResponse | ErrorModel: if response.status_code == 200: response_200 = CreateSessionResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateSessionResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -56,9 +55,9 @@ def _build_response( def sync_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateSessionParams, -) -> Response[CreateSessionResponse]: +) -> Response[CreateSessionResponse | ErrorModel]: """Create session Create a new session and return it. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateSessionResponse] + Response[CreateSessionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,9 +86,9 @@ def sync_detailed( def sync( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateSessionParams, -) -> Optional[CreateSessionResponse]: +) -> CreateSessionResponse | ErrorModel | None: """Create session Create a new session and return it. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateSessionResponse + CreateSessionResponse | ErrorModel """ return sync_detailed( @@ -113,9 +112,9 @@ def sync( async def asyncio_detailed( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateSessionParams, -) -> Response[CreateSessionResponse]: +) -> Response[CreateSessionResponse | ErrorModel]: """Create session Create a new session and return it. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateSessionResponse] + Response[CreateSessionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -142,9 +141,9 @@ async def asyncio_detailed( async def asyncio( *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: CreateSessionParams, -) -> Optional[CreateSessionResponse]: +) -> CreateSessionResponse | ErrorModel | None: """Create session Create a new session and return it. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateSessionResponse + CreateSessionResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_team.py b/src/tower/tower_api_client/api/default/create_team.py index 58ab0644..84ecd3d1 100644 --- a/src/tower/tower_api_client/api/default/create_team.py +++ b/src/tower/tower_api_client/api/default/create_team.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.create_team_params import CreateTeamParams from ...models.create_team_response import CreateTeamResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/teams", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[CreateTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateTeamResponse | ErrorModel: if response.status_code == 200: response_200 = CreateTeamResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[CreateTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateTeamResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateTeamParams, -) -> Response[CreateTeamResponse]: +) -> Response[CreateTeamResponse | ErrorModel]: """Create team Create a new team @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateTeamResponse] + Response[CreateTeamResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: CreateTeamParams, -) -> Optional[CreateTeamResponse]: +) -> CreateTeamResponse | ErrorModel | None: """Create team Create a new team @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateTeamResponse + CreateTeamResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateTeamParams, -) -> Response[CreateTeamResponse]: +) -> Response[CreateTeamResponse | ErrorModel]: """Create team Create a new team @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[CreateTeamResponse] + Response[CreateTeamResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateTeamParams, -) -> Optional[CreateTeamResponse]: +) -> CreateTeamResponse | ErrorModel | None: """Create team Create a new team @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - CreateTeamResponse + CreateTeamResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/create_webhook.py b/src/tower/tower_api_client/api/default/create_webhook.py new file mode 100644 index 00000000..d6b875d7 --- /dev/null +++ b/src/tower/tower_api_client/api/default/create_webhook.py @@ -0,0 +1,159 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.create_webhook_params import CreateWebhookParams +from ...models.create_webhook_response import CreateWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + *, + body: CreateWebhookParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/webhooks", + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> CreateWebhookResponse | ErrorModel: + if response.status_code == 201: + response_201 = CreateWebhookResponse.from_dict(response.json()) + + return response_201 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[CreateWebhookResponse | ErrorModel]: + 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: CreateWebhookParams, +) -> Response[CreateWebhookResponse | ErrorModel]: + """Create webhook + + Args: + body (CreateWebhookParams): + + 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[CreateWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> CreateWebhookResponse | ErrorModel | None: + """Create webhook + + Args: + body (CreateWebhookParams): + + 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: + CreateWebhookResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: CreateWebhookParams, +) -> Response[CreateWebhookResponse | ErrorModel]: + """Create webhook + + Args: + body (CreateWebhookParams): + + 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[CreateWebhookResponse | ErrorModel] + """ + + 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: CreateWebhookParams, +) -> CreateWebhookResponse | ErrorModel | None: + """Create webhook + + Args: + body (CreateWebhookParams): + + 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: + CreateWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/deactivate_schedules.py b/src/tower/tower_api_client/api/default/deactivate_schedules.py index d44dbe76..bddd15ad 100644 --- a/src/tower/tower_api_client/api/default/deactivate_schedules.py +++ b/src/tower/tower_api_client/api/default/deactivate_schedules.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.batch_schedule_params import BatchScheduleParams from ...models.batch_schedule_response import BatchScheduleResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/schedules/deactivate", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[BatchScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> BatchScheduleResponse | ErrorModel: if response.status_code == 200: response_200 = BatchScheduleResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[BatchScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[BatchScheduleResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Response[BatchScheduleResponse]: +) -> Response[BatchScheduleResponse | ErrorModel]: """Deactivate multiple schedules Deactivate multiple schedules to disable their execution. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BatchScheduleResponse] + Response[BatchScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Optional[BatchScheduleResponse]: +) -> BatchScheduleResponse | ErrorModel | None: """Deactivate multiple schedules Deactivate multiple schedules to disable their execution. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BatchScheduleResponse + BatchScheduleResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Response[BatchScheduleResponse]: +) -> Response[BatchScheduleResponse | ErrorModel]: """Deactivate multiple schedules Deactivate multiple schedules to disable their execution. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[BatchScheduleResponse] + Response[BatchScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BatchScheduleParams, -) -> Optional[BatchScheduleResponse]: +) -> BatchScheduleResponse | ErrorModel | None: """Deactivate multiple schedules Deactivate multiple schedules to disable their execution. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - BatchScheduleResponse + BatchScheduleResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_alert.py b/src/tower/tower_api_client/api/default/delete_alert.py index 0881d00c..0bc6152a 100644 --- a/src/tower/tower_api_client/api/default/delete_alert.py +++ b/src/tower/tower_api_client/api/default/delete_alert.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, cast +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...types import Response @@ -14,7 +15,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/alerts/{alert_id}".format( - alert_id=alert_id, + alert_id=quote(str(alert_id), safe=""), ), } @@ -22,19 +23,20 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Any]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorModel: if response.status_code == 204: - return None - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + response_204 = cast(Any, None) + return response_204 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Any]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -47,7 +49,7 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | ErrorModel]: """Delete alert Permanently delete an alert @@ -60,7 +62,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ErrorModel] """ kwargs = _get_kwargs( @@ -74,11 +76,37 @@ def sync_detailed( return _build_response(client=client, response=response) +def sync( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + 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 | ErrorModel + """ + + return sync_detailed( + alert_id=alert_id, + client=client, + ).parsed + + async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | ErrorModel]: """Delete alert Permanently delete an alert @@ -91,7 +119,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ErrorModel] """ kwargs = _get_kwargs( @@ -101,3 +129,31 @@ async def asyncio_detailed( response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + + +async def asyncio( + alert_id: str, + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Delete alert + + Permanently delete an alert + + Args: + alert_id (str): ID of the alert to delete + + 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 | ErrorModel + """ + + return ( + await asyncio_detailed( + alert_id=alert_id, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_api_key.py b/src/tower/tower_api_client/api/default/delete_api_key.py index 3774096d..b7670cf7 100644 --- a/src/tower/tower_api_client/api/default/delete_api_key.py +++ b/src/tower/tower_api_client/api/default/delete_api_key.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_api_key_params import DeleteAPIKeyParams from ...models.delete_api_key_response import DeleteAPIKeyResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/api-keys", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteAPIKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAPIKeyResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteAPIKeyResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteAPIKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAPIKeyResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: DeleteAPIKeyParams, -) -> Response[DeleteAPIKeyResponse]: +) -> Response[DeleteAPIKeyResponse | ErrorModel]: """Delete API key Args: @@ -69,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAPIKeyResponse] + Response[DeleteAPIKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,7 +86,7 @@ def sync( *, client: AuthenticatedClient, body: DeleteAPIKeyParams, -) -> Optional[DeleteAPIKeyResponse]: +) -> DeleteAPIKeyResponse | ErrorModel | None: """Delete API key Args: @@ -98,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAPIKeyResponse + DeleteAPIKeyResponse | ErrorModel """ return sync_detailed( @@ -111,7 +110,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: DeleteAPIKeyParams, -) -> Response[DeleteAPIKeyResponse]: +) -> Response[DeleteAPIKeyResponse | ErrorModel]: """Delete API key Args: @@ -122,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAPIKeyResponse] + Response[DeleteAPIKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -138,7 +137,7 @@ async def asyncio( *, client: AuthenticatedClient, body: DeleteAPIKeyParams, -) -> Optional[DeleteAPIKeyResponse]: +) -> DeleteAPIKeyResponse | ErrorModel | None: """Delete API key Args: @@ -149,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAPIKeyResponse + DeleteAPIKeyResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_app.py b/src/tower/tower_api_client/api/default/delete_app.py index ec3d0de6..6fcd2184 100644 --- a/src/tower/tower_api_client/api/default/delete_app.py +++ b/src/tower/tower_api_client/api/default/delete_app.py @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_app_response import DeleteAppResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/apps/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAppResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteAppResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAppResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[DeleteAppResponse]: +) -> Response[DeleteAppResponse | ErrorModel]: """Delete app Delete one of your apps, the associated code, and all the runs as well. @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAppResponse] + Response[DeleteAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[DeleteAppResponse]: +) -> DeleteAppResponse | ErrorModel | None: """Delete app Delete one of your apps, the associated code, and all the runs as well. @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAppResponse + DeleteAppResponse | ErrorModel """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[DeleteAppResponse]: +) -> Response[DeleteAppResponse | ErrorModel]: """Delete app Delete one of your apps, the associated code, and all the runs as well. @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAppResponse] + Response[DeleteAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[DeleteAppResponse]: +) -> DeleteAppResponse | ErrorModel | None: """Delete app Delete one of your apps, the associated code, and all the runs as well. @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAppResponse + DeleteAppResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_authenticator.py b/src/tower/tower_api_client/api/default/delete_authenticator.py index df504b6e..29997b88 100644 --- a/src/tower/tower_api_client/api/default/delete_authenticator.py +++ b/src/tower/tower_api_client/api/default/delete_authenticator.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_authenticator_params import DeleteAuthenticatorParams from ...models.delete_authenticator_response import DeleteAuthenticatorResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/authenticators", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteAuthenticatorResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteAuthenticatorResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteAuthenticatorResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: DeleteAuthenticatorParams, -) -> Response[DeleteAuthenticatorResponse]: +) -> Response[DeleteAuthenticatorResponse | ErrorModel]: """Delete authenticator Removes an authenticator from your account so you're no longer required to provide it at login. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAuthenticatorResponse] + Response[DeleteAuthenticatorResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: DeleteAuthenticatorParams, -) -> Optional[DeleteAuthenticatorResponse]: +) -> DeleteAuthenticatorResponse | ErrorModel | None: """Delete authenticator Removes an authenticator from your account so you're no longer required to provide it at login. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAuthenticatorResponse + DeleteAuthenticatorResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: DeleteAuthenticatorParams, -) -> Response[DeleteAuthenticatorResponse]: +) -> Response[DeleteAuthenticatorResponse | ErrorModel]: """Delete authenticator Removes an authenticator from your account so you're no longer required to provide it at login. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteAuthenticatorResponse] + Response[DeleteAuthenticatorResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: DeleteAuthenticatorParams, -) -> Optional[DeleteAuthenticatorResponse]: +) -> DeleteAuthenticatorResponse | ErrorModel | None: """Delete authenticator Removes an authenticator from your account so you're no longer required to provide it at login. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteAuthenticatorResponse + DeleteAuthenticatorResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_catalog.py b/src/tower/tower_api_client/api/default/delete_catalog.py index 64ac281b..3a967033 100644 --- a/src/tower/tower_api_client/api/default/delete_catalog.py +++ b/src/tower/tower_api_client/api/default/delete_catalog.py @@ -1,18 +1,19 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_catalog_response import DeleteCatalogResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset def _get_kwargs( name: str, *, - environment: Union[Unset, str] = "default", + environment: str | Unset = "default", ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -23,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/catalogs/{name}".format( - name=name, + name=quote(str(name), safe=""), ), "params": params, } @@ -32,21 +33,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteCatalogResponse | ErrorModel: if response.status_code == 204: response_204 = DeleteCatalogResponse.from_dict(response.json()) return response_204 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteCatalogResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,23 +60,22 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = "default", -) -> Response[DeleteCatalogResponse]: + environment: str | Unset = "default", +) -> Response[DeleteCatalogResponse | ErrorModel]: """Delete catalog Delete a new catalog object in the currently authenticated account. Args: name (str): The name of the catalog to update. - environment (Union[Unset, str]): The environment of the catalog to delete. Default: - 'default'. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. 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[DeleteCatalogResponse] + Response[DeleteCatalogResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -94,23 +94,22 @@ def sync( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = "default", -) -> Optional[DeleteCatalogResponse]: + environment: str | Unset = "default", +) -> DeleteCatalogResponse | ErrorModel | None: """Delete catalog Delete a new catalog object in the currently authenticated account. Args: name (str): The name of the catalog to update. - environment (Union[Unset, str]): The environment of the catalog to delete. Default: - 'default'. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. 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: - DeleteCatalogResponse + DeleteCatalogResponse | ErrorModel """ return sync_detailed( @@ -124,23 +123,22 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = "default", -) -> Response[DeleteCatalogResponse]: + environment: str | Unset = "default", +) -> Response[DeleteCatalogResponse | ErrorModel]: """Delete catalog Delete a new catalog object in the currently authenticated account. Args: name (str): The name of the catalog to update. - environment (Union[Unset, str]): The environment of the catalog to delete. Default: - 'default'. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. 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[DeleteCatalogResponse] + Response[DeleteCatalogResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -157,23 +155,22 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = "default", -) -> Optional[DeleteCatalogResponse]: + environment: str | Unset = "default", +) -> DeleteCatalogResponse | ErrorModel | None: """Delete catalog Delete a new catalog object in the currently authenticated account. Args: name (str): The name of the catalog to update. - environment (Union[Unset, str]): The environment of the catalog to delete. Default: - 'default'. + environment (str | Unset): The environment of the catalog to delete. Default: 'default'. 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: - DeleteCatalogResponse + DeleteCatalogResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_schedule.py b/src/tower/tower_api_client/api/default/delete_schedule.py index ffa13287..a1b0e9d2 100644 --- a/src/tower/tower_api_client/api/default/delete_schedule.py +++ b/src/tower/tower_api_client/api/default/delete_schedule.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_schedule_params import DeleteScheduleParams from ...models.delete_schedule_response import DeleteScheduleResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/schedules", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteScheduleResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteScheduleResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteScheduleResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: DeleteScheduleParams, -) -> Response[DeleteScheduleResponse]: +) -> Response[DeleteScheduleResponse | ErrorModel]: """Delete schedule Delete an existing schedule for an app. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteScheduleResponse] + Response[DeleteScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: DeleteScheduleParams, -) -> Optional[DeleteScheduleResponse]: +) -> DeleteScheduleResponse | ErrorModel | None: """Delete schedule Delete an existing schedule for an app. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteScheduleResponse + DeleteScheduleResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: DeleteScheduleParams, -) -> Response[DeleteScheduleResponse]: +) -> Response[DeleteScheduleResponse | ErrorModel]: """Delete schedule Delete an existing schedule for an app. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteScheduleResponse] + Response[DeleteScheduleResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: DeleteScheduleParams, -) -> Optional[DeleteScheduleResponse]: +) -> DeleteScheduleResponse | ErrorModel | None: """Delete schedule Delete an existing schedule for an app. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteScheduleResponse + DeleteScheduleResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_secret.py b/src/tower/tower_api_client/api/default/delete_secret.py index 20f7d4aa..3e0228f0 100644 --- a/src/tower/tower_api_client/api/default/delete_secret.py +++ b/src/tower/tower_api_client/api/default/delete_secret.py @@ -1,18 +1,19 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_secret_response import DeleteSecretResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset def _get_kwargs( name: str, *, - environment: Union[Unset, str] = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -23,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/secrets/{name}".format( - name=name, + name=quote(str(name), safe=""), ), "params": params, } @@ -32,21 +33,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteSecretResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteSecretResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteSecretResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteSecretResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteSecretResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,22 +60,22 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Response[DeleteSecretResponse]: + environment: str | Unset = UNSET, +) -> Response[DeleteSecretResponse | ErrorModel]: """Delete secret Delete a secret by name. Args: name (str): The name of the secret to delete. - environment (Union[Unset, str]): The environment of the secret to delete. + environment (str | Unset): The environment of the secret to delete. 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[DeleteSecretResponse] + Response[DeleteSecretResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -93,22 +94,22 @@ def sync( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Optional[DeleteSecretResponse]: + environment: str | Unset = UNSET, +) -> DeleteSecretResponse | ErrorModel | None: """Delete secret Delete a secret by name. Args: name (str): The name of the secret to delete. - environment (Union[Unset, str]): The environment of the secret to delete. + environment (str | Unset): The environment of the secret to delete. 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: - DeleteSecretResponse + DeleteSecretResponse | ErrorModel """ return sync_detailed( @@ -122,22 +123,22 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Response[DeleteSecretResponse]: + environment: str | Unset = UNSET, +) -> Response[DeleteSecretResponse | ErrorModel]: """Delete secret Delete a secret by name. Args: name (str): The name of the secret to delete. - environment (Union[Unset, str]): The environment of the secret to delete. + environment (str | Unset): The environment of the secret to delete. 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[DeleteSecretResponse] + Response[DeleteSecretResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -154,22 +155,22 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Optional[DeleteSecretResponse]: + environment: str | Unset = UNSET, +) -> DeleteSecretResponse | ErrorModel | None: """Delete secret Delete a secret by name. Args: name (str): The name of the secret to delete. - environment (Union[Unset, str]): The environment of the secret to delete. + environment (str | Unset): The environment of the secret to delete. 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: - DeleteSecretResponse + DeleteSecretResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_session.py b/src/tower/tower_api_client/api/default/delete_session.py new file mode 100644 index 00000000..388eb413 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_session.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_session_params import DeleteSessionParams +from ...models.delete_session_response import DeleteSessionResponse +from ...models.error_model import ErrorModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + body: DeleteSessionParams | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/session", + } + + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteSessionResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteSessionResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteSessionResponse | ErrorModel]: + 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: DeleteSessionParams | Unset = UNSET, +) -> Response[DeleteSessionResponse | ErrorModel]: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + 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[DeleteSessionResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> DeleteSessionResponse | ErrorModel | None: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + 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: + DeleteSessionResponse | ErrorModel + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: DeleteSessionParams | Unset = UNSET, +) -> Response[DeleteSessionResponse | ErrorModel]: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + 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[DeleteSessionResponse | ErrorModel] + """ + + 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: DeleteSessionParams | Unset = UNSET, +) -> DeleteSessionResponse | ErrorModel | None: + """Delete session + + Terminate a session and revoke the access keys associated with it. + + Args: + body (DeleteSessionParams | Unset): + + 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: + DeleteSessionResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/delete_team.py b/src/tower/tower_api_client/api/default/delete_team.py index 3fcee983..e3602c40 100644 --- a/src/tower/tower_api_client/api/default/delete_team.py +++ b/src/tower/tower_api_client/api/default/delete_team.py @@ -1,12 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_team_params import DeleteTeamParams from ...models.delete_team_response import DeleteTeamResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/teams", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteTeamResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteTeamResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteTeamResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: DeleteTeamParams, -) -> Response[DeleteTeamResponse]: +) -> Response[DeleteTeamResponse | ErrorModel]: """Delete team Delete a new team @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteTeamResponse] + Response[DeleteTeamResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: DeleteTeamParams, -) -> Optional[DeleteTeamResponse]: +) -> DeleteTeamResponse | ErrorModel | None: """Delete team Delete a new team @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteTeamResponse + DeleteTeamResponse | ErrorModel """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: DeleteTeamParams, -) -> Response[DeleteTeamResponse]: +) -> Response[DeleteTeamResponse | ErrorModel]: """Delete team Delete a new team @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteTeamResponse] + Response[DeleteTeamResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: DeleteTeamParams, -) -> Optional[DeleteTeamResponse]: +) -> DeleteTeamResponse | ErrorModel | None: """Delete team Delete a new team @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteTeamResponse + DeleteTeamResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_team_invitation.py b/src/tower/tower_api_client/api/default/delete_team_invitation.py index 7b2d1511..82868305 100644 --- a/src/tower/tower_api_client/api/default/delete_team_invitation.py +++ b/src/tower/tower_api_client/api/default/delete_team_invitation.py @@ -1,12 +1,13 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.delete_team_invitation_params import DeleteTeamInvitationParams from ...models.delete_team_invitation_response import DeleteTeamInvitationResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/teams/{name}/invites".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DeleteTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteTeamInvitationResponse | ErrorModel: if response.status_code == 200: response_200 = DeleteTeamInvitationResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DeleteTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: DeleteTeamInvitationParams, -) -> Response[DeleteTeamInvitationResponse]: +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: """Delete team invitation Delete a pending team invitation that you have previously sent @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteTeamInvitationResponse] + Response[DeleteTeamInvitationResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: DeleteTeamInvitationParams, -) -> Optional[DeleteTeamInvitationResponse]: +) -> DeleteTeamInvitationResponse | ErrorModel | None: """Delete team invitation Delete a pending team invitation that you have previously sent @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteTeamInvitationResponse + DeleteTeamInvitationResponse | ErrorModel """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: DeleteTeamInvitationParams, -) -> Response[DeleteTeamInvitationResponse]: +) -> Response[DeleteTeamInvitationResponse | ErrorModel]: """Delete team invitation Delete a pending team invitation that you have previously sent @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DeleteTeamInvitationResponse] + Response[DeleteTeamInvitationResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: DeleteTeamInvitationParams, -) -> Optional[DeleteTeamInvitationResponse]: +) -> DeleteTeamInvitationResponse | ErrorModel | None: """Delete team invitation Delete a pending team invitation that you have previously sent @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DeleteTeamInvitationResponse + DeleteTeamInvitationResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/delete_webhook.py b/src/tower/tower_api_client/api/default/delete_webhook.py new file mode 100644 index 00000000..5d5ca282 --- /dev/null +++ b/src/tower/tower_api_client/api/default/delete_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.delete_webhook_response import DeleteWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/webhooks/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeleteWebhookResponse | ErrorModel: + if response.status_code == 200: + response_200 = DeleteWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeleteWebhookResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteWebhookResponse | ErrorModel]: + """Delete webhook + + Args: + name (str): The name of the webhook. + + 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[DeleteWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteWebhookResponse | ErrorModel | None: + """Delete webhook + + Args: + name (str): The name of the webhook. + + 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: + DeleteWebhookResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DeleteWebhookResponse | ErrorModel]: + """Delete webhook + + Args: + name (str): The name of the webhook. + + 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[DeleteWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DeleteWebhookResponse | ErrorModel | None: + """Delete webhook + + Args: + name (str): The name of the webhook. + + 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: + DeleteWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/deploy_app.py b/src/tower/tower_api_client/api/default/deploy_app.py index d67fca3c..902a7b34 100644 --- a/src/tower/tower_api_client/api/default/deploy_app.py +++ b/src/tower/tower_api_client/api/default/deploy_app.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx @@ -14,32 +15,31 @@ def _get_kwargs( name: str, *, - body: Union[ - DeployAppJsonBody, - File, - ], - x_tower_checksum_sha256: Union[Unset, str] = UNSET, + body: DeployAppJsonBody | File | Unset = UNSET, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} if not isinstance(x_tower_checksum_sha256, Unset): headers["X-Tower-Checksum-SHA256"] = x_tower_checksum_sha256 + if not isinstance(content_length, Unset): + headers["Content-Length"] = str(content_length) + _kwargs: dict[str, Any] = { "method": "post", "url": "/apps/{name}/deploy".format( - name=name, + name=quote(str(name), safe=""), ), } if isinstance(body, DeployAppJsonBody): - _json_body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _json_body headers["Content-Type"] = "application/json" if isinstance(body, File): - _content_body = body.payload + _kwargs["content"] = body.payload - _kwargs["content"] = _content_body headers["Content-Type"] = "application/octet-stream" _kwargs["headers"] = headers @@ -47,24 +47,28 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DeployAppResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DeployAppResponse | ErrorModel | None: if response.status_code == 201: response_201 = DeployAppResponse.from_dict(response.json()) return response_201 + if response.status_code == 400: response_400 = ErrorModel.from_dict(response.json()) return response_400 + if response.status_code == 422: response_422 = ErrorModel.from_dict(response.json()) return response_422 + if response.status_code == 500: response_500 = ErrorModel.from_dict(response.json()) return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -72,8 +76,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DeployAppResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DeployAppResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,12 +90,10 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - body: Union[ - DeployAppJsonBody, - File, - ], - x_tower_checksum_sha256: Union[Unset, str] = UNSET, -) -> Response[Union[DeployAppResponse, ErrorModel]]: + body: DeployAppJsonBody | File | Unset = UNSET, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> Response[DeployAppResponse | ErrorModel]: """Deploy app Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body @@ -99,8 +101,9 @@ def sync_detailed( Args: name (str): The name of the app to deploy. - x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to - verify integrity. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- examples/tree/main/01-hello-world'}. body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: @@ -111,13 +114,14 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DeployAppResponse, ErrorModel]] + Response[DeployAppResponse | ErrorModel] """ kwargs = _get_kwargs( name=name, body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, ) response = client.get_httpx_client().request( @@ -131,12 +135,10 @@ def sync( name: str, *, client: AuthenticatedClient, - body: Union[ - DeployAppJsonBody, - File, - ], - x_tower_checksum_sha256: Union[Unset, str] = UNSET, -) -> Optional[Union[DeployAppResponse, ErrorModel]]: + body: DeployAppJsonBody | File | Unset = UNSET, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> DeployAppResponse | ErrorModel | None: """Deploy app Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body @@ -144,8 +146,9 @@ def sync( Args: name (str): The name of the app to deploy. - x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to - verify integrity. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- examples/tree/main/01-hello-world'}. body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: @@ -156,7 +159,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DeployAppResponse, ErrorModel] + DeployAppResponse | ErrorModel """ return sync_detailed( @@ -164,6 +167,7 @@ def sync( client=client, body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, ).parsed @@ -171,12 +175,10 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - body: Union[ - DeployAppJsonBody, - File, - ], - x_tower_checksum_sha256: Union[Unset, str] = UNSET, -) -> Response[Union[DeployAppResponse, ErrorModel]]: + body: DeployAppJsonBody | File | Unset = UNSET, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> Response[DeployAppResponse | ErrorModel]: """Deploy app Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body @@ -184,8 +186,9 @@ async def asyncio_detailed( Args: name (str): The name of the app to deploy. - x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to - verify integrity. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- examples/tree/main/01-hello-world'}. body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: @@ -196,13 +199,14 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DeployAppResponse, ErrorModel]] + Response[DeployAppResponse | ErrorModel] """ kwargs = _get_kwargs( name=name, body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -214,12 +218,10 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - body: Union[ - DeployAppJsonBody, - File, - ], - x_tower_checksum_sha256: Union[Unset, str] = UNSET, -) -> Optional[Union[DeployAppResponse, ErrorModel]]: + body: DeployAppJsonBody | File | Unset = UNSET, + x_tower_checksum_sha256: str | Unset = UNSET, + content_length: int | Unset = UNSET, +) -> DeployAppResponse | ErrorModel | None: """Deploy app Deploy a new version of an app. Accepts either a TAR file upload (application/tar) or a JSON body @@ -227,8 +229,9 @@ async def asyncio( Args: name (str): The name of the app to deploy. - x_tower_checksum_sha256 (Union[Unset, str]): The SHA256 hash of the content, used to - verify integrity. + x_tower_checksum_sha256 (str | Unset): The SHA256 hash of the content, used to verify + integrity. + content_length (int | Unset): Size of the uploaded bundle in bytes. body (DeployAppJsonBody): Example: {'source_uri': 'https://github.com/tower/tower- examples/tree/main/01-hello-world'}. body (File): A .tar or .tar.gz file containing the code to deploy and MANIFEST Example: @@ -239,7 +242,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DeployAppResponse, ErrorModel] + DeployAppResponse | ErrorModel """ return ( @@ -248,5 +251,6 @@ async def asyncio( client=client, body=body, x_tower_checksum_sha256=x_tower_checksum_sha256, + content_length=content_length, ) ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_account.py b/src/tower/tower_api_client/api/default/describe_account.py index a223552a..67354661 100644 --- a/src/tower/tower_api_client/api/default/describe_account.py +++ b/src/tower/tower_api_client/api/default/describe_account.py @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_account_body import DescribeAccountBody +from ...models.error_model import ErrorModel from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/accounts/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeAccountBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAccountBody | ErrorModel: if response.status_code == 200: response_200 = DescribeAccountBody.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeAccountBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAccountBody | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[DescribeAccountBody]: +) -> Response[DescribeAccountBody | ErrorModel]: """Describe account Get information about a specific account by name. @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeAccountBody] + Response[DescribeAccountBody | ErrorModel] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[DescribeAccountBody]: +) -> DescribeAccountBody | ErrorModel | None: """Describe account Get information about a specific account by name. @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeAccountBody + DescribeAccountBody | ErrorModel """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[DescribeAccountBody]: +) -> Response[DescribeAccountBody | ErrorModel]: """Describe account Get information about a specific account by name. @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeAccountBody] + Response[DescribeAccountBody | ErrorModel] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[DescribeAccountBody]: +) -> DescribeAccountBody | ErrorModel | None: """Describe account Get information about a specific account by name. @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeAccountBody + DescribeAccountBody | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_app.py b/src/tower/tower_api_client/api/default/describe_app.py index ffb746d4..c9561e96 100644 --- a/src/tower/tower_api_client/api/default/describe_app.py +++ b/src/tower/tower_api_client/api/default/describe_app.py @@ -1,33 +1,34 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_app_response import DescribeAppResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset def _get_kwargs( name: str, *, - runs: Union[Unset, int] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - timezone: Union[Unset, str] = "UTC", + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", ) -> dict[str, Any]: params: dict[str, Any] = {} params["runs"] = runs - json_start_at: Union[Unset, str] = UNSET + json_start_at: str | Unset = UNSET if not isinstance(start_at, Unset): json_start_at = start_at.isoformat() params["start_at"] = json_start_at - json_end_at: Union[Unset, str] = UNSET + json_end_at: str | Unset = UNSET if not isinstance(end_at, Unset): json_end_at = end_at.isoformat() params["end_at"] = json_end_at @@ -39,7 +40,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}".format( - name=name, + name=quote(str(name), safe=""), ), "params": params, } @@ -48,21 +49,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAppResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeAppResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAppResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,31 +76,31 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - runs: Union[Unset, int] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - timezone: Union[Unset, str] = "UTC", -) -> Response[DescribeAppResponse]: + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> Response[DescribeAppResponse | ErrorModel]: """Describe app Get all the runs for the current account. Args: name (str): The name of the app to fetch. - runs (Union[Unset, int]): The number of recent runs to fetch for the app. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. 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[DescribeAppResponse] + Response[DescribeAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -121,31 +122,31 @@ def sync( name: str, *, client: AuthenticatedClient, - runs: Union[Unset, int] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - timezone: Union[Unset, str] = "UTC", -) -> Optional[DescribeAppResponse]: + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> DescribeAppResponse | ErrorModel | None: """Describe app Get all the runs for the current account. Args: name (str): The name of the app to fetch. - runs (Union[Unset, int]): The number of recent runs to fetch for the app. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. 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: - DescribeAppResponse + DescribeAppResponse | ErrorModel """ return sync_detailed( @@ -162,31 +163,31 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - runs: Union[Unset, int] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - timezone: Union[Unset, str] = "UTC", -) -> Response[DescribeAppResponse]: + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> Response[DescribeAppResponse | ErrorModel]: """Describe app Get all the runs for the current account. Args: name (str): The name of the app to fetch. - runs (Union[Unset, int]): The number of recent runs to fetch for the app. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. 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[DescribeAppResponse] + Response[DescribeAppResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -206,31 +207,31 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - runs: Union[Unset, int] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - timezone: Union[Unset, str] = "UTC", -) -> Optional[DescribeAppResponse]: + runs: int | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + timezone: str | Unset = "UTC", +) -> DescribeAppResponse | ErrorModel | None: """Describe app Get all the runs for the current account. Args: name (str): The name of the app to fetch. - runs (Union[Unset, int]): The number of recent runs to fetch for the app. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + runs (int | Unset): The number of recent runs to fetch for the app. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. 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: - DescribeAppResponse + DescribeAppResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_app_version.py b/src/tower/tower_api_client/api/default/describe_app_version.py index 87d46540..88d8c45e 100644 --- a/src/tower/tower_api_client/api/default/describe_app_version.py +++ b/src/tower/tower_api_client/api/default/describe_app_version.py @@ -1,11 +1,12 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_app_version_response import DescribeAppVersionResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -16,8 +17,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/versions/{num}".format( - name=name, - num=num, + name=quote(str(name), safe=""), + num=quote(str(num), safe=""), ), } @@ -25,21 +26,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeAppVersionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAppVersionResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeAppVersionResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeAppVersionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAppVersionResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -53,7 +54,7 @@ def sync_detailed( num: str, *, client: AuthenticatedClient, -) -> Response[DescribeAppVersionResponse]: +) -> Response[DescribeAppVersionResponse | ErrorModel]: """Describe app version Describe an app version for an app in the current account. @@ -67,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeAppVersionResponse] + Response[DescribeAppVersionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,7 +88,7 @@ def sync( num: str, *, client: AuthenticatedClient, -) -> Optional[DescribeAppVersionResponse]: +) -> DescribeAppVersionResponse | ErrorModel | None: """Describe app version Describe an app version for an app in the current account. @@ -101,7 +102,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeAppVersionResponse + DescribeAppVersionResponse | ErrorModel """ return sync_detailed( @@ -116,7 +117,7 @@ async def asyncio_detailed( num: str, *, client: AuthenticatedClient, -) -> Response[DescribeAppVersionResponse]: +) -> Response[DescribeAppVersionResponse | ErrorModel]: """Describe app version Describe an app version for an app in the current account. @@ -130,7 +131,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeAppVersionResponse] + Response[DescribeAppVersionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -148,7 +149,7 @@ async def asyncio( num: str, *, client: AuthenticatedClient, -) -> Optional[DescribeAppVersionResponse]: +) -> DescribeAppVersionResponse | ErrorModel | None: """Describe app version Describe an app version for an app in the current account. @@ -162,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeAppVersionResponse + DescribeAppVersionResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_authentication_context.py b/src/tower/tower_api_client/api/default/describe_authentication_context.py new file mode 100644 index 00000000..be67bb9b --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_authentication_context.py @@ -0,0 +1,140 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_authentication_context_body import ( + DescribeAuthenticationContextBody, +) +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/user/auth-context", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeAuthenticationContextBody | ErrorModel: + if response.status_code == 200: + response_200 = DescribeAuthenticationContextBody.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeAuthenticationContextBody | ErrorModel]: + 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[DescribeAuthenticationContextBody | ErrorModel]: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + 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[DescribeAuthenticationContextBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> DescribeAuthenticationContextBody | ErrorModel | None: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + 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: + DescribeAuthenticationContextBody | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[DescribeAuthenticationContextBody | ErrorModel]: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + 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[DescribeAuthenticationContextBody | ErrorModel] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> DescribeAuthenticationContextBody | ErrorModel | None: + """Describe authentication context + + This API endpoint returns information about the current authentication context for the user that's + used for various internal processes in Tower UI. + + 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: + DescribeAuthenticationContextBody | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_device_login_session.py b/src/tower/tower_api_client/api/default/describe_device_login_session.py index a708bf19..500b35d1 100644 --- a/src/tower/tower_api_client/api/default/describe_device_login_session.py +++ b/src/tower/tower_api_client/api/default/describe_device_login_session.py @@ -1,13 +1,14 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_device_login_session_response import ( DescribeDeviceLoginSessionResponse, ) +from ...models.error_model import ErrorModel from ...types import Response @@ -17,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/login/device/{device_code}".format( - device_code=device_code, + device_code=quote(str(device_code), safe=""), ), } @@ -25,21 +26,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeDeviceLoginSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeDeviceLoginSessionResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeDeviceLoginSessionResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeDeviceLoginSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -51,8 +52,8 @@ def _build_response( def sync_detailed( device_code: str, *, - client: Union[AuthenticatedClient, Client], -) -> Response[DescribeDeviceLoginSessionResponse]: + client: AuthenticatedClient | Client, +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: """Describe device login session Checks if a device login code has been claimed and returns the user session if so. @@ -65,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeDeviceLoginSessionResponse] + Response[DescribeDeviceLoginSessionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -82,8 +83,8 @@ def sync_detailed( def sync( device_code: str, *, - client: Union[AuthenticatedClient, Client], -) -> Optional[DescribeDeviceLoginSessionResponse]: + client: AuthenticatedClient | Client, +) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: """Describe device login session Checks if a device login code has been claimed and returns the user session if so. @@ -96,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeDeviceLoginSessionResponse + DescribeDeviceLoginSessionResponse | ErrorModel """ return sync_detailed( @@ -108,8 +109,8 @@ def sync( async def asyncio_detailed( device_code: str, *, - client: Union[AuthenticatedClient, Client], -) -> Response[DescribeDeviceLoginSessionResponse]: + client: AuthenticatedClient | Client, +) -> Response[DescribeDeviceLoginSessionResponse | ErrorModel]: """Describe device login session Checks if a device login code has been claimed and returns the user session if so. @@ -122,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeDeviceLoginSessionResponse] + Response[DescribeDeviceLoginSessionResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -137,8 +138,8 @@ async def asyncio_detailed( async def asyncio( device_code: str, *, - client: Union[AuthenticatedClient, Client], -) -> Optional[DescribeDeviceLoginSessionResponse]: + client: AuthenticatedClient | Client, +) -> DescribeDeviceLoginSessionResponse | ErrorModel | None: """Describe device login session Checks if a device login code has been claimed and returns the user session if so. @@ -151,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeDeviceLoginSessionResponse + DescribeDeviceLoginSessionResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_email_preferences.py b/src/tower/tower_api_client/api/default/describe_email_preferences.py index 4b6c1716..aa842aac 100644 --- a/src/tower/tower_api_client/api/default/describe_email_preferences.py +++ b/src/tower/tower_api_client/api/default/describe_email_preferences.py @@ -1,11 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_email_preferences_body import DescribeEmailPreferencesBody +from ...models.error_model import ErrorModel from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeEmailPreferencesBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeEmailPreferencesBody | ErrorModel: if response.status_code == 200: response_200 = DescribeEmailPreferencesBody.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeEmailPreferencesBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[DescribeEmailPreferencesBody]: +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: """Describe email preferences Describes the current user's email preferences. @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeEmailPreferencesBody] + Response[DescribeEmailPreferencesBody | ErrorModel] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[DescribeEmailPreferencesBody]: +) -> DescribeEmailPreferencesBody | ErrorModel | None: """Describe email preferences Describes the current user's email preferences. @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeEmailPreferencesBody + DescribeEmailPreferencesBody | ErrorModel """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[DescribeEmailPreferencesBody]: +) -> Response[DescribeEmailPreferencesBody | ErrorModel]: """Describe email preferences Describes the current user's email preferences. @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeEmailPreferencesBody] + Response[DescribeEmailPreferencesBody | ErrorModel] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[DescribeEmailPreferencesBody]: +) -> DescribeEmailPreferencesBody | ErrorModel | None: """Describe email preferences Describes the current user's email preferences. @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeEmailPreferencesBody + DescribeEmailPreferencesBody | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/list_plans.py b/src/tower/tower_api_client/api/default/describe_plan.py similarity index 54% rename from src/tower/tower_api_client/api/default/list_plans.py rename to src/tower/tower_api_client/api/default/describe_plan.py index 53a91914..1648caad 100644 --- a/src/tower/tower_api_client/api/default/list_plans.py +++ b/src/tower/tower_api_client/api/default/describe_plan.py @@ -1,18 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client -from ...models.list_account_plans_response import ListAccountPlansResponse +from ...models.describe_plan_response import DescribePlanResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, + page: int | Unset = 1, + page_size: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -24,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/plans", + "url": "/plan", "params": params, } @@ -32,21 +32,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAccountPlansResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribePlanResponse | ErrorModel: if response.status_code == 200: - response_200 = ListAccountPlansResponse.from_dict(response.json()) + response_200 = DescribePlanResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAccountPlansResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribePlanResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,23 +58,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListAccountPlansResponse]: - """List account plans + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[DescribePlanResponse | ErrorModel]: + """Describe plan - List active and past account plans for the current account. + Get the current plan for the account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListAccountPlansResponse] + Response[DescribePlanResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -92,23 +92,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListAccountPlansResponse]: - """List account plans + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> DescribePlanResponse | ErrorModel | None: + """Describe plan - List active and past account plans for the current account. + Get the current plan for the account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListAccountPlansResponse + DescribePlanResponse | ErrorModel """ return sync_detailed( @@ -121,23 +121,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListAccountPlansResponse]: - """List account plans + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[DescribePlanResponse | ErrorModel]: + """Describe plan - List active and past account plans for the current account. + Get the current plan for the account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListAccountPlansResponse] + Response[DescribePlanResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -153,23 +153,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListAccountPlansResponse]: - """List account plans + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> DescribePlanResponse | ErrorModel | None: + """Describe plan - List active and past account plans for the current account. + Get the current plan for the account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListAccountPlansResponse + DescribePlanResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_run.py b/src/tower/tower_api_client/api/default/describe_run.py index c29f1532..7b8ef617 100644 --- a/src/tower/tower_api_client/api/default/describe_run.py +++ b/src/tower/tower_api_client/api/default/describe_run.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx @@ -17,8 +18,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/runs/{seq}".format( - name=name, - seq=seq, + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), ), } @@ -26,20 +27,23 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DescribeRunResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunResponse | ErrorModel | None: if response.status_code == 200: response_200 = DescribeRunResponse.from_dict(response.json()) return response_200 + if response.status_code == 401: response_401 = ErrorModel.from_dict(response.json()) return response_401 + if response.status_code == 404: response_404 = ErrorModel.from_dict(response.json()) return response_404 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -47,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DescribeRunResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +66,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[Union[DescribeRunResponse, ErrorModel]]: +) -> Response[DescribeRunResponse | ErrorModel]: """Describe run Describe a run of an app. @@ -76,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DescribeRunResponse, ErrorModel]] + Response[DescribeRunResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -96,7 +100,7 @@ def sync( seq: int, *, client: AuthenticatedClient, -) -> Optional[Union[DescribeRunResponse, ErrorModel]]: +) -> DescribeRunResponse | ErrorModel | None: """Describe run Describe a run of an app. @@ -110,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DescribeRunResponse, ErrorModel] + DescribeRunResponse | ErrorModel """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[Union[DescribeRunResponse, ErrorModel]]: +) -> Response[DescribeRunResponse | ErrorModel]: """Describe run Describe a run of an app. @@ -139,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DescribeRunResponse, ErrorModel]] + Response[DescribeRunResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -157,7 +161,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, -) -> Optional[Union[DescribeRunResponse, ErrorModel]]: +) -> DescribeRunResponse | ErrorModel | None: """Describe run Describe a run of an app. @@ -171,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DescribeRunResponse, ErrorModel] + DescribeRunResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_run_graph.py b/src/tower/tower_api_client/api/default/describe_run_graph.py index b1756a29..f12583be 100644 --- a/src/tower/tower_api_client/api/default/describe_run_graph.py +++ b/src/tower/tower_api_client/api/default/describe_run_graph.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx @@ -17,8 +18,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/runs/{seq}/graph".format( - name=name, - seq=seq, + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), ), } @@ -26,20 +27,23 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunGraphResponse | ErrorModel | None: if response.status_code == 200: response_200 = DescribeRunGraphResponse.from_dict(response.json()) return response_200 + if response.status_code == 401: response_401 = ErrorModel.from_dict(response.json()) return response_401 + if response.status_code == 404: response_404 = ErrorModel.from_dict(response.json()) return response_404 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -47,8 +51,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[DescribeRunGraphResponse, ErrorModel]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunGraphResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +66,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[Union[DescribeRunGraphResponse, ErrorModel]]: +) -> Response[DescribeRunGraphResponse | ErrorModel]: """Describe run graph Describe the graph that a run belongs to. @@ -76,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DescribeRunGraphResponse, ErrorModel]] + Response[DescribeRunGraphResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -96,7 +100,7 @@ def sync( seq: int, *, client: AuthenticatedClient, -) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: +) -> DescribeRunGraphResponse | ErrorModel | None: """Describe run graph Describe the graph that a run belongs to. @@ -110,7 +114,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DescribeRunGraphResponse, ErrorModel] + DescribeRunGraphResponse | ErrorModel """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[Union[DescribeRunGraphResponse, ErrorModel]]: +) -> Response[DescribeRunGraphResponse | ErrorModel]: """Describe run graph Describe the graph that a run belongs to. @@ -139,7 +143,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DescribeRunGraphResponse, ErrorModel]] + Response[DescribeRunGraphResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -157,7 +161,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, -) -> Optional[Union[DescribeRunGraphResponse, ErrorModel]]: +) -> DescribeRunGraphResponse | ErrorModel | None: """Describe run graph Describe the graph that a run belongs to. @@ -171,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DescribeRunGraphResponse, ErrorModel] + DescribeRunGraphResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_run_logs.py b/src/tower/tower_api_client/api/default/describe_run_logs.py index 059188db..0d205fdf 100644 --- a/src/tower/tower_api_client/api/default/describe_run_logs.py +++ b/src/tower/tower_api_client/api/default/describe_run_logs.py @@ -1,12 +1,13 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_run_logs_response import DescribeRunLogsResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset @@ -14,11 +15,11 @@ def _get_kwargs( name: str, seq: int, *, - start_at: Union[Unset, datetime.datetime] = UNSET, + start_at: datetime.datetime | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_start_at: Union[Unset, str] = UNSET + json_start_at: str | Unset = UNSET if not isinstance(start_at, Unset): json_start_at = start_at.isoformat() params["start_at"] = json_start_at @@ -28,8 +29,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/runs/{seq}/logs".format( - name=name, - seq=seq, + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), ), "params": params, } @@ -38,21 +39,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeRunLogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeRunLogsResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeRunLogsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeRunLogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeRunLogsResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,8 +67,8 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, - start_at: Union[Unset, datetime.datetime] = UNSET, -) -> Response[DescribeRunLogsResponse]: + start_at: datetime.datetime | Unset = UNSET, +) -> Response[DescribeRunLogsResponse | ErrorModel]: """Describe run logs Retrieves the logs associated with a particular run of an app. @@ -75,15 +76,14 @@ def sync_detailed( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. - start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards - (inclusive). + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). 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[DescribeRunLogsResponse] + Response[DescribeRunLogsResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -104,8 +104,8 @@ def sync( seq: int, *, client: AuthenticatedClient, - start_at: Union[Unset, datetime.datetime] = UNSET, -) -> Optional[DescribeRunLogsResponse]: + start_at: datetime.datetime | Unset = UNSET, +) -> DescribeRunLogsResponse | ErrorModel | None: """Describe run logs Retrieves the logs associated with a particular run of an app. @@ -113,15 +113,14 @@ def sync( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. - start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards - (inclusive). + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). 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: - DescribeRunLogsResponse + DescribeRunLogsResponse | ErrorModel """ return sync_detailed( @@ -137,8 +136,8 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, - start_at: Union[Unset, datetime.datetime] = UNSET, -) -> Response[DescribeRunLogsResponse]: + start_at: datetime.datetime | Unset = UNSET, +) -> Response[DescribeRunLogsResponse | ErrorModel]: """Describe run logs Retrieves the logs associated with a particular run of an app. @@ -146,15 +145,14 @@ async def asyncio_detailed( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. - start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards - (inclusive). + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). 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[DescribeRunLogsResponse] + Response[DescribeRunLogsResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -173,8 +171,8 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, - start_at: Union[Unset, datetime.datetime] = UNSET, -) -> Optional[DescribeRunLogsResponse]: + start_at: datetime.datetime | Unset = UNSET, +) -> DescribeRunLogsResponse | ErrorModel | None: """Describe run logs Retrieves the logs associated with a particular run of an app. @@ -182,15 +180,14 @@ async def asyncio( Args: name (str): The name of the app to get logs for. seq (int): The sequence number of the run to get logs for. - start_at (Union[Unset, datetime.datetime]): Fetch logs from this timestamp onwards - (inclusive). + start_at (datetime.datetime | Unset): Fetch logs from this timestamp onwards (inclusive). 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: - DescribeRunLogsResponse + DescribeRunLogsResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_secrets_key.py b/src/tower/tower_api_client/api/default/describe_secrets_key.py index 65e6fa0d..cf2a3e8e 100644 --- a/src/tower/tower_api_client/api/default/describe_secrets_key.py +++ b/src/tower/tower_api_client/api/default/describe_secrets_key.py @@ -1,17 +1,17 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_secrets_key_response import DescribeSecretsKeyResponse +from ...models.error_model import ErrorModel from ...types import UNSET, Response, Unset def _get_kwargs( *, - format_: Union[Unset, str] = UNSET, + format_: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -29,21 +29,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeSecretsKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeSecretsKeyResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeSecretsKeyResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeSecretsKeyResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,22 +55,21 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - format_: Union[Unset, str] = UNSET, -) -> Response[DescribeSecretsKeyResponse]: + format_: str | Unset = UNSET, +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: """Describe encryption key Gets the encryption key used for encrypting secrets that you want to create in Tower. Args: - format_ (Union[Unset, str]): The format to return the key in. Options are 'pkcs1' and - 'spki'. + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. 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[DescribeSecretsKeyResponse] + Response[DescribeSecretsKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -87,22 +86,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - format_: Union[Unset, str] = UNSET, -) -> Optional[DescribeSecretsKeyResponse]: + format_: str | Unset = UNSET, +) -> DescribeSecretsKeyResponse | ErrorModel | None: """Describe encryption key Gets the encryption key used for encrypting secrets that you want to create in Tower. Args: - format_ (Union[Unset, str]): The format to return the key in. Options are 'pkcs1' and - 'spki'. + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. 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: - DescribeSecretsKeyResponse + DescribeSecretsKeyResponse | ErrorModel """ return sync_detailed( @@ -114,22 +112,21 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - format_: Union[Unset, str] = UNSET, -) -> Response[DescribeSecretsKeyResponse]: + format_: str | Unset = UNSET, +) -> Response[DescribeSecretsKeyResponse | ErrorModel]: """Describe encryption key Gets the encryption key used for encrypting secrets that you want to create in Tower. Args: - format_ (Union[Unset, str]): The format to return the key in. Options are 'pkcs1' and - 'spki'. + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. 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[DescribeSecretsKeyResponse] + Response[DescribeSecretsKeyResponse | ErrorModel] """ kwargs = _get_kwargs( @@ -144,22 +141,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - format_: Union[Unset, str] = UNSET, -) -> Optional[DescribeSecretsKeyResponse]: + format_: str | Unset = UNSET, +) -> DescribeSecretsKeyResponse | ErrorModel | None: """Describe encryption key Gets the encryption key used for encrypting secrets that you want to create in Tower. Args: - format_ (Union[Unset, str]): The format to return the key in. Options are 'pkcs1' and - 'spki'. + format_ (str | Unset): The format to return the key in. Options are 'pkcs1' and 'spki'. 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: - DescribeSecretsKeyResponse + DescribeSecretsKeyResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_session.py b/src/tower/tower_api_client/api/default/describe_session.py index 1e750f64..c050a314 100644 --- a/src/tower/tower_api_client/api/default/describe_session.py +++ b/src/tower/tower_api_client/api/default/describe_session.py @@ -1,11 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client from ...models.describe_session_response import DescribeSessionResponse +from ...models.error_model import ErrorModel from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[DescribeSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeSessionResponse | ErrorModel: if response.status_code == 200: response_200 = DescribeSessionResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[DescribeSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeSessionResponse | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[DescribeSessionResponse]: +) -> Response[DescribeSessionResponse | ErrorModel]: """Describe session Validate your current session and return the user information associated with the session. @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeSessionResponse] + Response[DescribeSessionResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[DescribeSessionResponse]: +) -> DescribeSessionResponse | ErrorModel | None: """Describe session Validate your current session and return the user information associated with the session. @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeSessionResponse + DescribeSessionResponse | ErrorModel """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[DescribeSessionResponse]: +) -> Response[DescribeSessionResponse | ErrorModel]: """Describe session Validate your current session and return the user information associated with the session. @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[DescribeSessionResponse] + Response[DescribeSessionResponse | ErrorModel] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[DescribeSessionResponse]: +) -> DescribeSessionResponse | ErrorModel | None: """Describe session Validate your current session and return the user information associated with the session. @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - DescribeSessionResponse + DescribeSessionResponse | ErrorModel """ return ( diff --git a/src/tower/tower_api_client/api/default/describe_team.py b/src/tower/tower_api_client/api/default/describe_team.py new file mode 100644 index 00000000..83ae525c --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_team.py @@ -0,0 +1,161 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_team_response import DescribeTeamResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/teams/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeTeamResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeTeamResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeTeamResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeTeamResponse | ErrorModel]: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + 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[DescribeTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeTeamResponse | ErrorModel | None: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + 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: + DescribeTeamResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeTeamResponse | ErrorModel]: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + 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[DescribeTeamResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeTeamResponse | ErrorModel | None: + """Describe team + + Get details about a team, including its members and invitations. + + Args: + name (str): The name of the team to fetch. + + 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: + DescribeTeamResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/describe_webhook.py b/src/tower/tower_api_client/api/default/describe_webhook.py new file mode 100644 index 00000000..43ec17a1 --- /dev/null +++ b/src/tower/tower_api_client/api/default/describe_webhook.py @@ -0,0 +1,153 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.describe_webhook_response import DescribeWebhookResponse +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + name: str, +) -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/webhooks/{name}".format( + name=quote(str(name), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> DescribeWebhookResponse | ErrorModel: + if response.status_code == 200: + response_200 = DescribeWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[DescribeWebhookResponse | ErrorModel]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeWebhookResponse | ErrorModel]: + """Describe webhook + + Args: + name (str): The name of the webhook. + + 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[DescribeWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeWebhookResponse | ErrorModel | None: + """Describe webhook + + Args: + name (str): The name of the webhook. + + 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: + DescribeWebhookResponse | ErrorModel + """ + + return sync_detailed( + name=name, + client=client, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, +) -> Response[DescribeWebhookResponse | ErrorModel]: + """Describe webhook + + Args: + name (str): The name of the webhook. + + 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[DescribeWebhookResponse | ErrorModel] + """ + + kwargs = _get_kwargs( + name=name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, +) -> DescribeWebhookResponse | ErrorModel | None: + """Describe webhook + + Args: + name (str): The name of the webhook. + + 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: + DescribeWebhookResponse | ErrorModel + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/export_catalogs.py b/src/tower/tower_api_client/api/default/export_catalogs.py index dfd86518..093e5f30 100644 --- a/src/tower/tower_api_client/api/default/export_catalogs.py +++ b/src/tower/tower_api_client/api/default/export_catalogs.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.export_catalogs_params import ExportCatalogsParams from ...models.export_catalogs_response import ExportCatalogsResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/catalogs/export", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ExportCatalogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ExportCatalogsResponse: if response.status_code == 200: response_200 = ExportCatalogsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ExportCatalogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ExportCatalogsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ExportCatalogsParams, -) -> Response[ExportCatalogsResponse]: +) -> Response[ErrorModel | ExportCatalogsResponse]: """Export catalogs Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportCatalogsResponse] + Response[ErrorModel | ExportCatalogsResponse] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: ExportCatalogsParams, -) -> Optional[ExportCatalogsResponse]: +) -> ErrorModel | ExportCatalogsResponse | None: """Export catalogs Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportCatalogsResponse + ErrorModel | ExportCatalogsResponse """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ExportCatalogsParams, -) -> Response[ExportCatalogsResponse]: +) -> Response[ErrorModel | ExportCatalogsResponse]: """Export catalogs Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportCatalogsResponse] + Response[ErrorModel | ExportCatalogsResponse] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ExportCatalogsParams, -) -> Optional[ExportCatalogsResponse]: +) -> ErrorModel | ExportCatalogsResponse | None: """Export catalogs Lists all the catalogs in your current account and re-encrypt them with the public key you supplied. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportCatalogsResponse + ErrorModel | ExportCatalogsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/export_secrets.py b/src/tower/tower_api_client/api/default/export_secrets.py index 38a62491..3433482b 100644 --- a/src/tower/tower_api_client/api/default/export_secrets.py +++ b/src/tower/tower_api_client/api/default/export_secrets.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.export_secrets_params import ExportSecretsParams from ...models.export_secrets_response import ExportSecretsResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/secrets/export", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ExportSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ExportSecretsResponse: if response.status_code == 200: response_200 = ExportSecretsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ExportSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ExportSecretsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ExportSecretsParams, -) -> Response[ExportSecretsResponse]: +) -> Response[ErrorModel | ExportSecretsResponse]: """Export secrets Lists all the secrets in your current account and re-encrypt them with the public key you supplied. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportSecretsResponse] + Response[ErrorModel | ExportSecretsResponse] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: ExportSecretsParams, -) -> Optional[ExportSecretsResponse]: +) -> ErrorModel | ExportSecretsResponse | None: """Export secrets Lists all the secrets in your current account and re-encrypt them with the public key you supplied. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportSecretsResponse + ErrorModel | ExportSecretsResponse """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ExportSecretsParams, -) -> Response[ExportSecretsResponse]: +) -> Response[ErrorModel | ExportSecretsResponse]: """Export secrets Lists all the secrets in your current account and re-encrypt them with the public key you supplied. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ExportSecretsResponse] + Response[ErrorModel | ExportSecretsResponse] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ExportSecretsParams, -) -> Optional[ExportSecretsResponse]: +) -> ErrorModel | ExportSecretsResponse | None: """Export secrets Lists all the secrets in your current account and re-encrypt them with the public key you supplied. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ExportSecretsResponse + ErrorModel | ExportSecretsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/generate_app_statistics.py b/src/tower/tower_api_client/api/default/generate_app_statistics.py index c778e47c..3b9d7db4 100644 --- a/src/tower/tower_api_client/api/default/generate_app_statistics.py +++ b/src/tower/tower_api_client/api/default/generate_app_statistics.py @@ -1,17 +1,17 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.generate_app_statistics_response import GenerateAppStatisticsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - environment: Union[Unset, str] = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -29,21 +29,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GenerateAppStatisticsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateAppStatisticsResponse: if response.status_code == 200: response_200 = GenerateAppStatisticsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[GenerateAppStatisticsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -55,22 +55,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Response[GenerateAppStatisticsResponse]: + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps Args: - environment (Union[Unset, str]): The environment to filter the statistics by. If not - provided, statistics for all environments will be returned. + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. 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[GenerateAppStatisticsResponse] + Response[ErrorModel | GenerateAppStatisticsResponse] """ kwargs = _get_kwargs( @@ -87,22 +87,22 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Optional[GenerateAppStatisticsResponse]: + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateAppStatisticsResponse | None: """Generate app statistics Generates current statistics about apps Args: - environment (Union[Unset, str]): The environment to filter the statistics by. If not - provided, statistics for all environments will be returned. + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. 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: - GenerateAppStatisticsResponse + ErrorModel | GenerateAppStatisticsResponse """ return sync_detailed( @@ -114,22 +114,22 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Response[GenerateAppStatisticsResponse]: + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateAppStatisticsResponse]: """Generate app statistics Generates current statistics about apps Args: - environment (Union[Unset, str]): The environment to filter the statistics by. If not - provided, statistics for all environments will be returned. + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. 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[GenerateAppStatisticsResponse] + Response[ErrorModel | GenerateAppStatisticsResponse] """ kwargs = _get_kwargs( @@ -144,22 +144,22 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - environment: Union[Unset, str] = UNSET, -) -> Optional[GenerateAppStatisticsResponse]: + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateAppStatisticsResponse | None: """Generate app statistics Generates current statistics about apps Args: - environment (Union[Unset, str]): The environment to filter the statistics by. If not - provided, statistics for all environments will be returned. + environment (str | Unset): The environment to filter the statistics by. If not provided, + statistics for all environments will be returned. 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: - GenerateAppStatisticsResponse + ErrorModel | GenerateAppStatisticsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/generate_authenticator.py b/src/tower/tower_api_client/api/default/generate_authenticator.py index 62e898c2..a2f21bb8 100644 --- a/src/tower/tower_api_client/api/default/generate_authenticator.py +++ b/src/tower/tower_api_client/api/default/generate_authenticator.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.generate_authenticator_response import GenerateAuthenticatorResponse from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GenerateAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateAuthenticatorResponse: if response.status_code == 200: response_200 = GenerateAuthenticatorResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[GenerateAuthenticatorResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateAuthenticatorResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[GenerateAuthenticatorResponse]: +) -> Response[ErrorModel | GenerateAuthenticatorResponse]: """Generate authenticator Generates a new authenticator for the user. This is used to set up two-factor authentication. @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateAuthenticatorResponse] + Response[ErrorModel | GenerateAuthenticatorResponse] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[GenerateAuthenticatorResponse]: +) -> ErrorModel | GenerateAuthenticatorResponse | None: """Generate authenticator Generates a new authenticator for the user. This is used to set up two-factor authentication. @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateAuthenticatorResponse + ErrorModel | GenerateAuthenticatorResponse """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[GenerateAuthenticatorResponse]: +) -> Response[ErrorModel | GenerateAuthenticatorResponse]: """Generate authenticator Generates a new authenticator for the user. This is used to set up two-factor authentication. @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateAuthenticatorResponse] + Response[ErrorModel | GenerateAuthenticatorResponse] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[GenerateAuthenticatorResponse]: +) -> ErrorModel | GenerateAuthenticatorResponse | None: """Generate authenticator Generates a new authenticator for the user. This is used to set up two-factor authentication. @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateAuthenticatorResponse + ErrorModel | GenerateAuthenticatorResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/generate_run_statistics.py b/src/tower/tower_api_client/api/default/generate_run_statistics.py index 642f54d5..7f73b450 100644 --- a/src/tower/tower_api_client/api/default/generate_run_statistics.py +++ b/src/tower/tower_api_client/api/default/generate_run_statistics.py @@ -1,11 +1,11 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.generate_run_statistics_response import GenerateRunStatisticsResponse from ...models.generate_run_statistics_status_item import ( GenerateRunStatisticsStatusItem, @@ -15,15 +15,15 @@ def _get_kwargs( *, - status: Union[Unset, list[GenerateRunStatisticsStatusItem]] = UNSET, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, start_at: datetime.datetime, end_at: datetime.datetime, - timezone: Union[Unset, str] = "UTC", - environment: Union[Unset, str] = UNSET, + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} - json_status: Union[Unset, list[str]] = UNSET + json_status: list[str] | Unset = UNSET if not isinstance(status, Unset): json_status = [] for status_item_data in status: @@ -54,21 +54,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GenerateRunStatisticsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateRunStatisticsResponse: if response.status_code == 200: response_200 = GenerateRunStatisticsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[GenerateRunStatisticsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,32 +80,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - status: Union[Unset, list[GenerateRunStatisticsStatusItem]] = UNSET, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, start_at: datetime.datetime, end_at: datetime.datetime, - timezone: Union[Unset, str] = "UTC", - environment: Union[Unset, str] = UNSET, -) -> Response[GenerateRunStatisticsResponse]: + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: """Generate run statistics Generates statistics about runs over a specified time period. Args: - status (Union[Unset, list[GenerateRunStatisticsStatusItem]]): Filter runs by status(es). - Define multiple with a comma-separated list. Supplying none will return all statuses. + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (datetime.datetime): Start date and time for statistics (inclusive) end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[GenerateRunStatisticsResponse] + Response[ErrorModel | GenerateRunStatisticsResponse] """ kwargs = _get_kwargs( @@ -126,32 +126,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - status: Union[Unset, list[GenerateRunStatisticsStatusItem]] = UNSET, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, start_at: datetime.datetime, end_at: datetime.datetime, - timezone: Union[Unset, str] = "UTC", - environment: Union[Unset, str] = UNSET, -) -> Optional[GenerateRunStatisticsResponse]: + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateRunStatisticsResponse | None: """Generate run statistics Generates statistics about runs over a specified time period. Args: - status (Union[Unset, list[GenerateRunStatisticsStatusItem]]): Filter runs by status(es). - Define multiple with a comma-separated list. Supplying none will return all statuses. + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (datetime.datetime): Start date and time for statistics (inclusive) end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - GenerateRunStatisticsResponse + ErrorModel | GenerateRunStatisticsResponse """ return sync_detailed( @@ -167,32 +167,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - status: Union[Unset, list[GenerateRunStatisticsStatusItem]] = UNSET, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, start_at: datetime.datetime, end_at: datetime.datetime, - timezone: Union[Unset, str] = "UTC", - environment: Union[Unset, str] = UNSET, -) -> Response[GenerateRunStatisticsResponse]: + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> Response[ErrorModel | GenerateRunStatisticsResponse]: """Generate run statistics Generates statistics about runs over a specified time period. Args: - status (Union[Unset, list[GenerateRunStatisticsStatusItem]]): Filter runs by status(es). - Define multiple with a comma-separated list. Supplying none will return all statuses. + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (datetime.datetime): Start date and time for statistics (inclusive) end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[GenerateRunStatisticsResponse] + Response[ErrorModel | GenerateRunStatisticsResponse] """ kwargs = _get_kwargs( @@ -211,32 +211,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - status: Union[Unset, list[GenerateRunStatisticsStatusItem]] = UNSET, + status: list[GenerateRunStatisticsStatusItem] | Unset = UNSET, start_at: datetime.datetime, end_at: datetime.datetime, - timezone: Union[Unset, str] = "UTC", - environment: Union[Unset, str] = UNSET, -) -> Optional[GenerateRunStatisticsResponse]: + timezone: str | Unset = "UTC", + environment: str | Unset = UNSET, +) -> ErrorModel | GenerateRunStatisticsResponse | None: """Generate run statistics Generates statistics about runs over a specified time period. Args: - status (Union[Unset, list[GenerateRunStatisticsStatusItem]]): Filter runs by status(es). - Define multiple with a comma-separated list. Supplying none will return all statuses. + status (list[GenerateRunStatisticsStatusItem] | Unset): Filter runs by status(es). Define + multiple with a comma-separated list. Supplying none will return all statuses. start_at (datetime.datetime): Start date and time for statistics (inclusive) end_at (datetime.datetime): End date and time for statistics (inclusive) - timezone (Union[Unset, str]): Timezone for the statistics (e.g., 'Europe/Berlin'). - Defaults to UTC. Default: 'UTC'. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + timezone (str | Unset): Timezone for the statistics (e.g., 'Europe/Berlin'). Defaults to + UTC. Default: 'UTC'. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - GenerateRunStatisticsResponse + ErrorModel | GenerateRunStatisticsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/generate_runner_credentials.py b/src/tower/tower_api_client/api/default/generate_runner_credentials.py index 0e5a95b0..818f8ee8 100644 --- a/src/tower/tower_api_client/api/default/generate_runner_credentials.py +++ b/src/tower/tower_api_client/api/default/generate_runner_credentials.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.generate_runner_credentials_response import ( GenerateRunnerCredentialsResponse, ) @@ -21,21 +21,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GenerateRunnerCredentialsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GenerateRunnerCredentialsResponse: if response.status_code == 200: response_200 = GenerateRunnerCredentialsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[GenerateRunnerCredentialsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -47,7 +47,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[GenerateRunnerCredentialsResponse]: +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: """Generate runner credentials Uses your current authentication context to generate runner credentials that are used for @@ -58,7 +58,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateRunnerCredentialsResponse] + Response[ErrorModel | GenerateRunnerCredentialsResponse] """ kwargs = _get_kwargs() @@ -73,7 +73,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[GenerateRunnerCredentialsResponse]: +) -> ErrorModel | GenerateRunnerCredentialsResponse | None: """Generate runner credentials Uses your current authentication context to generate runner credentials that are used for @@ -84,7 +84,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateRunnerCredentialsResponse + ErrorModel | GenerateRunnerCredentialsResponse """ return sync_detailed( @@ -95,7 +95,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[GenerateRunnerCredentialsResponse]: +) -> Response[ErrorModel | GenerateRunnerCredentialsResponse]: """Generate runner credentials Uses your current authentication context to generate runner credentials that are used for @@ -106,7 +106,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[GenerateRunnerCredentialsResponse] + Response[ErrorModel | GenerateRunnerCredentialsResponse] """ kwargs = _get_kwargs() @@ -119,7 +119,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[GenerateRunnerCredentialsResponse]: +) -> ErrorModel | GenerateRunnerCredentialsResponse | None: """Generate runner credentials Uses your current authentication context to generate runner credentials that are used for @@ -130,7 +130,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - GenerateRunnerCredentialsResponse + ErrorModel | GenerateRunnerCredentialsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/invite_team_member.py b/src/tower/tower_api_client/api/default/invite_team_member.py index 11863b6e..272fe5b8 100644 --- a/src/tower/tower_api_client/api/default/invite_team_member.py +++ b/src/tower/tower_api_client/api/default/invite_team_member.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.invite_team_member_params import InviteTeamMemberParams from ...models.invite_team_member_response import InviteTeamMemberResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/teams/{name}/invites".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[InviteTeamMemberResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | InviteTeamMemberResponse: if response.status_code == 200: response_200 = InviteTeamMemberResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[InviteTeamMemberResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | InviteTeamMemberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: InviteTeamMemberParams, -) -> Response[InviteTeamMemberResponse]: +) -> Response[ErrorModel | InviteTeamMemberResponse]: """Invite team member Invite a new team @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[InviteTeamMemberResponse] + Response[ErrorModel | InviteTeamMemberResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: InviteTeamMemberParams, -) -> Optional[InviteTeamMemberResponse]: +) -> ErrorModel | InviteTeamMemberResponse | None: """Invite team member Invite a new team @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - InviteTeamMemberResponse + ErrorModel | InviteTeamMemberResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: InviteTeamMemberParams, -) -> Response[InviteTeamMemberResponse]: +) -> Response[ErrorModel | InviteTeamMemberResponse]: """Invite team member Invite a new team @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[InviteTeamMemberResponse] + Response[ErrorModel | InviteTeamMemberResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: InviteTeamMemberParams, -) -> Optional[InviteTeamMemberResponse]: +) -> ErrorModel | InviteTeamMemberResponse | None: """Invite team member Invite a new team @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - InviteTeamMemberResponse + ErrorModel | InviteTeamMemberResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/leave_team.py b/src/tower/tower_api_client/api/default/leave_team.py index 8024b09c..fabc26c3 100644 --- a/src/tower/tower_api_client/api/default/leave_team.py +++ b/src/tower/tower_api_client/api/default/leave_team.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.leave_team_response import LeaveTeamResponse from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/teams/{name}/leave".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[LeaveTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | LeaveTeamResponse: if response.status_code == 200: response_200 = LeaveTeamResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[LeaveTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | LeaveTeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[LeaveTeamResponse]: +) -> Response[ErrorModel | LeaveTeamResponse]: """Leave team Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the @@ -64,7 +65,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[LeaveTeamResponse] + Response[ErrorModel | LeaveTeamResponse] """ kwargs = _get_kwargs( @@ -82,7 +83,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[LeaveTeamResponse]: +) -> ErrorModel | LeaveTeamResponse | None: """Leave team Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the @@ -96,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - LeaveTeamResponse + ErrorModel | LeaveTeamResponse """ return sync_detailed( @@ -109,7 +110,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[LeaveTeamResponse]: +) -> Response[ErrorModel | LeaveTeamResponse]: """Leave team Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the @@ -123,7 +124,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[LeaveTeamResponse] + Response[ErrorModel | LeaveTeamResponse] """ kwargs = _get_kwargs( @@ -139,7 +140,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[LeaveTeamResponse]: +) -> ErrorModel | LeaveTeamResponse | None: """Leave team Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the @@ -153,7 +154,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - LeaveTeamResponse + ErrorModel | LeaveTeamResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_alerts.py b/src/tower/tower_api_client/api/default/list_alerts.py index adaf37bf..2011c877 100644 --- a/src/tower/tower_api_client/api/default/list_alerts.py +++ b/src/tower/tower_api_client/api/default/list_alerts.py @@ -1,24 +1,24 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_alerts_response import ListAlertsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - alert_type: Union[Unset, str] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - acked: Union[Unset, str] = UNSET, - environment: Union[Unset, str] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -28,12 +28,12 @@ def _get_kwargs( params["alert_type"] = alert_type - json_start_at: Union[Unset, str] = UNSET + json_start_at: str | Unset = UNSET if not isinstance(start_at, Unset): json_start_at = start_at.isoformat() params["start_at"] = json_start_at - json_end_at: Union[Unset, str] = UNSET + json_end_at: str | Unset = UNSET if not isinstance(end_at, Unset): json_end_at = end_at.isoformat() params["end_at"] = json_end_at @@ -54,21 +54,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAlertsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAlertsResponse: if response.status_code == 200: response_200 = ListAlertsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAlertsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAlertsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -80,35 +80,35 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - alert_type: Union[Unset, str] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - acked: Union[Unset, str] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListAlertsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAlertsResponse]: """List alerts List alerts for the current account with optional filtering Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - alert_type (Union[Unset, str]): Filter alerts by alert type - start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime (inclusive) - acked (Union[Unset, str]): Filter alerts by acknowledged status. - environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) 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[ListAlertsResponse] + Response[ErrorModel | ListAlertsResponse] """ kwargs = _get_kwargs( @@ -131,35 +131,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - alert_type: Union[Unset, str] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - acked: Union[Unset, str] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListAlertsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAlertsResponse | None: """List alerts List alerts for the current account with optional filtering Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - alert_type (Union[Unset, str]): Filter alerts by alert type - start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime (inclusive) - acked (Union[Unset, str]): Filter alerts by acknowledged status. - environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime + (inclusive) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) 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: - ListAlertsResponse + ErrorModel | ListAlertsResponse """ return sync_detailed( @@ -177,35 +177,35 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - alert_type: Union[Unset, str] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - acked: Union[Unset, str] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListAlertsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAlertsResponse]: """List alerts List alerts for the current account with optional filtering Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - alert_type (Union[Unset, str]): Filter alerts by alert type - start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime (inclusive) - acked (Union[Unset, str]): Filter alerts by acknowledged status. - environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) 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[ListAlertsResponse] + Response[ErrorModel | ListAlertsResponse] """ kwargs = _get_kwargs( @@ -226,35 +226,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - alert_type: Union[Unset, str] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - acked: Union[Unset, str] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListAlertsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + alert_type: str | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + acked: str | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAlertsResponse | None: """List alerts List alerts for the current account with optional filtering Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - alert_type (Union[Unset, str]): Filter alerts by alert type - start_at (Union[Unset, datetime.datetime]): Filter alerts created after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter alerts created before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + alert_type (str | Unset): Filter alerts by alert type + start_at (datetime.datetime | Unset): Filter alerts created after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter alerts created before or at this datetime (inclusive) - acked (Union[Unset, str]): Filter alerts by acknowledged status. - environment (Union[Unset, str]): Filter alerts by environment (e.g., production, staging) + acked (str | Unset): Filter alerts by acknowledged status. + environment (str | Unset): Filter alerts by environment (e.g., production, staging) 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: - ListAlertsResponse + ErrorModel | ListAlertsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_api_keys.py b/src/tower/tower_api_client/api/default/list_api_keys.py index a0619c30..27df54b3 100644 --- a/src/tower/tower_api_client/api/default/list_api_keys.py +++ b/src/tower/tower_api_client/api/default/list_api_keys.py @@ -1,18 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_api_keys_response import ListAPIKeysResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, + page: int | Unset = 1, + page_size: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,21 +32,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAPIKeysResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAPIKeysResponse: if response.status_code == 200: response_200 = ListAPIKeysResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAPIKeysResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAPIKeysResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,23 +58,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListAPIKeysResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListAPIKeysResponse]: """List API keys List all the API keys associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListAPIKeysResponse] + Response[ErrorModel | ListAPIKeysResponse] """ kwargs = _get_kwargs( @@ -92,23 +92,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListAPIKeysResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListAPIKeysResponse | None: """List API keys List all the API keys associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListAPIKeysResponse + ErrorModel | ListAPIKeysResponse """ return sync_detailed( @@ -121,23 +121,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListAPIKeysResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListAPIKeysResponse]: """List API keys List all the API keys associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListAPIKeysResponse] + Response[ErrorModel | ListAPIKeysResponse] """ kwargs = _get_kwargs( @@ -153,23 +153,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListAPIKeysResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListAPIKeysResponse | None: """List API keys List all the API keys associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListAPIKeysResponse + ErrorModel | ListAPIKeysResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_app_environments.py b/src/tower/tower_api_client/api/default/list_app_environments.py index 27d26443..61bb3790 100644 --- a/src/tower/tower_api_client/api/default/list_app_environments.py +++ b/src/tower/tower_api_client/api/default/list_app_environments.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_app_environments_response import ListAppEnvironmentsResponse from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/environments".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAppEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppEnvironmentsResponse: if response.status_code == 200: response_200 = ListAppEnvironmentsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAppEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListAppEnvironmentsResponse]: +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: """List app environments Generates a list of all the known environments for a given app in the current account. @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAppEnvironmentsResponse] + Response[ErrorModel | ListAppEnvironmentsResponse] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[ListAppEnvironmentsResponse]: +) -> ErrorModel | ListAppEnvironmentsResponse | None: """List app environments Generates a list of all the known environments for a given app in the current account. @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAppEnvironmentsResponse + ErrorModel | ListAppEnvironmentsResponse """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListAppEnvironmentsResponse]: +) -> Response[ErrorModel | ListAppEnvironmentsResponse]: """List app environments Generates a list of all the known environments for a given app in the current account. @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAppEnvironmentsResponse] + Response[ErrorModel | ListAppEnvironmentsResponse] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[ListAppEnvironmentsResponse]: +) -> ErrorModel | ListAppEnvironmentsResponse | None: """List app environments Generates a list of all the known environments for a given app in the current account. @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAppEnvironmentsResponse + ErrorModel | ListAppEnvironmentsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_app_versions.py b/src/tower/tower_api_client/api/default/list_app_versions.py index a758dab1..a3414d4c 100644 --- a/src/tower/tower_api_client/api/default/list_app_versions.py +++ b/src/tower/tower_api_client/api/default/list_app_versions.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_app_versions_response import ListAppVersionsResponse from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/versions".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAppVersionsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppVersionsResponse: if response.status_code == 200: response_200 = ListAppVersionsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAppVersionsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppVersionsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListAppVersionsResponse]: +) -> Response[ErrorModel | ListAppVersionsResponse]: """List app versions List all versions of an app in the current account, sorted with the most recent first. @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAppVersionsResponse] + Response[ErrorModel | ListAppVersionsResponse] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[ListAppVersionsResponse]: +) -> ErrorModel | ListAppVersionsResponse | None: """List app versions List all versions of an app in the current account, sorted with the most recent first. @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAppVersionsResponse + ErrorModel | ListAppVersionsResponse """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListAppVersionsResponse]: +) -> Response[ErrorModel | ListAppVersionsResponse]: """List app versions List all versions of an app in the current account, sorted with the most recent first. @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAppVersionsResponse] + Response[ErrorModel | ListAppVersionsResponse] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[ListAppVersionsResponse]: +) -> ErrorModel | ListAppVersionsResponse | None: """List app versions List all versions of an app in the current account, sorted with the most recent first. @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAppVersionsResponse + ErrorModel | ListAppVersionsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_apps.py b/src/tower/tower_api_client/api/default/list_apps.py index 66997769..c71e0f10 100644 --- a/src/tower/tower_api_client/api/default/list_apps.py +++ b/src/tower/tower_api_client/api/default/list_apps.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_apps_filter import ListAppsFilter from ...models.list_apps_response import ListAppsResponse from ...models.list_apps_sort import ListAppsSort @@ -13,13 +13,13 @@ def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - query: Union[Unset, str] = UNSET, - num_runs: Union[Unset, int] = 20, - sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, - filter_: Union[Unset, ListAppsFilter] = UNSET, - environment: Union[Unset, str] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -31,13 +31,13 @@ def _get_kwargs( params["num_runs"] = num_runs - json_sort: Union[Unset, str] = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort.value params["sort"] = json_sort - json_filter_: Union[Unset, str] = UNSET + json_filter_: str | Unset = UNSET if not isinstance(filter_, Unset): json_filter_ = filter_.value @@ -57,21 +57,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAppsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAppsResponse: if response.status_code == 200: response_200 = ListAppsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAppsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAppsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,36 +83,35 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - query: Union[Unset, str] = UNSET, - num_runs: Union[Unset, int] = 20, - sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, - filter_: Union[Unset, ListAppsFilter] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListAppsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAppsResponse]: """List apps Get all the apps for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - query (Union[Unset, str]): The search query to filter apps by. - num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to - 20) Default: 20. - sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: - ListAppsSort.CREATED_AT. - filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. - environment (Union[Unset, str]): The environment to filter the apps by. If not provided, - apps for all environments will be returned. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. 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[ListAppsResponse] + Response[ErrorModel | ListAppsResponse] """ kwargs = _get_kwargs( @@ -135,36 +134,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - query: Union[Unset, str] = UNSET, - num_runs: Union[Unset, int] = 20, - sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, - filter_: Union[Unset, ListAppsFilter] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListAppsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAppsResponse | None: """List apps Get all the apps for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - query (Union[Unset, str]): The search query to filter apps by. - num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to - 20) Default: 20. - sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: - ListAppsSort.CREATED_AT. - filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. - environment (Union[Unset, str]): The environment to filter the apps by. If not provided, - apps for all environments will be returned. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. 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: - ListAppsResponse + ErrorModel | ListAppsResponse """ return sync_detailed( @@ -182,36 +180,35 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - query: Union[Unset, str] = UNSET, - num_runs: Union[Unset, int] = 20, - sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, - filter_: Union[Unset, ListAppsFilter] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListAppsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListAppsResponse]: """List apps Get all the apps for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - query (Union[Unset, str]): The search query to filter apps by. - num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to - 20) Default: 20. - sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: - ListAppsSort.CREATED_AT. - filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. - environment (Union[Unset, str]): The environment to filter the apps by. If not provided, - apps for all environments will be returned. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. 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[ListAppsResponse] + Response[ErrorModel | ListAppsResponse] """ kwargs = _get_kwargs( @@ -232,36 +229,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - query: Union[Unset, str] = UNSET, - num_runs: Union[Unset, int] = 20, - sort: Union[Unset, ListAppsSort] = ListAppsSort.CREATED_AT, - filter_: Union[Unset, ListAppsFilter] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListAppsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + query: str | Unset = UNSET, + num_runs: int | Unset = 20, + sort: ListAppsSort | Unset = ListAppsSort.CREATED_AT, + filter_: ListAppsFilter | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListAppsResponse | None: """List apps Get all the apps for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - query (Union[Unset, str]): The search query to filter apps by. - num_runs (Union[Unset, int]): Number of recent runs to fetch (-1 for all runs, defaults to - 20) Default: 20. - sort (Union[Unset, ListAppsSort]): Sort order for the results. Default: - ListAppsSort.CREATED_AT. - filter_ (Union[Unset, ListAppsFilter]): Filter to see apps with certain statuses. - environment (Union[Unset, str]): The environment to filter the apps by. If not provided, - apps for all environments will be returned. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + query (str | Unset): The search query to filter apps by. + num_runs (int | Unset): Number of recent runs to fetch (-1 for all runs, defaults to 20) + Default: 20. + sort (ListAppsSort | Unset): Sort order for the results. Default: ListAppsSort.CREATED_AT. + filter_ (ListAppsFilter | Unset): Filter to see apps with certain statuses. + environment (str | Unset): The environment to filter the apps by. If not provided, apps + for all environments will be returned. 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: - ListAppsResponse + ErrorModel | ListAppsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_authenticators.py b/src/tower/tower_api_client/api/default/list_authenticators.py index cd2115c2..9029a659 100644 --- a/src/tower/tower_api_client/api/default/list_authenticators.py +++ b/src/tower/tower_api_client/api/default/list_authenticators.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_authenticators_response import ListAuthenticatorsResponse from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListAuthenticatorsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListAuthenticatorsResponse: if response.status_code == 200: response_200 = ListAuthenticatorsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListAuthenticatorsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListAuthenticatorsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ListAuthenticatorsResponse]: +) -> Response[ErrorModel | ListAuthenticatorsResponse]: """List authenticators Enumerates the authenticators associated with the current users' account @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAuthenticatorsResponse] + Response[ErrorModel | ListAuthenticatorsResponse] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[ListAuthenticatorsResponse]: +) -> ErrorModel | ListAuthenticatorsResponse | None: """List authenticators Enumerates the authenticators associated with the current users' account @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAuthenticatorsResponse + ErrorModel | ListAuthenticatorsResponse """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ListAuthenticatorsResponse]: +) -> Response[ErrorModel | ListAuthenticatorsResponse]: """List authenticators Enumerates the authenticators associated with the current users' account @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListAuthenticatorsResponse] + Response[ErrorModel | ListAuthenticatorsResponse] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[ListAuthenticatorsResponse]: +) -> ErrorModel | ListAuthenticatorsResponse | None: """List authenticators Enumerates the authenticators associated with the current users' account @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListAuthenticatorsResponse + ErrorModel | ListAuthenticatorsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_catalogs.py b/src/tower/tower_api_client/api/default/list_catalogs.py index 0f6f00b9..b559eb5b 100644 --- a/src/tower/tower_api_client/api/default/list_catalogs.py +++ b/src/tower/tower_api_client/api/default/list_catalogs.py @@ -1,20 +1,20 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_catalogs_response import ListCatalogsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,21 +38,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListCatalogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListCatalogsResponse: if response.status_code == 200: response_200 = ListCatalogsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListCatalogsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListCatalogsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,28 +64,28 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Response[ListCatalogsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only - for the current environment. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. 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[ListCatalogsResponse] + Response[ErrorModel | ListCatalogsResponse] """ kwargs = _get_kwargs( @@ -105,28 +105,28 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Optional[ListCatalogsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListCatalogsResponse | None: """List catalogs Lists all the catalogs associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only - for the current environment. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. 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: - ListCatalogsResponse + ErrorModel | ListCatalogsResponse """ return sync_detailed( @@ -141,28 +141,28 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Response[ListCatalogsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListCatalogsResponse]: """List catalogs Lists all the catalogs associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only - for the current environment. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. 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[ListCatalogsResponse] + Response[ErrorModel | ListCatalogsResponse] """ kwargs = _get_kwargs( @@ -180,28 +180,28 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Optional[ListCatalogsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListCatalogsResponse | None: """List catalogs Lists all the catalogs associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all catalogs across all environments or only - for the current environment. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all catalogs across all environments or only for the + current environment. 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: - ListCatalogsResponse + ErrorModel | ListCatalogsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_environments.py b/src/tower/tower_api_client/api/default/list_environments.py index 3c949b62..cdf077dc 100644 --- a/src/tower/tower_api_client/api/default/list_environments.py +++ b/src/tower/tower_api_client/api/default/list_environments.py @@ -1,18 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_environments_response import ListEnvironmentsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, + page: int | Unset = 1, + page_size: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,21 +32,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListEnvironmentsResponse: if response.status_code == 200: response_200 = ListEnvironmentsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListEnvironmentsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,23 +58,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListEnvironmentsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListEnvironmentsResponse]: """List environments List all environments in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListEnvironmentsResponse] + Response[ErrorModel | ListEnvironmentsResponse] """ kwargs = _get_kwargs( @@ -92,23 +92,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListEnvironmentsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListEnvironmentsResponse | None: """List environments List all environments in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListEnvironmentsResponse + ErrorModel | ListEnvironmentsResponse """ return sync_detailed( @@ -121,23 +121,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListEnvironmentsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListEnvironmentsResponse]: """List environments List all environments in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListEnvironmentsResponse] + Response[ErrorModel | ListEnvironmentsResponse] """ kwargs = _get_kwargs( @@ -153,23 +153,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListEnvironmentsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListEnvironmentsResponse | None: """List environments List all environments in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListEnvironmentsResponse + ErrorModel | ListEnvironmentsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_my_team_invitations.py b/src/tower/tower_api_client/api/default/list_my_team_invitations.py index 29ea69cd..30b74b6b 100644 --- a/src/tower/tower_api_client/api/default/list_my_team_invitations.py +++ b/src/tower/tower_api_client/api/default/list_my_team_invitations.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_my_team_invitations_response import ListMyTeamInvitationsResponse from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListMyTeamInvitationsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListMyTeamInvitationsResponse: if response.status_code == 200: response_200 = ListMyTeamInvitationsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListMyTeamInvitationsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ListMyTeamInvitationsResponse]: +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: """List my team invitations List your pending invitations for teams @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListMyTeamInvitationsResponse] + Response[ErrorModel | ListMyTeamInvitationsResponse] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[ListMyTeamInvitationsResponse]: +) -> ErrorModel | ListMyTeamInvitationsResponse | None: """List my team invitations List your pending invitations for teams @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListMyTeamInvitationsResponse + ErrorModel | ListMyTeamInvitationsResponse """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ListMyTeamInvitationsResponse]: +) -> Response[ErrorModel | ListMyTeamInvitationsResponse]: """List my team invitations List your pending invitations for teams @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListMyTeamInvitationsResponse] + Response[ErrorModel | ListMyTeamInvitationsResponse] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[ListMyTeamInvitationsResponse]: +) -> ErrorModel | ListMyTeamInvitationsResponse | None: """List my team invitations List your pending invitations for teams @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListMyTeamInvitationsResponse + ErrorModel | ListMyTeamInvitationsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_runners.py b/src/tower/tower_api_client/api/default/list_runners.py index b8fd45f8..a863ef62 100644 --- a/src/tower/tower_api_client/api/default/list_runners.py +++ b/src/tower/tower_api_client/api/default/list_runners.py @@ -1,18 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_runners_response import ListRunnersResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, + page: int | Unset = 1, + page_size: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,21 +32,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListRunnersResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListRunnersResponse: if response.status_code == 200: response_200 = ListRunnersResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListRunnersResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListRunnersResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,23 +58,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListRunnersResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListRunnersResponse]: """List runners Get all self-hosted runners for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListRunnersResponse] + Response[ErrorModel | ListRunnersResponse] """ kwargs = _get_kwargs( @@ -92,23 +92,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListRunnersResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListRunnersResponse | None: """List runners Get all self-hosted runners for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListRunnersResponse + ErrorModel | ListRunnersResponse """ return sync_detailed( @@ -121,23 +121,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListRunnersResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListRunnersResponse]: """List runners Get all self-hosted runners for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListRunnersResponse] + Response[ErrorModel | ListRunnersResponse] """ kwargs = _get_kwargs( @@ -153,23 +153,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListRunnersResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListRunnersResponse | None: """List runners Get all self-hosted runners for the current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListRunnersResponse + ErrorModel | ListRunnersResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_runs.py b/src/tower/tower_api_client/api/default/list_runs.py index c5fae05b..045426f6 100644 --- a/src/tower/tower_api_client/api/default/list_runs.py +++ b/src/tower/tower_api_client/api/default/list_runs.py @@ -1,11 +1,12 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_runs_response import ListRunsResponse from ...models.list_runs_status_item import ListRunsStatusItem from ...types import UNSET, Response, Unset @@ -14,12 +15,12 @@ def _get_kwargs( name: str, *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[ListRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -27,7 +28,7 @@ def _get_kwargs( params["page_size"] = page_size - json_status: Union[Unset, list[str]] = UNSET + json_status: list[str] | Unset = UNSET if not isinstance(status, Unset): json_status = [] for status_item_data in status: @@ -36,12 +37,12 @@ def _get_kwargs( params["status"] = json_status - json_start_at: Union[Unset, str] = UNSET + json_start_at: str | Unset = UNSET if not isinstance(start_at, Unset): json_start_at = start_at.isoformat() params["start_at"] = json_start_at - json_end_at: Union[Unset, str] = UNSET + json_end_at: str | Unset = UNSET if not isinstance(end_at, Unset): json_end_at = end_at.isoformat() params["end_at"] = json_end_at @@ -53,7 +54,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/runs".format( - name=name, + name=quote(str(name), safe=""), ), "params": params, } @@ -62,21 +63,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListRunsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListRunsResponse: if response.status_code == 200: response_200 = ListRunsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListRunsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListRunsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,13 +90,13 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[ListRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListRunsResponse]: """List runs Generates a list of all the runs for a given app. The list is paginated based on the query string @@ -103,23 +104,23 @@ def sync_detailed( Args: name (str): The name of the app to fetch runs for. - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive) - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[ListRunsResponse] + Response[ErrorModel | ListRunsResponse] """ kwargs = _get_kwargs( @@ -143,13 +144,13 @@ def sync( name: str, *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[ListRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListRunsResponse | None: """List runs Generates a list of all the runs for a given app. The list is paginated based on the query string @@ -157,23 +158,23 @@ def sync( Args: name (str): The name of the app to fetch runs for. - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime (inclusive) - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime + (inclusive) + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - ListRunsResponse + ErrorModel | ListRunsResponse """ return sync_detailed( @@ -192,13 +193,13 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[ListRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[ListRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListRunsResponse]: """List runs Generates a list of all the runs for a given app. The list is paginated based on the query string @@ -206,23 +207,23 @@ async def asyncio_detailed( Args: name (str): The name of the app to fetch runs for. - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive) - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[ListRunsResponse] + Response[ErrorModel | ListRunsResponse] """ kwargs = _get_kwargs( @@ -244,13 +245,13 @@ async def asyncio( name: str, *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[ListRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[ListRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | ListRunsResponse | None: """List runs Generates a list of all the runs for a given app. The list is paginated based on the query string @@ -258,23 +259,23 @@ async def asyncio( Args: name (str): The name of the app to fetch runs for. - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[ListRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after or at this - datetime (inclusive) - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[ListRunsStatusItem] | Unset): Filter runs by status(es). Define multiple with + a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after or at this datetime + (inclusive) + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive) - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - ListRunsResponse + ErrorModel | ListRunsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_schedules.py b/src/tower/tower_api_client/api/default/list_schedules.py index 8eecc7f1..582621bf 100644 --- a/src/tower/tower_api_client/api/default/list_schedules.py +++ b/src/tower/tower_api_client/api/default/list_schedules.py @@ -1,19 +1,19 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_schedules_response import ListSchedulesResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -35,21 +35,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListSchedulesResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSchedulesResponse: if response.status_code == 200: response_200 = ListSchedulesResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListSchedulesResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSchedulesResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,18 +61,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, -) -> Response[ListSchedulesResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListSchedulesResponse]: """List schedules List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): Filter schedules by environment. If not provided, all + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all environments will be included. Raises: @@ -80,7 +80,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListSchedulesResponse] + Response[ErrorModel | ListSchedulesResponse] """ kwargs = _get_kwargs( @@ -99,18 +99,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListSchedulesResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> ErrorModel | ListSchedulesResponse | None: """List schedules List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): Filter schedules by environment. If not provided, all + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all environments will be included. Raises: @@ -118,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListSchedulesResponse + ErrorModel | ListSchedulesResponse """ return sync_detailed( @@ -132,18 +132,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, -) -> Response[ListSchedulesResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | ListSchedulesResponse]: """List schedules List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): Filter schedules by environment. If not provided, all + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all environments will be included. Raises: @@ -151,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListSchedulesResponse] + Response[ErrorModel | ListSchedulesResponse] """ kwargs = _get_kwargs( @@ -168,18 +168,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, -) -> Optional[ListSchedulesResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, +) -> ErrorModel | ListSchedulesResponse | None: """List schedules List all schedules for an app. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): Filter schedules by environment. If not provided, all + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): Filter schedules by environment. If not provided, all environments will be included. Raises: @@ -187,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListSchedulesResponse + ErrorModel | ListSchedulesResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_secret_environments.py b/src/tower/tower_api_client/api/default/list_secret_environments.py index e1c9126a..83a17848 100644 --- a/src/tower/tower_api_client/api/default/list_secret_environments.py +++ b/src/tower/tower_api_client/api/default/list_secret_environments.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_secret_environments_response import ListSecretEnvironmentsResponse from ...types import Response @@ -19,21 +19,21 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListSecretEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSecretEnvironmentsResponse: if response.status_code == 200: response_200 = ListSecretEnvironmentsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListSecretEnvironmentsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -45,7 +45,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[ListSecretEnvironmentsResponse]: +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: """List secret environments Lists all the environments associated with secrets. @@ -55,7 +55,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListSecretEnvironmentsResponse] + Response[ErrorModel | ListSecretEnvironmentsResponse] """ kwargs = _get_kwargs() @@ -70,7 +70,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[ListSecretEnvironmentsResponse]: +) -> ErrorModel | ListSecretEnvironmentsResponse | None: """List secret environments Lists all the environments associated with secrets. @@ -80,7 +80,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListSecretEnvironmentsResponse + ErrorModel | ListSecretEnvironmentsResponse """ return sync_detailed( @@ -91,7 +91,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[ListSecretEnvironmentsResponse]: +) -> Response[ErrorModel | ListSecretEnvironmentsResponse]: """List secret environments Lists all the environments associated with secrets. @@ -101,7 +101,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListSecretEnvironmentsResponse] + Response[ErrorModel | ListSecretEnvironmentsResponse] """ kwargs = _get_kwargs() @@ -114,7 +114,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[ListSecretEnvironmentsResponse]: +) -> ErrorModel | ListSecretEnvironmentsResponse | None: """List secret environments Lists all the environments associated with secrets. @@ -124,7 +124,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListSecretEnvironmentsResponse + ErrorModel | ListSecretEnvironmentsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_secrets.py b/src/tower/tower_api_client/api/default/list_secrets.py index 131a0023..35d5237e 100644 --- a/src/tower/tower_api_client/api/default/list_secrets.py +++ b/src/tower/tower_api_client/api/default/list_secrets.py @@ -1,20 +1,20 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_secrets_response import ListSecretsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -38,21 +38,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListSecretsResponse: if response.status_code == 200: response_200 = ListSecretsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListSecretsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListSecretsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,28 +64,28 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Response[ListSecretsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListSecretsResponse]: """List secrets Lists all the secrets associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not - marked as deleted. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. 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[ListSecretsResponse] + Response[ErrorModel | ListSecretsResponse] """ kwargs = _get_kwargs( @@ -105,28 +105,28 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Optional[ListSecretsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListSecretsResponse | None: """List secrets Lists all the secrets associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not - marked as deleted. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. 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: - ListSecretsResponse + ErrorModel | ListSecretsResponse """ return sync_detailed( @@ -141,28 +141,28 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Response[ListSecretsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> Response[ErrorModel | ListSecretsResponse]: """List secrets Lists all the secrets associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not - marked as deleted. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. 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[ListSecretsResponse] + Response[ErrorModel | ListSecretsResponse] """ kwargs = _get_kwargs( @@ -180,28 +180,28 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - environment: Union[Unset, str] = UNSET, - all_: Union[Unset, bool] = UNSET, -) -> Optional[ListSecretsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + environment: str | Unset = UNSET, + all_: bool | Unset = UNSET, +) -> ErrorModel | ListSecretsResponse | None: """List secrets Lists all the secrets associated with your current account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - environment (Union[Unset, str]): The environment to filter by. - all_ (Union[Unset, bool]): Whether to fetch all secrets or only the ones that are not - marked as deleted. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + environment (str | Unset): The environment to filter by. + all_ (bool | Unset): Whether to fetch all secrets or only the ones that are not marked as + deleted. 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: - ListSecretsResponse + ErrorModel | ListSecretsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_team_invitations.py b/src/tower/tower_api_client/api/default/list_team_invitations.py index 4e48640e..ee6cd54d 100644 --- a/src/tower/tower_api_client/api/default/list_team_invitations.py +++ b/src/tower/tower_api_client/api/default/list_team_invitations.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_team_invitations_response import ListTeamInvitationsResponse from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/teams/{name}/invites".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListTeamInvitationsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamInvitationsResponse: if response.status_code == 200: response_200 = ListTeamInvitationsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListTeamInvitationsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamInvitationsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListTeamInvitationsResponse]: +) -> Response[ErrorModel | ListTeamInvitationsResponse]: """List team invitations List the pending invitations for a team @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListTeamInvitationsResponse] + Response[ErrorModel | ListTeamInvitationsResponse] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[ListTeamInvitationsResponse]: +) -> ErrorModel | ListTeamInvitationsResponse | None: """List team invitations List the pending invitations for a team @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListTeamInvitationsResponse + ErrorModel | ListTeamInvitationsResponse """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListTeamInvitationsResponse]: +) -> Response[ErrorModel | ListTeamInvitationsResponse]: """List team invitations List the pending invitations for a team @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListTeamInvitationsResponse] + Response[ErrorModel | ListTeamInvitationsResponse] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[ListTeamInvitationsResponse]: +) -> ErrorModel | ListTeamInvitationsResponse | None: """List team invitations List the pending invitations for a team @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListTeamInvitationsResponse + ErrorModel | ListTeamInvitationsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_team_members.py b/src/tower/tower_api_client/api/default/list_team_members.py index 6014f50b..3b3d8715 100644 --- a/src/tower/tower_api_client/api/default/list_team_members.py +++ b/src/tower/tower_api_client/api/default/list_team_members.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_team_members_response import ListTeamMembersResponse from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/teams/{name}/members".format( - name=name, + name=quote(str(name), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListTeamMembersResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamMembersResponse: if response.status_code == 200: response_200 = ListTeamMembersResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListTeamMembersResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamMembersResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -50,7 +51,7 @@ def sync_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListTeamMembersResponse]: +) -> Response[ErrorModel | ListTeamMembersResponse]: """List team members List the members of a team @@ -63,7 +64,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListTeamMembersResponse] + Response[ErrorModel | ListTeamMembersResponse] """ kwargs = _get_kwargs( @@ -81,7 +82,7 @@ def sync( name: str, *, client: AuthenticatedClient, -) -> Optional[ListTeamMembersResponse]: +) -> ErrorModel | ListTeamMembersResponse | None: """List team members List the members of a team @@ -94,7 +95,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListTeamMembersResponse + ErrorModel | ListTeamMembersResponse """ return sync_detailed( @@ -107,7 +108,7 @@ async def asyncio_detailed( name: str, *, client: AuthenticatedClient, -) -> Response[ListTeamMembersResponse]: +) -> Response[ErrorModel | ListTeamMembersResponse]: """List team members List the members of a team @@ -120,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ListTeamMembersResponse] + Response[ErrorModel | ListTeamMembersResponse] """ kwargs = _get_kwargs( @@ -136,7 +137,7 @@ async def asyncio( name: str, *, client: AuthenticatedClient, -) -> Optional[ListTeamMembersResponse]: +) -> ErrorModel | ListTeamMembersResponse | None: """List team members List the members of a team @@ -149,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ListTeamMembersResponse + ErrorModel | ListTeamMembersResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_teams.py b/src/tower/tower_api_client/api/default/list_teams.py index 899a7a37..8706f512 100644 --- a/src/tower/tower_api_client/api/default/list_teams.py +++ b/src/tower/tower_api_client/api/default/list_teams.py @@ -1,18 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.list_teams_response import ListTeamsResponse from ...types import UNSET, Response, Unset def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, + page: int | Unset = 1, + page_size: int | Unset = 20, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -32,21 +32,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ListTeamsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListTeamsResponse: if response.status_code == 200: response_200 = ListTeamsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ListTeamsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListTeamsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,23 +58,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListTeamsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListTeamsResponse]: """List teams List all the teams that the user is a member of. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListTeamsResponse] + Response[ErrorModel | ListTeamsResponse] """ kwargs = _get_kwargs( @@ -92,23 +92,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListTeamsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListTeamsResponse | None: """List teams List all the teams that the user is a member of. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListTeamsResponse + ErrorModel | ListTeamsResponse """ return sync_detailed( @@ -121,23 +121,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Response[ListTeamsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListTeamsResponse]: """List teams List all the teams that the user is a member of. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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[ListTeamsResponse] + Response[ErrorModel | ListTeamsResponse] """ kwargs = _get_kwargs( @@ -153,23 +153,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, -) -> Optional[ListTeamsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListTeamsResponse | None: """List teams List all the teams that the user is a member of. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. 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: - ListTeamsResponse + ErrorModel | ListTeamsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/list_webhooks.py b/src/tower/tower_api_client/api/default/list_webhooks.py new file mode 100644 index 00000000..25f201c3 --- /dev/null +++ b/src/tower/tower_api_client/api/default/list_webhooks.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.list_webhooks_response import ListWebhooksResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["page"] = page + + params["page_size"] = page_size + + 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": "/webhooks", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ListWebhooksResponse: + if response.status_code == 200: + response_200 = ListWebhooksResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ListWebhooksResponse]: + 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, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListWebhooksResponse]: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + 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[ErrorModel | ListWebhooksResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListWebhooksResponse | None: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + 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: + ErrorModel | ListWebhooksResponse + """ + + return sync_detailed( + client=client, + page=page, + page_size=page_size, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> Response[ErrorModel | ListWebhooksResponse]: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + 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[ErrorModel | ListWebhooksResponse] + """ + + kwargs = _get_kwargs( + page=page, + page_size=page_size, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + page: int | Unset = 1, + page_size: int | Unset = 20, +) -> ErrorModel | ListWebhooksResponse | None: + """List webhooks + + Args: + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + + 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: + ErrorModel | ListWebhooksResponse + """ + + return ( + await asyncio_detailed( + client=client, + page=page, + page_size=page_size, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/refresh_session.py b/src/tower/tower_api_client/api/default/refresh_session.py index 70b25a6b..fc8825a3 100644 --- a/src/tower/tower_api_client/api/default/refresh_session.py +++ b/src/tower/tower_api_client/api/default/refresh_session.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.refresh_session_params import RefreshSessionParams from ...models.refresh_session_response import RefreshSessionResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/session/refresh", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RefreshSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RefreshSessionResponse: if response.status_code == 200: response_200 = RefreshSessionResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[RefreshSessionResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RefreshSessionResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,11 +57,12 @@ def sync_detailed( *, client: AuthenticatedClient, body: RefreshSessionParams, -) -> Response[RefreshSessionResponse]: +) -> Response[ErrorModel | RefreshSessionResponse]: """Refresh session - Returns a new session based on the supplied authentication context. This is helpful when clients - want to use POST instead of GET to check session information. + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. Args: body (RefreshSessionParams): @@ -72,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[RefreshSessionResponse] + Response[ErrorModel | RefreshSessionResponse] """ kwargs = _get_kwargs( @@ -90,11 +90,12 @@ def sync( *, client: AuthenticatedClient, body: RefreshSessionParams, -) -> Optional[RefreshSessionResponse]: +) -> ErrorModel | RefreshSessionResponse | None: """Refresh session - Returns a new session based on the supplied authentication context. This is helpful when clients - want to use POST instead of GET to check session information. + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. Args: body (RefreshSessionParams): @@ -104,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - RefreshSessionResponse + ErrorModel | RefreshSessionResponse """ return sync_detailed( @@ -117,11 +118,12 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: RefreshSessionParams, -) -> Response[RefreshSessionResponse]: +) -> Response[ErrorModel | RefreshSessionResponse]: """Refresh session - Returns a new session based on the supplied authentication context. This is helpful when clients - want to use POST instead of GET to check session information. + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. Args: body (RefreshSessionParams): @@ -131,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[RefreshSessionResponse] + Response[ErrorModel | RefreshSessionResponse] """ kwargs = _get_kwargs( @@ -147,11 +149,12 @@ async def asyncio( *, client: AuthenticatedClient, body: RefreshSessionParams, -) -> Optional[RefreshSessionResponse]: +) -> ErrorModel | RefreshSessionResponse | None: """Refresh session - Returns a new session based on the supplied authentication context. This is helpful when clients - want to use POST instead of GET to check session information. + If your access tokens expire, this API endpoint takes a Refresh Token and returns a new set of + Access Tokens for your session. Note that we don't rotate the Refresh Token itself, and it's not + returned by this API endpoint. Args: body (RefreshSessionParams): @@ -161,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - RefreshSessionResponse + ErrorModel | RefreshSessionResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/remove_team_member.py b/src/tower/tower_api_client/api/default/remove_team_member.py index a8d41ac2..1a80ada5 100644 --- a/src/tower/tower_api_client/api/default/remove_team_member.py +++ b/src/tower/tower_api_client/api/default/remove_team_member.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.remove_team_member_params import RemoveTeamMemberParams from ...models.remove_team_member_response import RemoveTeamMemberResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", "url": "/teams/{name}/members".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[RemoveTeamMemberResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RemoveTeamMemberResponse: if response.status_code == 200: response_200 = RemoveTeamMemberResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[RemoveTeamMemberResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RemoveTeamMemberResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,11 +62,9 @@ def sync_detailed( *, client: AuthenticatedClient, body: RemoveTeamMemberParams, -) -> Response[RemoveTeamMemberResponse]: +) -> Response[ErrorModel | RemoveTeamMemberResponse]: """Remove team member - Remove a new team - Args: name (str): The name of the team to remove someone from body (RemoveTeamMemberParams): @@ -76,7 +74,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[RemoveTeamMemberResponse] + Response[ErrorModel | RemoveTeamMemberResponse] """ kwargs = _get_kwargs( @@ -96,11 +94,9 @@ def sync( *, client: AuthenticatedClient, body: RemoveTeamMemberParams, -) -> Optional[RemoveTeamMemberResponse]: +) -> ErrorModel | RemoveTeamMemberResponse | None: """Remove team member - Remove a new team - Args: name (str): The name of the team to remove someone from body (RemoveTeamMemberParams): @@ -110,7 +106,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - RemoveTeamMemberResponse + ErrorModel | RemoveTeamMemberResponse """ return sync_detailed( @@ -125,11 +121,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: RemoveTeamMemberParams, -) -> Response[RemoveTeamMemberResponse]: +) -> Response[ErrorModel | RemoveTeamMemberResponse]: """Remove team member - Remove a new team - Args: name (str): The name of the team to remove someone from body (RemoveTeamMemberParams): @@ -139,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[RemoveTeamMemberResponse] + Response[ErrorModel | RemoveTeamMemberResponse] """ kwargs = _get_kwargs( @@ -157,11 +151,9 @@ async def asyncio( *, client: AuthenticatedClient, body: RemoveTeamMemberParams, -) -> Optional[RemoveTeamMemberResponse]: +) -> ErrorModel | RemoveTeamMemberResponse | None: """Remove team member - Remove a new team - Args: name (str): The name of the team to remove someone from body (RemoveTeamMemberParams): @@ -171,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - RemoveTeamMemberResponse + ErrorModel | RemoveTeamMemberResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/resend_email_verification.py b/src/tower/tower_api_client/api/default/resend_email_verification.py index a5f249d9..3740d15e 100644 --- a/src/tower/tower_api_client/api/default/resend_email_verification.py +++ b/src/tower/tower_api_client/api/default/resend_email_verification.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any, cast import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...types import Response @@ -18,19 +18,20 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Any]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | ErrorModel: if response.status_code == 204: - return None - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + response_204 = cast(Any, None) + return response_204 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Any]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Any | ErrorModel]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -42,7 +43,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | ErrorModel]: """Resent email verification If a user doesn't have a verified email address, this API endpoint will send a new confirmation @@ -53,7 +54,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ErrorModel] """ kwargs = _get_kwargs() @@ -65,10 +66,32 @@ def sync_detailed( return _build_response(client=client, response=response) +def sync( + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Resent email verification + + If a user doesn't have a verified email address, this API endpoint will send a new confirmation + email to them + + 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 | ErrorModel + """ + + return sync_detailed( + client=client, + ).parsed + + async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[Any]: +) -> Response[Any | ErrorModel]: """Resent email verification If a user doesn't have a verified email address, this API endpoint will send a new confirmation @@ -79,7 +102,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any] + Response[Any | ErrorModel] """ kwargs = _get_kwargs() @@ -87,3 +110,27 @@ async def asyncio_detailed( response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Any | ErrorModel | None: + """Resent email verification + + If a user doesn't have a verified email address, this API endpoint will send a new confirmation + email to them + + 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 | ErrorModel + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/resend_team_invitation.py b/src/tower/tower_api_client/api/default/resend_team_invitation.py index cf60d6e2..b519ebf1 100644 --- a/src/tower/tower_api_client/api/default/resend_team_invitation.py +++ b/src/tower/tower_api_client/api/default/resend_team_invitation.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.resend_team_invitation_params import ResendTeamInvitationParams from ...models.resend_team_invitation_response import ResendTeamInvitationResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/teams/{name}/invites/resend".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ResendTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | ResendTeamInvitationResponse: if response.status_code == 200: response_200 = ResendTeamInvitationResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ResendTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | ResendTeamInvitationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: ResendTeamInvitationParams, -) -> Response[ResendTeamInvitationResponse]: +) -> Response[ErrorModel | ResendTeamInvitationResponse]: """Resend team invitation Resend a team invitation to a user if they need a reminder or if they lost it @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ResendTeamInvitationResponse] + Response[ErrorModel | ResendTeamInvitationResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: ResendTeamInvitationParams, -) -> Optional[ResendTeamInvitationResponse]: +) -> ErrorModel | ResendTeamInvitationResponse | None: """Resend team invitation Resend a team invitation to a user if they need a reminder or if they lost it @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ResendTeamInvitationResponse + ErrorModel | ResendTeamInvitationResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ResendTeamInvitationParams, -) -> Response[ResendTeamInvitationResponse]: +) -> Response[ErrorModel | ResendTeamInvitationResponse]: """Resend team invitation Resend a team invitation to a user if they need a reminder or if they lost it @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ResendTeamInvitationResponse] + Response[ErrorModel | ResendTeamInvitationResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: ResendTeamInvitationParams, -) -> Optional[ResendTeamInvitationResponse]: +) -> ErrorModel | ResendTeamInvitationResponse | None: """Resend team invitation Resend a team invitation to a user if they need a reminder or if they lost it @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ResendTeamInvitationResponse + ErrorModel | ResendTeamInvitationResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/run_app.py b/src/tower/tower_api_client/api/default/run_app.py index 47686314..8ef5e82f 100644 --- a/src/tower/tower_api_client/api/default/run_app.py +++ b/src/tower/tower_api_client/api/default/run_app.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx @@ -21,13 +22,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/apps/{name}/runs".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -35,16 +35,18 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[Union[ErrorModel, RunAppResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | RunAppResponse | None: if response.status_code == 201: response_201 = RunAppResponse.from_dict(response.json()) return response_201 + if response.status_code == 401: response_401 = ErrorModel.from_dict(response.json()) return response_401 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -52,8 +54,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[Union[ErrorModel, RunAppResponse]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | RunAppResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,7 +69,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: RunAppParams, -) -> Response[Union[ErrorModel, RunAppResponse]]: +) -> Response[ErrorModel | RunAppResponse]: """Run app Runs an app with the supplied parameters. @@ -81,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorModel, RunAppResponse]] + Response[ErrorModel | RunAppResponse] """ kwargs = _get_kwargs( @@ -101,7 +103,7 @@ def sync( *, client: AuthenticatedClient, body: RunAppParams, -) -> Optional[Union[ErrorModel, RunAppResponse]]: +) -> ErrorModel | RunAppResponse | None: """Run app Runs an app with the supplied parameters. @@ -115,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorModel, RunAppResponse] + ErrorModel | RunAppResponse """ return sync_detailed( @@ -130,7 +132,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: RunAppParams, -) -> Response[Union[ErrorModel, RunAppResponse]]: +) -> Response[ErrorModel | RunAppResponse]: """Run app Runs an app with the supplied parameters. @@ -144,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorModel, RunAppResponse]] + Response[ErrorModel | RunAppResponse] """ kwargs = _get_kwargs( @@ -162,7 +164,7 @@ async def asyncio( *, client: AuthenticatedClient, body: RunAppParams, -) -> Optional[Union[ErrorModel, RunAppResponse]]: +) -> ErrorModel | RunAppResponse | None: """Run app Runs an app with the supplied parameters. @@ -176,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorModel, RunAppResponse] + ErrorModel | RunAppResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/search_runs.py b/src/tower/tower_api_client/api/default/search_runs.py index 329032d0..9af4f0b6 100644 --- a/src/tower/tower_api_client/api/default/search_runs.py +++ b/src/tower/tower_api_client/api/default/search_runs.py @@ -1,11 +1,11 @@ import datetime from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.search_runs_response import SearchRunsResponse from ...models.search_runs_status_item import SearchRunsStatusItem from ...types import UNSET, Response, Unset @@ -13,12 +13,12 @@ def _get_kwargs( *, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -26,7 +26,7 @@ def _get_kwargs( params["page_size"] = page_size - json_status: Union[Unset, list[str]] = UNSET + json_status: list[str] | Unset = UNSET if not isinstance(status, Unset): json_status = [] for status_item_data in status: @@ -35,12 +35,12 @@ def _get_kwargs( params["status"] = json_status - json_start_at: Union[Unset, str] = UNSET + json_start_at: str | Unset = UNSET if not isinstance(start_at, Unset): json_start_at = start_at.isoformat() params["start_at"] = json_start_at - json_end_at: Union[Unset, str] = UNSET + json_end_at: str | Unset = UNSET if not isinstance(end_at, Unset): json_end_at = end_at.isoformat() params["end_at"] = json_end_at @@ -59,21 +59,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[SearchRunsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | SearchRunsResponse: if response.status_code == 200: response_200 = SearchRunsResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[SearchRunsResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | SearchRunsResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,35 +85,35 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[SearchRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | SearchRunsResponse]: """Search runs Search, filter, and list runs across all of the apps in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[SearchRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[SearchRunsResponse] + Response[ErrorModel | SearchRunsResponse] """ kwargs = _get_kwargs( @@ -135,35 +135,35 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[SearchRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | SearchRunsResponse | None: """Search runs Search, filter, and list runs across all of the apps in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[SearchRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - SearchRunsResponse + ErrorModel | SearchRunsResponse """ return sync_detailed( @@ -180,35 +180,35 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Response[SearchRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> Response[ErrorModel | SearchRunsResponse]: """Search runs Search, filter, and list runs across all of the apps in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[SearchRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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[SearchRunsResponse] + Response[ErrorModel | SearchRunsResponse] """ kwargs = _get_kwargs( @@ -228,35 +228,35 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - page: Union[Unset, int] = 1, - page_size: Union[Unset, int] = 20, - status: Union[Unset, list[SearchRunsStatusItem]] = UNSET, - start_at: Union[Unset, datetime.datetime] = UNSET, - end_at: Union[Unset, datetime.datetime] = UNSET, - environment: Union[Unset, str] = UNSET, -) -> Optional[SearchRunsResponse]: + page: int | Unset = 1, + page_size: int | Unset = 20, + status: list[SearchRunsStatusItem] | Unset = UNSET, + start_at: datetime.datetime | Unset = UNSET, + end_at: datetime.datetime | Unset = UNSET, + environment: str | Unset = UNSET, +) -> ErrorModel | SearchRunsResponse | None: """Search runs Search, filter, and list runs across all of the apps in your account. Args: - page (Union[Unset, int]): The page number to fetch. Default: 1. - page_size (Union[Unset, int]): The number of records to fetch on each page. Default: 20. - status (Union[Unset, list[SearchRunsStatusItem]]): Filter runs by status(es). Define - multiple with a comma-separated list. Supplying none will return all statuses. - start_at (Union[Unset, datetime.datetime]): Filter runs scheduled after this datetime + page (int | Unset): The page number to fetch. Default: 1. + page_size (int | Unset): The number of records to fetch on each page. Default: 20. + status (list[SearchRunsStatusItem] | Unset): Filter runs by status(es). Define multiple + with a comma-separated list. Supplying none will return all statuses. + start_at (datetime.datetime | Unset): Filter runs scheduled after this datetime (inclusive). Provide timestamps in ISO-8601 format. - end_at (Union[Unset, datetime.datetime]): Filter runs scheduled before or at this datetime + end_at (datetime.datetime | Unset): Filter runs scheduled before or at this datetime (inclusive). Provide timestamps in ISO-8601 format. - environment (Union[Unset, str]): Filter runs by environment. If not provided, all - environments will be included. + environment (str | Unset): Filter runs by environment. If not provided, all environments + will be included. 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: - SearchRunsResponse + ErrorModel | SearchRunsResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/stream_alerts.py b/src/tower/tower_api_client/api/default/stream_alerts.py index ea91aca0..8339c35b 100644 --- a/src/tower/tower_api_client/api/default/stream_alerts.py +++ b/src/tower/tower_api_client/api/default/stream_alerts.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.stream_alerts_event_alert import StreamAlertsEventAlert from ...models.stream_alerts_event_error import StreamAlertsEventError from ...types import Response @@ -20,8 +20,8 @@ def _get_kwargs() -> dict[str, Any]: def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]: if response.status_code == 200: response_200 = [] _response_200 = response.text @@ -29,35 +29,37 @@ def _parse_response( def _parse_response_200_item( data: object, - ) -> Union["StreamAlertsEventAlert", "StreamAlertsEventError"]: + ) -> StreamAlertsEventAlert | StreamAlertsEventError: try: if not isinstance(data, dict): raise TypeError() - response_200_item_type_0 = StreamAlertsEventAlert.from_dict(data) + response_200_item_event_alert = StreamAlertsEventAlert.from_dict( + data + ) - return response_200_item_type_0 - except: # noqa: E722 + return response_200_item_event_alert + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() - response_200_item_type_1 = StreamAlertsEventError.from_dict(data) + response_200_item_event_error = StreamAlertsEventError.from_dict(data) - return response_200_item_type_1 + return response_200_item_event_error response_200_item = _parse_response_200_item(response_200_item_data) response_200.append(response_200_item) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,7 +71,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: """Stream alert notifications Streams alert notifications in real-time @@ -79,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']]] + Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] """ kwargs = _get_kwargs() @@ -94,7 +96,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: """Stream alert notifications Streams alert notifications in real-time @@ -104,7 +106,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']] + ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] """ return sync_detailed( @@ -115,7 +117,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: +) -> Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]]: """Stream alert notifications Streams alert notifications in real-time @@ -125,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']]] + Response[ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError]] """ kwargs = _get_kwargs() @@ -138,7 +140,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> Optional[list[Union["StreamAlertsEventAlert", "StreamAlertsEventError"]]]: +) -> ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] | None: """Stream alert notifications Streams alert notifications in real-time @@ -148,7 +150,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamAlertsEventAlert', 'StreamAlertsEventError']] + ErrorModel | list[StreamAlertsEventAlert | StreamAlertsEventError] """ return ( diff --git a/src/tower/tower_api_client/api/default/stream_run_logs.py b/src/tower/tower_api_client/api/default/stream_run_logs.py index ae252d07..d203deba 100644 --- a/src/tower/tower_api_client/api/default/stream_run_logs.py +++ b/src/tower/tower_api_client/api/default/stream_run_logs.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.stream_run_logs_event_log import StreamRunLogsEventLog from ...models.stream_run_logs_event_warning import StreamRunLogsEventWarning from ...types import Response @@ -17,8 +18,8 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/apps/{name}/runs/{seq}/logs/stream".format( - name=name, - seq=seq, + name=quote(str(name), safe=""), + seq=quote(str(seq), safe=""), ), } @@ -26,8 +27,8 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]: if response.status_code == 200: response_200 = [] _response_200 = response.text @@ -35,35 +36,37 @@ def _parse_response( def _parse_response_200_item( data: object, - ) -> Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]: + ) -> StreamRunLogsEventLog | StreamRunLogsEventWarning: try: if not isinstance(data, dict): raise TypeError() - response_200_item_type_0 = StreamRunLogsEventLog.from_dict(data) + response_200_item_event_log = StreamRunLogsEventLog.from_dict(data) - return response_200_item_type_0 - except: # noqa: E722 + return response_200_item_event_log + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() - response_200_item_type_1 = StreamRunLogsEventWarning.from_dict(data) + response_200_item_event_warning = StreamRunLogsEventWarning.from_dict( + data + ) - return response_200_item_type_1 + return response_200_item_event_warning response_200_item = _parse_response_200_item(response_200_item_data) response_200.append(response_200_item) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,7 +80,7 @@ def sync_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -91,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']]] + Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] """ kwargs = _get_kwargs( @@ -111,7 +114,7 @@ def sync( seq: int, *, client: AuthenticatedClient, -) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -125,7 +128,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']] + ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] """ return sync_detailed( @@ -140,7 +143,7 @@ async def asyncio_detailed( seq: int, *, client: AuthenticatedClient, -) -> Response[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: +) -> Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]]: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -154,7 +157,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']]] + Response[ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning]] """ kwargs = _get_kwargs( @@ -172,7 +175,7 @@ async def asyncio( seq: int, *, client: AuthenticatedClient, -) -> Optional[list[Union["StreamRunLogsEventLog", "StreamRunLogsEventWarning"]]]: +) -> ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] | None: """Stream run logs Streams the logs associated with a particular run of an app in real-time. @@ -186,7 +189,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - list[Union['StreamRunLogsEventLog', 'StreamRunLogsEventWarning']] + ErrorModel | list[StreamRunLogsEventLog | StreamRunLogsEventWarning] """ return ( diff --git a/src/tower/tower_api_client/api/default/stream_shouldertaps.py b/src/tower/tower_api_client/api/default/stream_shouldertaps.py new file mode 100644 index 00000000..639307e2 --- /dev/null +++ b/src/tower/tower_api_client/api/default/stream_shouldertaps.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.stream_shouldertaps_event_shouldertap import ( + StreamShouldertapsEventShouldertap, +) +from ...models.stream_shouldertaps_event_warning import StreamShouldertapsEventWarning +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/shouldertaps/stream", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +): + if response.status_code == 200: + response_200 = [] + _response_200 = response.text + for response_200_item_data in _response_200: + + def _parse_response_200_item( + data: object, + ) -> StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning: + try: + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_shouldertap = ( + StreamShouldertapsEventShouldertap.from_dict(data) + ) + + return response_200_item_event_shouldertap + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + response_200_item_event_warning = ( + StreamShouldertapsEventWarning.from_dict(data) + ) + + return response_200_item_event_warning + + response_200_item = _parse_response_200_item(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + 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[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + 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[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + | None +): + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + 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: + ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[ + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] +]: + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + 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[ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> ( + ErrorModel + | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + | None +): + """Stream shouldertaps + + Stream events over SSE that notify you of potential data staleness + + 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: + ErrorModel | list[StreamShouldertapsEventShouldertap | StreamShouldertapsEventWarning] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_account.py b/src/tower/tower_api_client/api/default/update_account.py index 84cd843a..d5425c46 100644 --- a/src/tower/tower_api_client/api/default/update_account.py +++ b/src/tower/tower_api_client/api/default/update_account.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_account_params import UpdateAccountParams from ...models.update_account_response import UpdateAccountResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/accounts/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateAccountResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateAccountResponse: if response.status_code == 200: response_200 = UpdateAccountResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateAccountResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateAccountResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAccountParams, -) -> Response[UpdateAccountResponse]: +) -> Response[ErrorModel | UpdateAccountResponse]: """Update account Update the properties of an account @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateAccountResponse] + Response[ErrorModel | UpdateAccountResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAccountParams, -) -> Optional[UpdateAccountResponse]: +) -> ErrorModel | UpdateAccountResponse | None: """Update account Update the properties of an account @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateAccountResponse + ErrorModel | UpdateAccountResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAccountParams, -) -> Response[UpdateAccountResponse]: +) -> Response[ErrorModel | UpdateAccountResponse]: """Update account Update the properties of an account @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateAccountResponse] + Response[ErrorModel | UpdateAccountResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAccountParams, -) -> Optional[UpdateAccountResponse]: +) -> ErrorModel | UpdateAccountResponse | None: """Update account Update the properties of an account @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateAccountResponse + ErrorModel | UpdateAccountResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_app.py b/src/tower/tower_api_client/api/default/update_app.py index 5d08dbf0..6e68bd0c 100644 --- a/src/tower/tower_api_client/api/default/update_app.py +++ b/src/tower/tower_api_client/api/default/update_app.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_app_params import UpdateAppParams from ...models.update_app_response import UpdateAppResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/apps/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateAppResponse: if response.status_code == 200: response_200 = UpdateAppResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateAppResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateAppResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAppParams, -) -> Response[UpdateAppResponse]: +) -> Response[ErrorModel | UpdateAppResponse]: """Update app Update an app in the currently authenticated account. @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateAppResponse] + Response[ErrorModel | UpdateAppResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateAppParams, -) -> Optional[UpdateAppResponse]: +) -> ErrorModel | UpdateAppResponse | None: """Update app Update an app in the currently authenticated account. @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateAppResponse + ErrorModel | UpdateAppResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAppParams, -) -> Response[UpdateAppResponse]: +) -> Response[ErrorModel | UpdateAppResponse]: """Update app Update an app in the currently authenticated account. @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateAppResponse] + Response[ErrorModel | UpdateAppResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateAppParams, -) -> Optional[UpdateAppResponse]: +) -> ErrorModel | UpdateAppResponse | None: """Update app Update an app in the currently authenticated account. @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateAppResponse + ErrorModel | UpdateAppResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_catalog.py b/src/tower/tower_api_client/api/default/update_catalog.py index e0f76737..446a800c 100644 --- a/src/tower/tower_api_client/api/default/update_catalog.py +++ b/src/tower/tower_api_client/api/default/update_catalog.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_catalog_params import UpdateCatalogParams from ...models.update_catalog_response import UpdateCatalogResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/catalogs/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateCatalogResponse: if response.status_code == 200: response_200 = UpdateCatalogResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateCatalogResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateCatalogResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCatalogParams, -) -> Response[UpdateCatalogResponse]: +) -> Response[ErrorModel | UpdateCatalogResponse]: """Update catalog Update a new catalog object in the currently authenticated account. @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateCatalogResponse] + Response[ErrorModel | UpdateCatalogResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateCatalogParams, -) -> Optional[UpdateCatalogResponse]: +) -> ErrorModel | UpdateCatalogResponse | None: """Update catalog Update a new catalog object in the currently authenticated account. @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateCatalogResponse + ErrorModel | UpdateCatalogResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCatalogParams, -) -> Response[UpdateCatalogResponse]: +) -> Response[ErrorModel | UpdateCatalogResponse]: """Update catalog Update a new catalog object in the currently authenticated account. @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateCatalogResponse] + Response[ErrorModel | UpdateCatalogResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateCatalogParams, -) -> Optional[UpdateCatalogResponse]: +) -> ErrorModel | UpdateCatalogResponse | None: """Update catalog Update a new catalog object in the currently authenticated account. @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateCatalogResponse + ErrorModel | UpdateCatalogResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_email_preferences.py b/src/tower/tower_api_client/api/default/update_email_preferences.py index be0a527f..ede38b4b 100644 --- a/src/tower/tower_api_client/api/default/update_email_preferences.py +++ b/src/tower/tower_api_client/api/default/update_email_preferences.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_email_preferences_body import UpdateEmailPreferencesBody from ...types import Response @@ -20,9 +20,8 @@ def _get_kwargs( "url": "/user/email-preferences", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -30,21 +29,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateEmailPreferencesBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateEmailPreferencesBody: if response.status_code == 200: response_200 = UpdateEmailPreferencesBody.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateEmailPreferencesBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -57,7 +56,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEmailPreferencesBody, -) -> Response[UpdateEmailPreferencesBody]: +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: """Update email preferences Updates the set of email preferences the current user has. If a partial set of preferences is @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateEmailPreferencesBody] + Response[ErrorModel | UpdateEmailPreferencesBody] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEmailPreferencesBody, -) -> Optional[UpdateEmailPreferencesBody]: +) -> ErrorModel | UpdateEmailPreferencesBody | None: """Update email preferences Updates the set of email preferences the current user has. If a partial set of preferences is @@ -103,7 +102,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateEmailPreferencesBody + ErrorModel | UpdateEmailPreferencesBody """ return sync_detailed( @@ -116,7 +115,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEmailPreferencesBody, -) -> Response[UpdateEmailPreferencesBody]: +) -> Response[ErrorModel | UpdateEmailPreferencesBody]: """Update email preferences Updates the set of email preferences the current user has. If a partial set of preferences is @@ -130,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateEmailPreferencesBody] + Response[ErrorModel | UpdateEmailPreferencesBody] """ kwargs = _get_kwargs( @@ -146,7 +145,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEmailPreferencesBody, -) -> Optional[UpdateEmailPreferencesBody]: +) -> ErrorModel | UpdateEmailPreferencesBody | None: """Update email preferences Updates the set of email preferences the current user has. If a partial set of preferences is @@ -160,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateEmailPreferencesBody + ErrorModel | UpdateEmailPreferencesBody """ return ( diff --git a/src/tower/tower_api_client/api/default/update_environment.py b/src/tower/tower_api_client/api/default/update_environment.py index 967e1368..c0a2f94a 100644 --- a/src/tower/tower_api_client/api/default/update_environment.py +++ b/src/tower/tower_api_client/api/default/update_environment.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_environment_params import UpdateEnvironmentParams from ...models.update_environment_response import UpdateEnvironmentResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/environments/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateEnvironmentResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateEnvironmentResponse: if response.status_code == 200: response_200 = UpdateEnvironmentResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateEnvironmentResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateEnvironmentResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateEnvironmentParams, -) -> Response[UpdateEnvironmentResponse]: +) -> Response[ErrorModel | UpdateEnvironmentResponse]: """Update environment Rename your environment @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateEnvironmentResponse] + Response[ErrorModel | UpdateEnvironmentResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateEnvironmentParams, -) -> Optional[UpdateEnvironmentResponse]: +) -> ErrorModel | UpdateEnvironmentResponse | None: """Update environment Rename your environment @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateEnvironmentResponse + ErrorModel | UpdateEnvironmentResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateEnvironmentParams, -) -> Response[UpdateEnvironmentResponse]: +) -> Response[ErrorModel | UpdateEnvironmentResponse]: """Update environment Rename your environment @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateEnvironmentResponse] + Response[ErrorModel | UpdateEnvironmentResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateEnvironmentParams, -) -> Optional[UpdateEnvironmentResponse]: +) -> ErrorModel | UpdateEnvironmentResponse | None: """Update environment Rename your environment @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateEnvironmentResponse + ErrorModel | UpdateEnvironmentResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_my_team_invitation.py b/src/tower/tower_api_client/api/default/update_my_team_invitation.py index 931f0ceb..823c9058 100644 --- a/src/tower/tower_api_client/api/default/update_my_team_invitation.py +++ b/src/tower/tower_api_client/api/default/update_my_team_invitation.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_my_team_invitation_params import UpdateMyTeamInvitationParams from ...models.update_my_team_invitation_response import UpdateMyTeamInvitationResponse from ...types import Response @@ -21,9 +22,8 @@ def _get_kwargs( "url": "/team-invites", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,12 +31,28 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateMyTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: if response.status_code == 200: response_200 = UpdateMyTeamInvitationResponse.from_dict(response.json()) return response_200 + + if response.status_code == 404: + response_404 = ErrorModel.from_dict(response.json()) + + return response_404 + + if response.status_code == 422: + response_422 = ErrorModel.from_dict(response.json()) + + return response_422 + + if response.status_code == 500: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -44,8 +60,8 @@ def _parse_response( def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateMyTeamInvitationResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +74,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateMyTeamInvitationParams, -) -> Response[UpdateMyTeamInvitationResponse]: +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: """Update my team invitation Update a team invitation that you have pending @@ -71,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateMyTeamInvitationResponse] + Response[ErrorModel | UpdateMyTeamInvitationResponse] """ kwargs = _get_kwargs( @@ -89,7 +105,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateMyTeamInvitationParams, -) -> Optional[UpdateMyTeamInvitationResponse]: +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: """Update my team invitation Update a team invitation that you have pending @@ -102,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateMyTeamInvitationResponse + ErrorModel | UpdateMyTeamInvitationResponse """ return sync_detailed( @@ -115,7 +131,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateMyTeamInvitationParams, -) -> Response[UpdateMyTeamInvitationResponse]: +) -> Response[ErrorModel | UpdateMyTeamInvitationResponse]: """Update my team invitation Update a team invitation that you have pending @@ -128,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateMyTeamInvitationResponse] + Response[ErrorModel | UpdateMyTeamInvitationResponse] """ kwargs = _get_kwargs( @@ -144,7 +160,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateMyTeamInvitationParams, -) -> Optional[UpdateMyTeamInvitationResponse]: +) -> ErrorModel | UpdateMyTeamInvitationResponse | None: """Update my team invitation Update a team invitation that you have pending @@ -157,7 +173,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateMyTeamInvitationResponse + ErrorModel | UpdateMyTeamInvitationResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_organization.py b/src/tower/tower_api_client/api/default/update_organization.py new file mode 100644 index 00000000..65f48c39 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_organization.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_organization_params import UpdateOrganizationParams +from ...models.update_organization_response import UpdateOrganizationResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateOrganizationParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/organizations/{name}".format( + name=quote(str(name), 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 +) -> ErrorModel | UpdateOrganizationResponse: + if response.status_code == 200: + response_200 = UpdateOrganizationResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateOrganizationResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> Response[ErrorModel | UpdateOrganizationResponse]: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + 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[ErrorModel | UpdateOrganizationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> ErrorModel | UpdateOrganizationResponse | None: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + 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: + ErrorModel | UpdateOrganizationResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> Response[ErrorModel | UpdateOrganizationResponse]: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + 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[ErrorModel | UpdateOrganizationResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateOrganizationParams, +) -> ErrorModel | UpdateOrganizationResponse | None: + """Update organization + + Update an organization's name. Only the current owner can perform this operation. + + Args: + name (str): The current name of the organization to update + body (UpdateOrganizationParams): + + 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: + ErrorModel | UpdateOrganizationResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_password_reset.py b/src/tower/tower_api_client/api/default/update_password_reset.py index b5ad6c2c..33097d74 100644 --- a/src/tower/tower_api_client/api/default/update_password_reset.py +++ b/src/tower/tower_api_client/api/default/update_password_reset.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_password_reset_params import UpdatePasswordResetParams from ...models.update_password_reset_response import UpdatePasswordResetResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", "url": "/accounts/password-reset/{code}".format( - code=code, + code=quote(str(code), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdatePasswordResetResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdatePasswordResetResponse: if response.status_code == 200: response_200 = UpdatePasswordResetResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdatePasswordResetResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdatePasswordResetResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -60,9 +60,9 @@ def _build_response( def sync_detailed( code: str, *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: UpdatePasswordResetParams, -) -> Response[UpdatePasswordResetResponse]: +) -> Response[ErrorModel | UpdatePasswordResetResponse]: """Update password reset Updates the password reset code with the new password @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdatePasswordResetResponse] + Response[ErrorModel | UpdatePasswordResetResponse] """ kwargs = _get_kwargs( @@ -94,9 +94,9 @@ def sync_detailed( def sync( code: str, *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: UpdatePasswordResetParams, -) -> Optional[UpdatePasswordResetResponse]: +) -> ErrorModel | UpdatePasswordResetResponse | None: """Update password reset Updates the password reset code with the new password @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdatePasswordResetResponse + ErrorModel | UpdatePasswordResetResponse """ return sync_detailed( @@ -123,9 +123,9 @@ def sync( async def asyncio_detailed( code: str, *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: UpdatePasswordResetParams, -) -> Response[UpdatePasswordResetResponse]: +) -> Response[ErrorModel | UpdatePasswordResetResponse]: """Update password reset Updates the password reset code with the new password @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdatePasswordResetResponse] + Response[ErrorModel | UpdatePasswordResetResponse] """ kwargs = _get_kwargs( @@ -155,9 +155,9 @@ async def asyncio_detailed( async def asyncio( code: str, *, - client: Union[AuthenticatedClient, Client], + client: AuthenticatedClient | Client, body: UpdatePasswordResetParams, -) -> Optional[UpdatePasswordResetResponse]: +) -> ErrorModel | UpdatePasswordResetResponse | None: """Update password reset Updates the password reset code with the new password @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdatePasswordResetResponse + ErrorModel | UpdatePasswordResetResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_plan.py b/src/tower/tower_api_client/api/default/update_plan.py index f3c5a220..bddc9deb 100644 --- a/src/tower/tower_api_client/api/default/update_plan.py +++ b/src/tower/tower_api_client/api/default/update_plan.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_plan_params import UpdatePlanParams from ...models.update_plan_response import UpdatePlanResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/plan", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdatePlanResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdatePlanResponse: if response.status_code == 201: response_201 = UpdatePlanResponse.from_dict(response.json()) return response_201 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdatePlanResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdatePlanResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdatePlanParams, -) -> Response[UpdatePlanResponse]: +) -> Response[ErrorModel | UpdatePlanResponse]: """Update plan Args: @@ -69,7 +68,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdatePlanResponse] + Response[ErrorModel | UpdatePlanResponse] """ kwargs = _get_kwargs( @@ -87,7 +86,7 @@ def sync( *, client: AuthenticatedClient, body: UpdatePlanParams, -) -> Optional[UpdatePlanResponse]: +) -> ErrorModel | UpdatePlanResponse | None: """Update plan Args: @@ -98,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdatePlanResponse + ErrorModel | UpdatePlanResponse """ return sync_detailed( @@ -111,7 +110,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdatePlanParams, -) -> Response[UpdatePlanResponse]: +) -> Response[ErrorModel | UpdatePlanResponse]: """Update plan Args: @@ -122,7 +121,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdatePlanResponse] + Response[ErrorModel | UpdatePlanResponse] """ kwargs = _get_kwargs( @@ -138,7 +137,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdatePlanParams, -) -> Optional[UpdatePlanResponse]: +) -> ErrorModel | UpdatePlanResponse | None: """Update plan Args: @@ -149,7 +148,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdatePlanResponse + ErrorModel | UpdatePlanResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_schedule.py b/src/tower/tower_api_client/api/default/update_schedule.py index 00ca07a6..33a68f47 100644 --- a/src/tower/tower_api_client/api/default/update_schedule.py +++ b/src/tower/tower_api_client/api/default/update_schedule.py @@ -1,17 +1,18 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_schedule_params import UpdateScheduleParams from ...models.update_schedule_response import UpdateScheduleResponse from ...types import Response def _get_kwargs( - id: str, + id_or_name: str, *, body: UpdateScheduleParams, ) -> dict[str, Any]: @@ -19,14 +20,13 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": "/schedules/{id}".format( - id=id, + "url": "/schedules/{id_or_name}".format( + id_or_name=quote(str(id_or_name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateScheduleResponse: if response.status_code == 200: response_200 = UpdateScheduleResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateScheduleResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateScheduleResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,17 +58,17 @@ def _build_response( def sync_detailed( - id: str, + id_or_name: str, *, client: AuthenticatedClient, body: UpdateScheduleParams, -) -> Response[UpdateScheduleResponse]: +) -> Response[ErrorModel | UpdateScheduleResponse]: """Update schedule Update an existing schedule for an app. Args: - id (str): The ID of the schedule to update. + id_or_name (str): The ID or name of the schedule to update. body (UpdateScheduleParams): Raises: @@ -76,11 +76,11 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateScheduleResponse] + Response[ErrorModel | UpdateScheduleResponse] """ kwargs = _get_kwargs( - id=id, + id_or_name=id_or_name, body=body, ) @@ -92,17 +92,17 @@ def sync_detailed( def sync( - id: str, + id_or_name: str, *, client: AuthenticatedClient, body: UpdateScheduleParams, -) -> Optional[UpdateScheduleResponse]: +) -> ErrorModel | UpdateScheduleResponse | None: """Update schedule Update an existing schedule for an app. Args: - id (str): The ID of the schedule to update. + id_or_name (str): The ID or name of the schedule to update. body (UpdateScheduleParams): Raises: @@ -110,28 +110,28 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateScheduleResponse + ErrorModel | UpdateScheduleResponse """ return sync_detailed( - id=id, + id_or_name=id_or_name, client=client, body=body, ).parsed async def asyncio_detailed( - id: str, + id_or_name: str, *, client: AuthenticatedClient, body: UpdateScheduleParams, -) -> Response[UpdateScheduleResponse]: +) -> Response[ErrorModel | UpdateScheduleResponse]: """Update schedule Update an existing schedule for an app. Args: - id (str): The ID of the schedule to update. + id_or_name (str): The ID or name of the schedule to update. body (UpdateScheduleParams): Raises: @@ -139,11 +139,11 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateScheduleResponse] + Response[ErrorModel | UpdateScheduleResponse] """ kwargs = _get_kwargs( - id=id, + id_or_name=id_or_name, body=body, ) @@ -153,17 +153,17 @@ async def asyncio_detailed( async def asyncio( - id: str, + id_or_name: str, *, client: AuthenticatedClient, body: UpdateScheduleParams, -) -> Optional[UpdateScheduleResponse]: +) -> ErrorModel | UpdateScheduleResponse | None: """Update schedule Update an existing schedule for an app. Args: - id (str): The ID of the schedule to update. + id_or_name (str): The ID or name of the schedule to update. body (UpdateScheduleParams): Raises: @@ -171,12 +171,12 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateScheduleResponse + ErrorModel | UpdateScheduleResponse """ return ( await asyncio_detailed( - id=id, + id_or_name=id_or_name, client=client, body=body, ) diff --git a/src/tower/tower_api_client/api/default/update_secret.py b/src/tower/tower_api_client/api/default/update_secret.py index 2c4e7e3f..af711f95 100644 --- a/src/tower/tower_api_client/api/default/update_secret.py +++ b/src/tower/tower_api_client/api/default/update_secret.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_secret_params import UpdateSecretParams from ...models.update_secret_response import UpdateSecretResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/secrets/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateSecretResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateSecretResponse: if response.status_code == 200: response_200 = UpdateSecretResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateSecretResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateSecretResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateSecretParams, -) -> Response[UpdateSecretResponse]: +) -> Response[ErrorModel | UpdateSecretResponse]: """Update secret Updates a secret that has previously been created in your account @@ -76,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateSecretResponse] + Response[ErrorModel | UpdateSecretResponse] """ kwargs = _get_kwargs( @@ -96,7 +96,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateSecretParams, -) -> Optional[UpdateSecretResponse]: +) -> ErrorModel | UpdateSecretResponse | None: """Update secret Updates a secret that has previously been created in your account @@ -110,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateSecretResponse + ErrorModel | UpdateSecretResponse """ return sync_detailed( @@ -125,7 +125,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateSecretParams, -) -> Response[UpdateSecretResponse]: +) -> Response[ErrorModel | UpdateSecretResponse]: """Update secret Updates a secret that has previously been created in your account @@ -139,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateSecretResponse] + Response[ErrorModel | UpdateSecretResponse] """ kwargs = _get_kwargs( @@ -157,7 +157,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateSecretParams, -) -> Optional[UpdateSecretResponse]: +) -> ErrorModel | UpdateSecretResponse | None: """Update secret Updates a secret that has previously been created in your account @@ -171,7 +171,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateSecretResponse + ErrorModel | UpdateSecretResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_team.py b/src/tower/tower_api_client/api/default/update_team.py index 9d094fce..89a10a6e 100644 --- a/src/tower/tower_api_client/api/default/update_team.py +++ b/src/tower/tower_api_client/api/default/update_team.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_team_params import UpdateTeamParams from ...models.update_team_response import UpdateTeamResponse from ...types import Response @@ -20,13 +21,12 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", "url": "/teams/{name}".format( - name=name, + name=quote(str(name), safe=""), ), } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -34,21 +34,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateTeamResponse: if response.status_code == 200: response_200 = UpdateTeamResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateTeamResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateTeamResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,7 +62,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateTeamParams, -) -> Response[UpdateTeamResponse]: +) -> Response[ErrorModel | UpdateTeamResponse]: """Update team Update a team with a new name or name. Note that updating the team with a new name will cause all @@ -77,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateTeamResponse] + Response[ErrorModel | UpdateTeamResponse] """ kwargs = _get_kwargs( @@ -97,7 +97,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateTeamParams, -) -> Optional[UpdateTeamResponse]: +) -> ErrorModel | UpdateTeamResponse | None: """Update team Update a team with a new name or name. Note that updating the team with a new name will cause all @@ -112,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateTeamResponse + ErrorModel | UpdateTeamResponse """ return sync_detailed( @@ -127,7 +127,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateTeamParams, -) -> Response[UpdateTeamResponse]: +) -> Response[ErrorModel | UpdateTeamResponse]: """Update team Update a team with a new name or name. Note that updating the team with a new name will cause all @@ -142,7 +142,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateTeamResponse] + Response[ErrorModel | UpdateTeamResponse] """ kwargs = _get_kwargs( @@ -160,7 +160,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateTeamParams, -) -> Optional[UpdateTeamResponse]: +) -> ErrorModel | UpdateTeamResponse | None: """Update team Update a team with a new name or name. Note that updating the team with a new name will cause all @@ -175,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateTeamResponse + ErrorModel | UpdateTeamResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_team_member.py b/src/tower/tower_api_client/api/default/update_team_member.py new file mode 100644 index 00000000..cc151a65 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_team_member.py @@ -0,0 +1,175 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_team_member_params import UpdateTeamMemberParams +from ...models.update_team_member_response import UpdateTeamMemberResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateTeamMemberParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/teams/{name}/members".format( + name=quote(str(name), 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 +) -> ErrorModel | UpdateTeamMemberResponse: + if response.status_code == 200: + response_200 = UpdateTeamMemberResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + 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[ErrorModel | UpdateTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> ErrorModel | UpdateTeamMemberResponse | None: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + 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: + ErrorModel | UpdateTeamMemberResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> Response[ErrorModel | UpdateTeamMemberResponse]: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + 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[ErrorModel | UpdateTeamMemberResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateTeamMemberParams, +) -> ErrorModel | UpdateTeamMemberResponse | None: + """Update team member + + Args: + name (str): The name of the team + body (UpdateTeamMemberParams): + + 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: + ErrorModel | UpdateTeamMemberResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/update_user.py b/src/tower/tower_api_client/api/default/update_user.py index acab84c4..26298fe3 100644 --- a/src/tower/tower_api_client/api/default/update_user.py +++ b/src/tower/tower_api_client/api/default/update_user.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.update_user_params import UpdateUserParams from ...models.update_user_response import UpdateUserResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/user", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[UpdateUserResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | UpdateUserResponse: if response.status_code == 200: response_200 = UpdateUserResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[UpdateUserResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateUserResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateUserParams, -) -> Response[UpdateUserResponse]: +) -> Response[ErrorModel | UpdateUserResponse]: """Update user profile Updates your current user profile. @@ -71,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateUserResponse] + Response[ErrorModel | UpdateUserResponse] """ kwargs = _get_kwargs( @@ -89,7 +88,7 @@ def sync( *, client: AuthenticatedClient, body: UpdateUserParams, -) -> Optional[UpdateUserResponse]: +) -> ErrorModel | UpdateUserResponse | None: """Update user profile Updates your current user profile. @@ -102,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateUserResponse + ErrorModel | UpdateUserResponse """ return sync_detailed( @@ -115,7 +114,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateUserParams, -) -> Response[UpdateUserResponse]: +) -> Response[ErrorModel | UpdateUserResponse]: """Update user profile Updates your current user profile. @@ -128,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[UpdateUserResponse] + Response[ErrorModel | UpdateUserResponse] """ kwargs = _get_kwargs( @@ -144,7 +143,7 @@ async def asyncio( *, client: AuthenticatedClient, body: UpdateUserParams, -) -> Optional[UpdateUserResponse]: +) -> ErrorModel | UpdateUserResponse | None: """Update user profile Updates your current user profile. @@ -157,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - UpdateUserResponse + ErrorModel | UpdateUserResponse """ return ( diff --git a/src/tower/tower_api_client/api/default/update_webhook.py b/src/tower/tower_api_client/api/default/update_webhook.py new file mode 100644 index 00000000..7ee5b4c5 --- /dev/null +++ b/src/tower/tower_api_client/api/default/update_webhook.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.update_webhook_params import UpdateWebhookParams +from ...models.update_webhook_response import UpdateWebhookResponse +from ...types import Response + + +def _get_kwargs( + name: str, + *, + body: UpdateWebhookParams, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/webhooks/{name}".format( + name=quote(str(name), 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 +) -> ErrorModel | UpdateWebhookResponse: + if response.status_code == 200: + response_200 = UpdateWebhookResponse.from_dict(response.json()) + + return response_200 + + response_default = ErrorModel.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | UpdateWebhookResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> Response[ErrorModel | UpdateWebhookResponse]: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + 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[ErrorModel | UpdateWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> ErrorModel | UpdateWebhookResponse | None: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + 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: + ErrorModel | UpdateWebhookResponse + """ + + return sync_detailed( + name=name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> Response[ErrorModel | UpdateWebhookResponse]: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + 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[ErrorModel | UpdateWebhookResponse] + """ + + kwargs = _get_kwargs( + name=name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + name: str, + *, + client: AuthenticatedClient, + body: UpdateWebhookParams, +) -> ErrorModel | UpdateWebhookResponse | None: + """Update webhook + + Updates webhook. Note: it is not possible to update the URL. To do so, you should delete and + recreate the webhook instead. + + Args: + name (str): The name of the webhook. + body (UpdateWebhookParams): + + 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: + ErrorModel | UpdateWebhookResponse + """ + + return ( + await asyncio_detailed( + name=name, + client=client, + body=body, + ) + ).parsed diff --git a/src/tower/tower_api_client/api/default/verify_email.py b/src/tower/tower_api_client/api/default/verify_email.py index 916008c6..7a797a8e 100644 --- a/src/tower/tower_api_client/api/default/verify_email.py +++ b/src/tower/tower_api_client/api/default/verify_email.py @@ -1,10 +1,10 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.verify_email_params import VerifyEmailParams from ...models.verify_email_response import VerifyEmailResponse from ...types import Response @@ -21,9 +21,8 @@ def _get_kwargs( "url": "/user/verify", } - _body = body.to_dict() + _kwargs["json"] = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" _kwargs["headers"] = headers @@ -31,21 +30,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[VerifyEmailResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | VerifyEmailResponse: if response.status_code == 200: response_200 = VerifyEmailResponse.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[VerifyEmailResponse]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | VerifyEmailResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,7 +57,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: VerifyEmailParams, -) -> Response[VerifyEmailResponse]: +) -> Response[ErrorModel | VerifyEmailResponse]: """Verify email If the user hasn't verified their email address, this API endpoint allows them to send a @@ -72,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[VerifyEmailResponse] + Response[ErrorModel | VerifyEmailResponse] """ kwargs = _get_kwargs( @@ -90,7 +89,7 @@ def sync( *, client: AuthenticatedClient, body: VerifyEmailParams, -) -> Optional[VerifyEmailResponse]: +) -> ErrorModel | VerifyEmailResponse | None: """Verify email If the user hasn't verified their email address, this API endpoint allows them to send a @@ -104,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - VerifyEmailResponse + ErrorModel | VerifyEmailResponse """ return sync_detailed( @@ -117,7 +116,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: VerifyEmailParams, -) -> Response[VerifyEmailResponse]: +) -> Response[ErrorModel | VerifyEmailResponse]: """Verify email If the user hasn't verified their email address, this API endpoint allows them to send a @@ -131,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[VerifyEmailResponse] + Response[ErrorModel | VerifyEmailResponse] """ kwargs = _get_kwargs( @@ -147,7 +146,7 @@ async def asyncio( *, client: AuthenticatedClient, body: VerifyEmailParams, -) -> Optional[VerifyEmailResponse]: +) -> ErrorModel | VerifyEmailResponse | None: """Verify email If the user hasn't verified their email address, this API endpoint allows them to send a @@ -161,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - VerifyEmailResponse + ErrorModel | VerifyEmailResponse """ return ( diff --git a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py index 30397328..dd1cdc1f 100644 --- a/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py +++ b/src/tower/tower_api_client/api/feature_flags/get_feature_flag_value.py @@ -1,10 +1,11 @@ from http import HTTPStatus -from typing import Any, Optional, Union +from typing import Any +from urllib.parse import quote import httpx -from ... import errors from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel from ...models.get_feature_flag_response_body import GetFeatureFlagResponseBody from ...types import Response @@ -15,7 +16,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", "url": "/feature-flags/{key}".format( - key=key, + key=quote(str(key), safe=""), ), } @@ -23,21 +24,21 @@ def _get_kwargs( def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[GetFeatureFlagResponseBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorModel | GetFeatureFlagResponseBody: if response.status_code == 200: response_200 = GetFeatureFlagResponseBody.from_dict(response.json()) return response_200 - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None + + response_default = ErrorModel.from_dict(response.json()) + + return response_default def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[GetFeatureFlagResponseBody]: + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -49,22 +50,22 @@ def _build_response( def sync_detailed( key: str, *, - client: Union[AuthenticatedClient, Client], -) -> Response[GetFeatureFlagResponseBody]: + client: AuthenticatedClient | Client, +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: """Get feature flag value Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey value if disabled. Args: - key (str): The feature flag key Example: SCHEDULES_ENABLED. + key (str): The feature flag key Example: schedules-enabled. 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[GetFeatureFlagResponseBody] + Response[ErrorModel | GetFeatureFlagResponseBody] """ kwargs = _get_kwargs( @@ -81,22 +82,22 @@ def sync_detailed( def sync( key: str, *, - client: Union[AuthenticatedClient, Client], -) -> Optional[GetFeatureFlagResponseBody]: + client: AuthenticatedClient | Client, +) -> ErrorModel | GetFeatureFlagResponseBody | None: """Get feature flag value Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey value if disabled. Args: - key (str): The feature flag key Example: SCHEDULES_ENABLED. + key (str): The feature flag key Example: schedules-enabled. 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: - GetFeatureFlagResponseBody + ErrorModel | GetFeatureFlagResponseBody """ return sync_detailed( @@ -108,22 +109,22 @@ def sync( async def asyncio_detailed( key: str, *, - client: Union[AuthenticatedClient, Client], -) -> Response[GetFeatureFlagResponseBody]: + client: AuthenticatedClient | Client, +) -> Response[ErrorModel | GetFeatureFlagResponseBody]: """Get feature flag value Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey value if disabled. Args: - key (str): The feature flag key Example: SCHEDULES_ENABLED. + key (str): The feature flag key Example: schedules-enabled. 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[GetFeatureFlagResponseBody] + Response[ErrorModel | GetFeatureFlagResponseBody] """ kwargs = _get_kwargs( @@ -138,22 +139,22 @@ async def asyncio_detailed( async def asyncio( key: str, *, - client: Union[AuthenticatedClient, Client], -) -> Optional[GetFeatureFlagResponseBody]: + client: AuthenticatedClient | Client, +) -> ErrorModel | GetFeatureFlagResponseBody | None: """Get feature flag value Get the current value of a feature flag. Returns the flag value if enabled, or a default falsey value if disabled. Args: - key (str): The feature flag key Example: SCHEDULES_ENABLED. + key (str): The feature flag key Example: schedules-enabled. 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: - GetFeatureFlagResponseBody + ErrorModel | GetFeatureFlagResponseBody """ return ( diff --git a/src/tower/tower_api_client/client.py b/src/tower/tower_api_client/client.py index eeffd00c..0ab15895 100644 --- a/src/tower/tower_api_client/client.py +++ b/src/tower/tower_api_client/client.py @@ -1,5 +1,5 @@ import ssl -from typing import Any, Optional, Union +from typing import Any import httpx from attrs import define, evolve, field @@ -38,18 +38,16 @@ class Client: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field( - default=None, kw_only=True, alias="timeout" - ) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( default=True, kw_only=True, alias="verify_ssl" ) _follow_redirects: bool = field( default=False, kw_only=True, alias="follow_redirects" ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: Optional[httpx.Client] = field(default=None, init=False) - _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) def with_headers(self, headers: dict[str, str]) -> "Client": """Get a new client matching this one with additional headers""" @@ -68,7 +66,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "Client": return evolve(self, cookies={**self._cookies, **cookies}) def with_timeout(self, timeout: httpx.Timeout) -> "Client": - """Get a new client matching this one with a new timeout (in seconds)""" + """Get a new client matching this one with a new timeout configuration""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -107,7 +105,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: self.get_httpx_client().__exit__(*args, **kwargs) def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": - """Manually the underlying httpx.AsyncClient + """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ @@ -174,18 +172,16 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field( - default=None, kw_only=True, alias="timeout" - ) - _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( default=True, kw_only=True, alias="verify_ssl" ) _follow_redirects: bool = field( default=False, kw_only=True, alias="follow_redirects" ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") - _client: Optional[httpx.Client] = field(default=None, init=False) - _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) token: str prefix: str = "Bearer" @@ -208,7 +204,7 @@ def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": return evolve(self, cookies={**self._cookies, **cookies}) def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": - """Get a new client matching this one with a new timeout (in seconds)""" + """Get a new client matching this one with a new timeout configuration""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -252,7 +248,7 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: def set_async_httpx_client( self, async_client: httpx.AsyncClient ) -> "AuthenticatedClient": - """Manually the underlying httpx.AsyncClient + """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ diff --git a/src/tower/tower_api_client/models/__init__.py b/src/tower/tower_api_client/models/__init__.py index 7dc82d77..0106e7c9 100644 --- a/src/tower/tower_api_client/models/__init__.py +++ b/src/tower/tower_api_client/models/__init__.py @@ -11,6 +11,7 @@ from .app_status import AppStatus from .app_summary import AppSummary from .app_version import AppVersion +from .authentication_context import AuthenticationContext from .batch_schedule_params import BatchScheduleParams from .batch_schedule_response import BatchScheduleResponse from .cancel_run_response import CancelRunResponse @@ -38,6 +39,7 @@ from .create_sandbox_secrets_params import CreateSandboxSecretsParams from .create_sandbox_secrets_response import CreateSandboxSecretsResponse from .create_schedule_params import CreateScheduleParams +from .create_schedule_params_overlap_policy import CreateScheduleParamsOverlapPolicy from .create_schedule_params_status import CreateScheduleParamsStatus from .create_schedule_response import CreateScheduleResponse from .create_secret_params import CreateSecretParams @@ -46,6 +48,8 @@ from .create_session_response import CreateSessionResponse from .create_team_params import CreateTeamParams from .create_team_response import CreateTeamResponse +from .create_webhook_params import CreateWebhookParams +from .create_webhook_response import CreateWebhookResponse from .delete_api_key_params import DeleteAPIKeyParams from .delete_api_key_response import DeleteAPIKeyResponse from .delete_app_response import DeleteAppResponse @@ -55,23 +59,30 @@ from .delete_schedule_params import DeleteScheduleParams from .delete_schedule_response import DeleteScheduleResponse from .delete_secret_response import DeleteSecretResponse +from .delete_session_params import DeleteSessionParams +from .delete_session_response import DeleteSessionResponse from .delete_team_invitation_params import DeleteTeamInvitationParams from .delete_team_invitation_response import DeleteTeamInvitationResponse from .delete_team_params import DeleteTeamParams from .delete_team_response import DeleteTeamResponse +from .delete_webhook_response import DeleteWebhookResponse from .deploy_app_json_body import DeployAppJsonBody from .deploy_app_response import DeployAppResponse from .describe_account_body import DescribeAccountBody from .describe_app_response import DescribeAppResponse from .describe_app_version_response import DescribeAppVersionResponse +from .describe_authentication_context_body import DescribeAuthenticationContextBody from .describe_device_login_session_response import DescribeDeviceLoginSessionResponse from .describe_email_preferences_body import DescribeEmailPreferencesBody +from .describe_plan_response import DescribePlanResponse from .describe_run_graph_response import DescribeRunGraphResponse from .describe_run_links import DescribeRunLinks from .describe_run_logs_response import DescribeRunLogsResponse from .describe_run_response import DescribeRunResponse from .describe_secrets_key_response import DescribeSecretsKeyResponse from .describe_session_response import DescribeSessionResponse +from .describe_team_response import DescribeTeamResponse +from .describe_webhook_response import DescribeWebhookResponse from .email_subscriptions import EmailSubscriptions from .encrypted_catalog_property import EncryptedCatalogProperty from .environment import Environment @@ -84,8 +95,8 @@ from .exported_catalog import ExportedCatalog from .exported_catalog_property import ExportedCatalogProperty from .exported_secret import ExportedSecret +from .feature import Feature from .featurebase_identity import FeaturebaseIdentity -from .features import Features from .generate_app_statistics_response import GenerateAppStatisticsResponse from .generate_authenticator_response import GenerateAuthenticatorResponse from .generate_run_statistics_response import GenerateRunStatisticsResponse @@ -98,7 +109,6 @@ from .invite_team_member_params import InviteTeamMemberParams from .invite_team_member_response import InviteTeamMemberResponse from .leave_team_response import LeaveTeamResponse -from .list_account_plans_response import ListAccountPlansResponse from .list_alerts_response import ListAlertsResponse from .list_api_keys_response import ListAPIKeysResponse from .list_app_environments_response import ListAppEnvironmentsResponse @@ -119,6 +129,8 @@ from .list_team_invitations_response import ListTeamInvitationsResponse from .list_team_members_response import ListTeamMembersResponse from .list_teams_response import ListTeamsResponse +from .list_webhooks_response import ListWebhooksResponse +from .organization import Organization from .pagination import Pagination from .parameter import Parameter from .plan import Plan @@ -142,6 +154,7 @@ from .run_log_line_channel import RunLogLineChannel from .run_parameter import RunParameter from .run_results import RunResults +from .run_run_initiator_details import RunRunInitiatorDetails from .run_statistics import RunStatistics from .run_status import RunStatus from .run_status_group import RunStatusGroup @@ -149,11 +162,15 @@ from .runner import Runner from .runner_credentials import RunnerCredentials from .schedule import Schedule +from .schedule_app_status import ScheduleAppStatus +from .schedule_overlap_policy import ScheduleOverlapPolicy +from .schedule_run_initiator_details import ScheduleRunInitiatorDetails from .schedule_status import ScheduleStatus from .search_runs_response import SearchRunsResponse from .search_runs_status_item import SearchRunsStatusItem from .secret import Secret from .session import Session +from .shoulder_tap import ShoulderTap from .sse_warning import SSEWarning from .statistics_settings import StatisticsSettings from .statistics_settings_interval import StatisticsSettingsInterval @@ -161,8 +178,13 @@ from .stream_alerts_event_error import StreamAlertsEventError from .stream_run_logs_event_log import StreamRunLogsEventLog from .stream_run_logs_event_warning import StreamRunLogsEventWarning +from .stream_shouldertaps_event_shouldertap import StreamShouldertapsEventShouldertap +from .stream_shouldertaps_event_warning import StreamShouldertapsEventWarning from .team import Team from .team_invitation import TeamInvitation +from .team_membership import TeamMembership +from .team_membership_role import TeamMembershipRole +from .test_webhook_response import TestWebhookResponse from .token import Token from .unverified_authenticator import UnverifiedAuthenticator from .update_account_params import UpdateAccountParams @@ -176,23 +198,33 @@ from .update_environment_response import UpdateEnvironmentResponse from .update_my_team_invitation_params import UpdateMyTeamInvitationParams from .update_my_team_invitation_response import UpdateMyTeamInvitationResponse +from .update_organization_params import UpdateOrganizationParams +from .update_organization_response import UpdateOrganizationResponse from .update_password_reset_params import UpdatePasswordResetParams from .update_password_reset_response import UpdatePasswordResetResponse from .update_plan_params import UpdatePlanParams from .update_plan_response import UpdatePlanResponse from .update_schedule_params import UpdateScheduleParams +from .update_schedule_params_overlap_policy import UpdateScheduleParamsOverlapPolicy from .update_schedule_params_status import UpdateScheduleParamsStatus from .update_schedule_response import UpdateScheduleResponse from .update_secret_params import UpdateSecretParams from .update_secret_response import UpdateSecretResponse +from .update_team_member_params import UpdateTeamMemberParams +from .update_team_member_params_role import UpdateTeamMemberParamsRole +from .update_team_member_response import UpdateTeamMemberResponse from .update_team_params import UpdateTeamParams from .update_team_response import UpdateTeamResponse from .update_user_params import UpdateUserParams from .update_user_response import UpdateUserResponse +from .update_webhook_params import UpdateWebhookParams +from .update_webhook_response import UpdateWebhookResponse from .user import User from .verified_authenticator import VerifiedAuthenticator from .verify_email_params import VerifyEmailParams from .verify_email_response import VerifyEmailResponse +from .webhook import Webhook +from .webhook_state import WebhookState __all__ = ( "Account", @@ -206,6 +238,7 @@ "AppStatus", "AppSummary", "AppVersion", + "AuthenticationContext", "BatchScheduleParams", "BatchScheduleResponse", "CancelRunResponse", @@ -233,6 +266,7 @@ "CreateSandboxSecretsParams", "CreateSandboxSecretsResponse", "CreateScheduleParams", + "CreateScheduleParamsOverlapPolicy", "CreateScheduleParamsStatus", "CreateScheduleResponse", "CreateSecretParams", @@ -241,6 +275,8 @@ "CreateSessionResponse", "CreateTeamParams", "CreateTeamResponse", + "CreateWebhookParams", + "CreateWebhookResponse", "DeleteAPIKeyParams", "DeleteAPIKeyResponse", "DeleteAppResponse", @@ -250,23 +286,30 @@ "DeleteScheduleParams", "DeleteScheduleResponse", "DeleteSecretResponse", + "DeleteSessionParams", + "DeleteSessionResponse", "DeleteTeamInvitationParams", "DeleteTeamInvitationResponse", "DeleteTeamParams", "DeleteTeamResponse", + "DeleteWebhookResponse", "DeployAppJsonBody", "DeployAppResponse", "DescribeAccountBody", "DescribeAppResponse", "DescribeAppVersionResponse", + "DescribeAuthenticationContextBody", "DescribeDeviceLoginSessionResponse", "DescribeEmailPreferencesBody", + "DescribePlanResponse", "DescribeRunGraphResponse", "DescribeRunLinks", "DescribeRunLogsResponse", "DescribeRunResponse", "DescribeSecretsKeyResponse", "DescribeSessionResponse", + "DescribeTeamResponse", + "DescribeWebhookResponse", "EmailSubscriptions", "EncryptedCatalogProperty", "Environment", @@ -279,8 +322,8 @@ "ExportedSecret", "ExportSecretsParams", "ExportSecretsResponse", + "Feature", "FeaturebaseIdentity", - "Features", "GenerateAppStatisticsResponse", "GenerateAuthenticatorResponse", "GenerateRunnerCredentialsResponse", @@ -291,7 +334,6 @@ "InviteTeamMemberParams", "InviteTeamMemberResponse", "LeaveTeamResponse", - "ListAccountPlansResponse", "ListAlertsResponse", "ListAPIKeysResponse", "ListAppEnvironmentsResponse", @@ -312,6 +354,8 @@ "ListTeamInvitationsResponse", "ListTeamMembersResponse", "ListTeamsResponse", + "ListWebhooksResponse", + "Organization", "Pagination", "Parameter", "Plan", @@ -337,16 +381,21 @@ "RunnerCredentials", "RunParameter", "RunResults", + "RunRunInitiatorDetails", "RunStatistics", "RunStatus", "RunStatusGroup", "RunTimeseriesPoint", "Schedule", + "ScheduleAppStatus", + "ScheduleOverlapPolicy", + "ScheduleRunInitiatorDetails", "ScheduleStatus", "SearchRunsResponse", "SearchRunsStatusItem", "Secret", "Session", + "ShoulderTap", "SSEWarning", "StatisticsSettings", "StatisticsSettingsInterval", @@ -354,8 +403,13 @@ "StreamAlertsEventError", "StreamRunLogsEventLog", "StreamRunLogsEventWarning", + "StreamShouldertapsEventShouldertap", + "StreamShouldertapsEventWarning", "Team", "TeamInvitation", + "TeamMembership", + "TeamMembershipRole", + "TestWebhookResponse", "Token", "UnverifiedAuthenticator", "UpdateAccountParams", @@ -369,21 +423,31 @@ "UpdateEnvironmentResponse", "UpdateMyTeamInvitationParams", "UpdateMyTeamInvitationResponse", + "UpdateOrganizationParams", + "UpdateOrganizationResponse", "UpdatePasswordResetParams", "UpdatePasswordResetResponse", "UpdatePlanParams", "UpdatePlanResponse", "UpdateScheduleParams", + "UpdateScheduleParamsOverlapPolicy", "UpdateScheduleParamsStatus", "UpdateScheduleResponse", "UpdateSecretParams", "UpdateSecretResponse", + "UpdateTeamMemberParams", + "UpdateTeamMemberParamsRole", + "UpdateTeamMemberResponse", "UpdateTeamParams", "UpdateTeamResponse", "UpdateUserParams", "UpdateUserResponse", + "UpdateWebhookParams", + "UpdateWebhookResponse", "User", "VerifiedAuthenticator", "VerifyEmailParams", "VerifyEmailResponse", + "Webhook", + "WebhookState", ) diff --git a/src/tower/tower_api_client/models/account.py b/src/tower/tower_api_client/models/account.py index da6b9be3..3556710a 100644 --- a/src/tower/tower_api_client/models/account.py +++ b/src/tower/tower_api_client/models/account.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,12 +16,12 @@ class Account: Attributes: is_self_hosted_only (bool): name (str): - slug (Union[Unset, str]): This property is deprecated. Please use name instead. + slug (str | Unset): This property is deprecated. Use name instead. """ is_self_hosted_only: bool name: str - slug: Union[Unset, str] = UNSET + slug: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: is_self_hosted_only = self.is_self_hosted_only @@ -29,6 +31,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug field_dict: dict[str, Any] = {} + field_dict.update( { "is_self_hosted_only": is_self_hosted_only, diff --git a/src/tower/tower_api_client/models/acknowledge_alert_response.py b/src/tower/tower_api_client/models/acknowledge_alert_response.py index 7f0fb469..ccd19b83 100644 --- a/src/tower/tower_api_client/models/acknowledge_alert_response.py +++ b/src/tower/tower_api_client/models/acknowledge_alert_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class AcknowledgeAlertResponse: """ Attributes: status (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/AcknowledgeAlertResponse.json. """ status: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: status = self.status @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "status": status, diff --git a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py index 76048091..8f336083 100644 --- a/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py +++ b/src/tower/tower_api_client/models/acknowledge_all_alerts_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,13 +16,13 @@ class AcknowledgeAllAlertsResponse: Attributes: count (int): Number of alerts that were acknowledged status (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/AcknowledgeAllAlertsResponse.json. """ count: int status: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: count = self.count @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "count": count, diff --git a/src/tower/tower_api_client/models/alert.py b/src/tower/tower_api_client/models/alert.py index 6cb9e9d9..342204ce 100644 --- a/src/tower/tower_api_client/models/alert.py +++ b/src/tower/tower_api_client/models/alert.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,7 +22,6 @@ class Alert: alert_type (str): created_at (datetime.datetime): detail (RunFailureAlert): - environment (str): seq (int): status (str): """ @@ -28,8 +29,7 @@ class Alert: acked: bool alert_type: str created_at: datetime.datetime - detail: "RunFailureAlert" - environment: str + detail: RunFailureAlert seq: int status: str @@ -42,20 +42,18 @@ def to_dict(self) -> dict[str, Any]: detail = self.detail.to_dict() - environment = self.environment - seq = self.seq status = self.status field_dict: dict[str, Any] = {} + field_dict.update( { "acked": acked, "alert_type": alert_type, "created_at": created_at, "detail": detail, - "environment": environment, "seq": seq, "status": status, } @@ -76,8 +74,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: detail = RunFailureAlert.from_dict(d.pop("detail")) - environment = d.pop("environment") - seq = d.pop("seq") status = d.pop("status") @@ -87,7 +83,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_type=alert_type, created_at=created_at, detail=detail, - environment=environment, seq=seq, status=status, ) diff --git a/src/tower/tower_api_client/models/api_key.py b/src/tower/tower_api_client/models/api_key.py index 7ca12ec3..8f1d3edb 100644 --- a/src/tower/tower_api_client/models/api_key.py +++ b/src/tower/tower_api_client/models/api_key.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -14,13 +16,13 @@ class APIKey: Attributes: created_at (datetime.datetime): identifier (str): - last_used_at (Union[None, datetime.datetime]): + last_used_at (datetime.datetime | None): name (str): """ created_at: datetime.datetime identifier: str - last_used_at: Union[None, datetime.datetime] + last_used_at: datetime.datetime | None name: str def to_dict(self) -> dict[str, Any]: @@ -28,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: identifier = self.identifier - last_used_at: Union[None, str] + last_used_at: None | str if isinstance(self.last_used_at, datetime.datetime): last_used_at = self.last_used_at.isoformat() else: @@ -37,6 +39,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, @@ -55,7 +58,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: identifier = d.pop("identifier") - def _parse_last_used_at(data: object) -> Union[None, datetime.datetime]: + def _parse_last_used_at(data: object) -> datetime.datetime | None: if data is None: return data try: @@ -64,9 +67,9 @@ def _parse_last_used_at(data: object) -> Union[None, datetime.datetime]: last_used_at_type_0 = isoparse(data) return last_used_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union[None, datetime.datetime], data) + return cast(datetime.datetime | None, data) last_used_at = _parse_last_used_at(d.pop("last_used_at")) diff --git a/src/tower/tower_api_client/models/app.py b/src/tower/tower_api_client/models/app.py index 10220a64..aaab3a19 100644 --- a/src/tower/tower_api_client/models/app.py +++ b/src/tower/tower_api_client/models/app.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -25,34 +27,38 @@ class App: health_status (AppHealthStatus): This property is deprecated. It will always be 'healthy'. is_externally_accessible (bool): name (str): The name of the app. - next_run_at (Union[None, datetime.datetime]): The next time this app will run as part of it's schedule, null if - none. + next_run_at (datetime.datetime | None): The next time this app will run as part of it's schedule, null if none. owner (str): The account slug that owns this app. - schedule (Union[None, str]): The schedule associated with this app, null if none. + pending_timeout (int): The maximum time in seconds that a run can stay in the pending state before being marked + as cancelled. Default: 600. + running_timeout (int): The number of seconds that a run can stay running before it gets cancelled. Value of 0 + (default) means no timeout. Default: 0. + schedule (None | str): The schedule associated with this app, null if none. short_description (str): A short description of the app. Can be empty. - version (Union[None, str]): The current version of this app, null if none. - last_run (Union[Unset, Run]): - run_results (Union[Unset, RunResults]): - slug (Union[Unset, str]): This property is deprecated. Please use name instead. - status (Union[Unset, AppStatus]): The status of the app. - subdomain (Union[Unset, str]): The subdomain that this app is accessible via. Must be externally accessible - first. + version (None | str): The current version of this app, null if none. + last_run (Run | Unset): + run_results (RunResults | Unset): + slug (str | Unset): This property is deprecated. Use name instead. + status (AppStatus | Unset): The status of the app. + subdomain (str | Unset): The subdomain that this app is accessible via. Must be externally accessible first. """ created_at: datetime.datetime health_status: AppHealthStatus is_externally_accessible: bool name: str - next_run_at: Union[None, datetime.datetime] + next_run_at: datetime.datetime | None owner: str - schedule: Union[None, str] + schedule: None | str short_description: str - version: Union[None, str] - last_run: Union[Unset, "Run"] = UNSET - run_results: Union[Unset, "RunResults"] = UNSET - slug: Union[Unset, str] = UNSET - status: Union[Unset, AppStatus] = UNSET - subdomain: Union[Unset, str] = UNSET + version: None | str + pending_timeout: int = 600 + running_timeout: int = 0 + last_run: Run | Unset = UNSET + run_results: RunResults | Unset = UNSET + slug: str | Unset = UNSET + status: AppStatus | Unset = UNSET + subdomain: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() @@ -63,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - next_run_at: Union[None, str] + next_run_at: None | str if isinstance(self.next_run_at, datetime.datetime): next_run_at = self.next_run_at.isoformat() else: @@ -71,31 +77,36 @@ def to_dict(self) -> dict[str, Any]: owner = self.owner - schedule: Union[None, str] + pending_timeout = self.pending_timeout + + running_timeout = self.running_timeout + + schedule: None | str schedule = self.schedule short_description = self.short_description - version: Union[None, str] + version: None | str version = self.version - last_run: Union[Unset, dict[str, Any]] = UNSET + last_run: dict[str, Any] | Unset = UNSET if not isinstance(self.last_run, Unset): last_run = self.last_run.to_dict() - run_results: Union[Unset, dict[str, Any]] = UNSET + run_results: dict[str, Any] | Unset = UNSET if not isinstance(self.run_results, Unset): run_results = self.run_results.to_dict() slug = self.slug - status: Union[Unset, str] = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.value subdomain = self.subdomain field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, @@ -104,6 +115,8 @@ def to_dict(self) -> dict[str, Any]: "name": name, "next_run_at": next_run_at, "owner": owner, + "pending_timeout": pending_timeout, + "running_timeout": running_timeout, "schedule": schedule, "short_description": short_description, "version": version, @@ -136,7 +149,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name") - def _parse_next_run_at(data: object) -> Union[None, datetime.datetime]: + def _parse_next_run_at(data: object) -> datetime.datetime | None: if data is None: return data try: @@ -145,39 +158,43 @@ def _parse_next_run_at(data: object) -> Union[None, datetime.datetime]: next_run_at_type_0 = isoparse(data) return next_run_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union[None, datetime.datetime], data) + return cast(datetime.datetime | None, data) next_run_at = _parse_next_run_at(d.pop("next_run_at")) owner = d.pop("owner") - def _parse_schedule(data: object) -> Union[None, str]: + pending_timeout = d.pop("pending_timeout") + + running_timeout = d.pop("running_timeout") + + def _parse_schedule(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) schedule = _parse_schedule(d.pop("schedule")) short_description = d.pop("short_description") - def _parse_version(data: object) -> Union[None, str]: + def _parse_version(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) version = _parse_version(d.pop("version")) _last_run = d.pop("last_run", UNSET) - last_run: Union[Unset, Run] + last_run: Run | Unset if isinstance(_last_run, Unset): last_run = UNSET else: last_run = Run.from_dict(_last_run) _run_results = d.pop("run_results", UNSET) - run_results: Union[Unset, RunResults] + run_results: RunResults | Unset if isinstance(_run_results, Unset): run_results = UNSET else: @@ -186,7 +203,7 @@ def _parse_version(data: object) -> Union[None, str]: slug = d.pop("slug", UNSET) _status = d.pop("status", UNSET) - status: Union[Unset, AppStatus] + status: AppStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -201,6 +218,8 @@ def _parse_version(data: object) -> Union[None, str]: name=name, next_run_at=next_run_at, owner=owner, + pending_timeout=pending_timeout, + running_timeout=running_timeout, schedule=schedule, short_description=short_description, version=version, diff --git a/src/tower/tower_api_client/models/app_statistics.py b/src/tower/tower_api_client/models/app_statistics.py index d3cf000e..e8616eb1 100644 --- a/src/tower/tower_api_client/models/app_statistics.py +++ b/src/tower/tower_api_client/models/app_statistics.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -31,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: running_apps = self.running_apps field_dict: dict[str, Any] = {} + field_dict.update( { "all_apps": all_apps, diff --git a/src/tower/tower_api_client/models/app_summary.py b/src/tower/tower_api_client/models/app_summary.py index a5301510..61f41257 100644 --- a/src/tower/tower_api_client/models/app_summary.py +++ b/src/tower/tower_api_client/models/app_summary.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -16,11 +18,11 @@ class AppSummary: """ Attributes: app (App): - runs (list['Run']): + runs (list[Run]): """ - app: "App" - runs: list["Run"] + app: App + runs: list[Run] def to_dict(self) -> dict[str, Any]: app = self.app.to_dict() @@ -31,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: runs.append(runs_item) field_dict: dict[str, Any] = {} + field_dict.update( { "app": app, diff --git a/src/tower/tower_api_client/models/app_version.py b/src/tower/tower_api_client/models/app_version.py index 91239b5e..376fd435 100644 --- a/src/tower/tower_api_client/models/app_version.py +++ b/src/tower/tower_api_client/models/app_version.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,13 +19,13 @@ class AppVersion: """ Attributes: created_at (datetime.datetime): - parameters (list['Parameter']): + parameters (list[Parameter]): towerfile (str): The Towerfile that this version was created from. version (str): """ created_at: datetime.datetime - parameters: list["Parameter"] + parameters: list[Parameter] towerfile: str version: str @@ -40,6 +42,7 @@ def to_dict(self) -> dict[str, Any]: version = self.version field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, diff --git a/src/tower/tower_api_client/models/authentication_context.py b/src/tower/tower_api_client/models/authentication_context.py new file mode 100644 index 00000000..6f4f39a7 --- /dev/null +++ b/src/tower/tower_api_client/models/authentication_context.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AuthenticationContext") + + +@_attrs_define +class AuthenticationContext: + """ + Attributes: + work_os_access_token (str): The WorkOS access token for SSO authentication. + """ + + work_os_access_token: str + + def to_dict(self) -> dict[str, Any]: + work_os_access_token = self.work_os_access_token + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "work_os_access_token": work_os_access_token, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + work_os_access_token = d.pop("work_os_access_token") + + authentication_context = cls( + work_os_access_token=work_os_access_token, + ) + + return authentication_context diff --git a/src/tower/tower_api_client/models/batch_schedule_params.py b/src/tower/tower_api_client/models/batch_schedule_params.py index 8de047cd..73103741 100644 --- a/src/tower/tower_api_client/models/batch_schedule_params.py +++ b/src/tower/tower_api_client/models/batch_schedule_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class BatchScheduleParams: """ Attributes: ids (list[str]): The IDs of the schedules to modify - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/BatchScheduleParams.json. """ ids: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: ids = self.ids @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "ids": ids, diff --git a/src/tower/tower_api_client/models/batch_schedule_response.py b/src/tower/tower_api_client/models/batch_schedule_response.py index 103a99f9..a4f05673 100644 --- a/src/tower/tower_api_client/models/batch_schedule_response.py +++ b/src/tower/tower_api_client/models/batch_schedule_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class BatchScheduleResponse: """ Attributes: - schedules (list['Schedule']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schedules (list[Schedule]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/BatchScheduleResponse.json. """ - schedules: list["Schedule"] - schema: Union[Unset, str] = UNSET + schedules: list[Schedule] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schedules = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "schedules": schedules, diff --git a/src/tower/tower_api_client/models/cancel_run_response.py b/src/tower/tower_api_client/models/cancel_run_response.py index 2450d954..a6a509e3 100644 --- a/src/tower/tower_api_client/models/cancel_run_response.py +++ b/src/tower/tower_api_client/models/cancel_run_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CancelRunResponse: """ Attributes: run (Run): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CancelRunResponse.json. """ - run: "Run" - schema: Union[Unset, str] = UNSET + run: Run + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: run = self.run.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "run": run, diff --git a/src/tower/tower_api_client/models/catalog.py b/src/tower/tower_api_client/models/catalog.py index d366be4b..ab6e6e2d 100644 --- a/src/tower/tower_api_client/models/catalog.py +++ b/src/tower/tower_api_client/models/catalog.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -21,17 +23,17 @@ class Catalog: created_at (datetime.datetime): environment (str): name (str): - properties (list['CatalogProperty']): + properties (list[CatalogProperty]): type_ (str): - slug (Union[Unset, str]): This property is deprecated. Please use name instead. + slug (str | Unset): This property is deprecated. Use name instead. """ created_at: datetime.datetime environment: str name: str - properties: list["CatalogProperty"] + properties: list[CatalogProperty] type_: str - slug: Union[Unset, str] = UNSET + slug: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() @@ -50,6 +52,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug field_dict: dict[str, Any] = {} + field_dict.update( { "CreatedAt": created_at, diff --git a/src/tower/tower_api_client/models/catalog_property.py b/src/tower/tower_api_client/models/catalog_property.py index aac3df5d..c0274039 100644 --- a/src/tower/tower_api_client/models/catalog_property.py +++ b/src/tower/tower_api_client/models/catalog_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -23,6 +25,7 @@ def to_dict(self) -> dict[str, Any]: preview = self.preview field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py index 275c3bde..13fa138d 100644 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_params.py +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,22 +14,28 @@ class ClaimDeviceLoginTicketParams: """ Attributes: + refresh_token (str): The refresh token for the session to delegate to the device. user_code (str): The user code to claim. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketParams.json. """ + refresh_token: str user_code: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: + refresh_token = self.refresh_token + user_code = self.user_code schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { + "refresh_token": refresh_token, "user_code": user_code, } ) @@ -39,11 +47,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + refresh_token = d.pop("refresh_token") + user_code = d.pop("user_code") schema = d.pop("$schema", UNSET) claim_device_login_ticket_params = cls( + refresh_token=refresh_token, user_code=user_code, schema=schema, ) diff --git a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py index 2a6c9a62..88d9c7be 100644 --- a/src/tower/tower_api_client/models/claim_device_login_ticket_response.py +++ b/src/tower/tower_api_client/models/claim_device_login_ticket_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class ClaimDeviceLoginTicketResponse: """ Attributes: claimed (bool): Whether the code was successfully claimed. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ClaimDeviceLoginTicketResponse.json. """ claimed: bool - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: claimed = self.claimed @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "claimed": claimed, diff --git a/src/tower/tower_api_client/models/create_account_params.py b/src/tower/tower_api_client/models/create_account_params.py index ddb98ddd..ef7caf01 100644 --- a/src/tower/tower_api_client/models/create_account_params.py +++ b/src/tower/tower_api_client/models/create_account_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,13 +16,13 @@ class CreateAccountParams: Attributes: email (str): password (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAccountParams.json. """ email: str password: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, diff --git a/src/tower/tower_api_client/models/create_account_params_flags_struct.py b/src/tower/tower_api_client/models/create_account_params_flags_struct.py index 91b457b5..577aef84 100644 --- a/src/tower/tower_api_client/models/create_account_params_flags_struct.py +++ b/src/tower/tower_api_client/models/create_account_params_flags_struct.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,6 +21,7 @@ def to_dict(self) -> dict[str, Any]: is_test_account = self.is_test_account field_dict: dict[str, Any] = {} + field_dict.update( { "is_test_account": is_test_account, diff --git a/src/tower/tower_api_client/models/create_account_response.py b/src/tower/tower_api_client/models/create_account_response.py index 94d9ca68..646d5328 100644 --- a/src/tower/tower_api_client/models/create_account_response.py +++ b/src/tower/tower_api_client/models/create_account_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateAccountResponse: """ Attributes: session (Session): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAccountResponse.json. """ - session: "Session" - schema: Union[Unset, str] = UNSET + session: Session + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: session = self.session.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "session": session, diff --git a/src/tower/tower_api_client/models/create_api_key_params.py b/src/tower/tower_api_client/models/create_api_key_params.py index 35479bac..c21d6be2 100644 --- a/src/tower/tower_api_client/models/create_api_key_params.py +++ b/src/tower/tower_api_client/models/create_api_key_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreateAPIKeyParams: """ Attributes: name (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAPIKeyParams.json. """ name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/create_api_key_response.py b/src/tower/tower_api_client/models/create_api_key_response.py index 8ac360cb..da7ebf59 100644 --- a/src/tower/tower_api_client/models/create_api_key_response.py +++ b/src/tower/tower_api_client/models/create_api_key_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateAPIKeyResponse: """ Attributes: api_key (APIKey): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAPIKeyResponse.json. """ - api_key: "APIKey" - schema: Union[Unset, str] = UNSET + api_key: APIKey + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: api_key = self.api_key.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "api_key": api_key, diff --git a/src/tower/tower_api_client/models/create_app_params.py b/src/tower/tower_api_client/models/create_app_params.py index 3e7f7918..fdf0e085 100644 --- a/src/tower/tower_api_client/models/create_app_params.py +++ b/src/tower/tower_api_client/models/create_app_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,22 +15,22 @@ class CreateAppParams: """ Attributes: name (str): The name of the app. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAppParams.json. - is_externally_accessible (Union[Unset, bool]): Indicates that web traffic should be routed to this app and that - its runs should get a hostname assigned to it. Default: False. - short_description (Union[Unset, str]): A description of the app. - slug (Union[Unset, str]): The slug of the app. Legacy CLI will send it but we don't need it. - subdomain (Union[None, Unset, str]): The subdomain this app is accessible under. Requires - is_externally_accessible to be true. + is_externally_accessible (bool | Unset): Indicates that web traffic should be routed to this app and that its + runs should get a hostname assigned to it. Default: False. + short_description (str | Unset): A description of the app. + slug (str | Unset): The slug of the app. Legacy CLI will send it but we don't need it. + subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to + be true. """ name: str - schema: Union[Unset, str] = UNSET - is_externally_accessible: Union[Unset, bool] = False - short_description: Union[Unset, str] = UNSET - slug: Union[Unset, str] = UNSET - subdomain: Union[None, Unset, str] = UNSET + schema: str | Unset = UNSET + is_externally_accessible: bool | Unset = False + short_description: str | Unset = UNSET + slug: str | Unset = UNSET + subdomain: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -41,13 +43,14 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - subdomain: Union[None, Unset, str] + subdomain: None | str | Unset if isinstance(self.subdomain, Unset): subdomain = UNSET else: subdomain = self.subdomain field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, @@ -79,12 +82,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_subdomain(data: object) -> Union[None, Unset, str]: + def _parse_subdomain(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) diff --git a/src/tower/tower_api_client/models/create_app_response.py b/src/tower/tower_api_client/models/create_app_response.py index 0a0090a2..2c727a2e 100644 --- a/src/tower/tower_api_client/models/create_app_response.py +++ b/src/tower/tower_api_client/models/create_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateAppResponse: """ Attributes: app (App): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAppResponse.json. """ - app: "App" - schema: Union[Unset, str] = UNSET + app: App + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: app = self.app.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "app": app, diff --git a/src/tower/tower_api_client/models/create_authenticator_params.py b/src/tower/tower_api_client/models/create_authenticator_params.py index f9fc502c..c425e583 100644 --- a/src/tower/tower_api_client/models/create_authenticator_params.py +++ b/src/tower/tower_api_client/models/create_authenticator_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,13 +16,13 @@ class CreateAuthenticatorParams: Attributes: authenticator_url (str): The authenticator URL with an otpauth scheme that identifies this authenticator verification_code (str): A code taken from the authenticator as verification that it's correctly configured. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAuthenticatorParams.json. """ authenticator_url: str verification_code: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticator_url = self.authenticator_url @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticator_url": authenticator_url, diff --git a/src/tower/tower_api_client/models/create_authenticator_response.py b/src/tower/tower_api_client/models/create_authenticator_response.py index c614c640..f783573d 100644 --- a/src/tower/tower_api_client/models/create_authenticator_response.py +++ b/src/tower/tower_api_client/models/create_authenticator_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateAuthenticatorResponse: """ Attributes: authenticator (VerifiedAuthenticator): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateAuthenticatorResponse.json. """ - authenticator: "VerifiedAuthenticator" - schema: Union[Unset, str] = UNSET + authenticator: VerifiedAuthenticator + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticator = self.authenticator.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticator": authenticator, diff --git a/src/tower/tower_api_client/models/create_catalog_params.py b/src/tower/tower_api_client/models/create_catalog_params.py index b70c4653..f7e7b890 100644 --- a/src/tower/tower_api_client/models/create_catalog_params.py +++ b/src/tower/tower_api_client/models/create_catalog_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -19,17 +21,17 @@ class CreateCatalogParams: Attributes: environment (str): name (str): - properties (list['EncryptedCatalogProperty']): + properties (list[EncryptedCatalogProperty]): type_ (CreateCatalogParamsType): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateCatalogParams.json. """ environment: str name: str - properties: list["EncryptedCatalogProperty"] + properties: list[EncryptedCatalogProperty] type_: CreateCatalogParamsType - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment @@ -46,6 +48,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, diff --git a/src/tower/tower_api_client/models/create_catalog_response.py b/src/tower/tower_api_client/models/create_catalog_response.py index a0812c81..6559c70f 100644 --- a/src/tower/tower_api_client/models/create_catalog_response.py +++ b/src/tower/tower_api_client/models/create_catalog_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateCatalogResponse: """ Attributes: catalog (Catalog): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateCatalogResponse.json. """ - catalog: "Catalog" - schema: Union[Unset, str] = UNSET + catalog: Catalog + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalog = self.catalog.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "catalog": catalog, diff --git a/src/tower/tower_api_client/models/create_device_login_ticket_response.py b/src/tower/tower_api_client/models/create_device_login_ticket_response.py index 1239bdf2..eb5c1ada 100644 --- a/src/tower/tower_api_client/models/create_device_login_ticket_response.py +++ b/src/tower/tower_api_client/models/create_device_login_ticket_response.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -21,7 +23,7 @@ class CreateDeviceLoginTicketResponse: login_url (str): The URL where the user should go to enter the user code. user_code (str): The code that the user needs to enter to authenticate. verification_url (str): The URL that the device should poll to check authentication status. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateDeviceLoginTicketResponse.json. """ @@ -32,7 +34,7 @@ class CreateDeviceLoginTicketResponse: login_url: str user_code: str verification_url: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: device_code = self.device_code @@ -52,6 +54,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "device_code": device_code, diff --git a/src/tower/tower_api_client/models/create_environment_params.py b/src/tower/tower_api_client/models/create_environment_params.py index 941bc5ac..b111d756 100644 --- a/src/tower/tower_api_client/models/create_environment_params.py +++ b/src/tower/tower_api_client/models/create_environment_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreateEnvironmentParams: """ Attributes: name (str): The name of the environment - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateEnvironmentParams.json. """ name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/create_environment_response.py b/src/tower/tower_api_client/models/create_environment_response.py index 621be5c2..3bd42020 100644 --- a/src/tower/tower_api_client/models/create_environment_response.py +++ b/src/tower/tower_api_client/models/create_environment_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateEnvironmentResponse: """ Attributes: environment (Environment): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateEnvironmentResponse.json. """ - environment: "Environment" - schema: Union[Unset, str] = UNSET + environment: Environment + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, diff --git a/src/tower/tower_api_client/models/create_password_reset_params.py b/src/tower/tower_api_client/models/create_password_reset_params.py index 7dd0988c..78c9bac3 100644 --- a/src/tower/tower_api_client/models/create_password_reset_params.py +++ b/src/tower/tower_api_client/models/create_password_reset_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreatePasswordResetParams: """ Attributes: email (str): The email address to send the password reset email to - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreatePasswordResetParams.json. """ email: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, diff --git a/src/tower/tower_api_client/models/create_password_reset_response.py b/src/tower/tower_api_client/models/create_password_reset_response.py index a694a76b..07371f08 100644 --- a/src/tower/tower_api_client/models/create_password_reset_response.py +++ b/src/tower/tower_api_client/models/create_password_reset_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreatePasswordResetResponse: """ Attributes: ok (bool): A boolean indicating the request was successfully processed. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreatePasswordResetResponse.json. """ ok: bool - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: ok = self.ok @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "ok": ok, diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py index 3f9837f0..4b8fec17 100644 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_params.py +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -14,13 +16,13 @@ class CreateSandboxSecretsParams: Attributes: environment (str): Environment to create secrets in secret_keys (list[str]): List of secret keys to create with Tower defaults - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSandboxSecretsParams.json. """ environment: str secret_keys: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, diff --git a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py index 03e1084c..246de164 100644 --- a/src/tower/tower_api_client/models/create_sandbox_secrets_response.py +++ b/src/tower/tower_api_client/models/create_sandbox_secrets_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreateSandboxSecretsResponse: """ Attributes: created (list[str]): List of secret keys that were created - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSandboxSecretsResponse.json. """ created: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: created = self.created @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "created": created, diff --git a/src/tower/tower_api_client/models/create_schedule_params.py b/src/tower/tower_api_client/models/create_schedule_params.py index 64ef1438..41d71485 100644 --- a/src/tower/tower_api_client/models/create_schedule_params.py +++ b/src/tower/tower_api_client/models/create_schedule_params.py @@ -1,8 +1,13 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.create_schedule_params_overlap_policy import ( + CreateScheduleParamsOverlapPolicy, +) from ..models.create_schedule_params_status import CreateScheduleParamsStatus from ..types import UNSET, Unset @@ -19,22 +24,30 @@ class CreateScheduleParams: Attributes: app_name (str): The name of the app to create a schedule for cron (str): The cron expression defining when the app should run - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateScheduleParams.json. - app_version (Union[None, Unset, str]): The specific app version to run (if omitted, will use the app's default + app_version (None | str | Unset): The specific app version to run (if omitted, will use the app's default version) - environment (Union[Unset, str]): The environment to run the app in Default: 'default'. - parameters (Union[Unset, list['RunParameter']]): Parameters to pass when running the app - status (Union[Unset, CreateScheduleParamsStatus]): The status of the schedule (defaults to active) + environment (str | Unset): The environment to run the app in Default: 'default'. + name (None | str | Unset): The name for this schedule. Must be unique per environment. If not set, one will be + generated for you. + overlap_policy (CreateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule Default: + CreateScheduleParamsOverlapPolicy.ALLOW. + parameters (list[RunParameter] | Unset): Parameters to pass when running the app + status (CreateScheduleParamsStatus | Unset): The status of the schedule (defaults to active) """ app_name: str cron: str - schema: Union[Unset, str] = UNSET - app_version: Union[None, Unset, str] = UNSET - environment: Union[Unset, str] = "default" - parameters: Union[Unset, list["RunParameter"]] = UNSET - status: Union[Unset, CreateScheduleParamsStatus] = UNSET + schema: str | Unset = UNSET + app_version: None | str | Unset = UNSET + environment: str | Unset = "default" + name: None | str | Unset = UNSET + overlap_policy: CreateScheduleParamsOverlapPolicy | Unset = ( + CreateScheduleParamsOverlapPolicy.ALLOW + ) + parameters: list[RunParameter] | Unset = UNSET + status: CreateScheduleParamsStatus | Unset = UNSET def to_dict(self) -> dict[str, Any]: app_name = self.app_name @@ -43,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema - app_version: Union[None, Unset, str] + app_version: None | str | Unset if isinstance(self.app_version, Unset): app_version = UNSET else: @@ -51,18 +64,29 @@ def to_dict(self) -> dict[str, Any]: environment = self.environment - parameters: Union[Unset, list[dict[str, Any]]] = UNSET + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + overlap_policy: str | Unset = UNSET + if not isinstance(self.overlap_policy, Unset): + overlap_policy = self.overlap_policy.value + + parameters: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: parameters_item = parameters_item_data.to_dict() parameters.append(parameters_item) - status: Union[Unset, str] = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.value field_dict: dict[str, Any] = {} + field_dict.update( { "app_name": app_name, @@ -75,6 +99,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["app_version"] = app_version if environment is not UNSET: field_dict["environment"] = environment + if name is not UNSET: + field_dict["name"] = name + if overlap_policy is not UNSET: + field_dict["overlap_policy"] = overlap_policy if parameters is not UNSET: field_dict["parameters"] = parameters if status is not UNSET: @@ -93,26 +121,44 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) - def _parse_app_version(data: object) -> Union[None, Unset, str]: + def _parse_app_version(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) app_version = _parse_app_version(d.pop("app_version", UNSET)) environment = d.pop("environment", UNSET) - parameters = [] + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + _overlap_policy = d.pop("overlap_policy", UNSET) + overlap_policy: CreateScheduleParamsOverlapPolicy | Unset + if isinstance(_overlap_policy, Unset): + overlap_policy = UNSET + else: + overlap_policy = CreateScheduleParamsOverlapPolicy(_overlap_policy) + _parameters = d.pop("parameters", UNSET) - for parameters_item_data in _parameters or []: - parameters_item = RunParameter.from_dict(parameters_item_data) + parameters: list[RunParameter] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameter.from_dict(parameters_item_data) - parameters.append(parameters_item) + parameters.append(parameters_item) _status = d.pop("status", UNSET) - status: Union[Unset, CreateScheduleParamsStatus] + status: CreateScheduleParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -124,6 +170,8 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: schema=schema, app_version=app_version, environment=environment, + name=name, + overlap_policy=overlap_policy, parameters=parameters, status=status, ) diff --git a/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py new file mode 100644 index 00000000..0c9a20db --- /dev/null +++ b/src/tower/tower_api_client/models/create_schedule_params_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CreateScheduleParamsOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/create_schedule_response.py b/src/tower/tower_api_client/models/create_schedule_response.py index 5e53c2dc..106ccc5c 100644 --- a/src/tower/tower_api_client/models/create_schedule_response.py +++ b/src/tower/tower_api_client/models/create_schedule_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateScheduleResponse: """ Attributes: schedule (Schedule): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateScheduleResponse.json. """ - schedule: "Schedule" - schema: Union[Unset, str] = UNSET + schedule: Schedule + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "schedule": schedule, diff --git a/src/tower/tower_api_client/models/create_secret_params.py b/src/tower/tower_api_client/models/create_secret_params.py index 1b7987b6..f2d22b65 100644 --- a/src/tower/tower_api_client/models/create_secret_params.py +++ b/src/tower/tower_api_client/models/create_secret_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,7 +18,7 @@ class CreateSecretParams: environment (str): name (str): preview (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSecretParams.json. """ @@ -24,7 +26,7 @@ class CreateSecretParams: environment: str name: str preview: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: encrypted_value = self.encrypted_value @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "encrypted_value": encrypted_value, diff --git a/src/tower/tower_api_client/models/create_secret_response.py b/src/tower/tower_api_client/models/create_secret_response.py index 9a674c9a..1a0d4f0b 100644 --- a/src/tower/tower_api_client/models/create_secret_response.py +++ b/src/tower/tower_api_client/models/create_secret_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateSecretResponse: """ Attributes: secret (Secret): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSecretResponse.json. """ - secret: "Secret" - schema: Union[Unset, str] = UNSET + secret: Secret + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: secret = self.secret.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "secret": secret, diff --git a/src/tower/tower_api_client/models/create_session_params.py b/src/tower/tower_api_client/models/create_session_params.py index 22e26432..6cf5d381 100644 --- a/src/tower/tower_api_client/models/create_session_params.py +++ b/src/tower/tower_api_client/models/create_session_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,16 +16,16 @@ class CreateSessionParams: Attributes: password (str): username (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSessionParams.json. - code (Union[Unset, str]): One-time password verification code for two-factor authentication. If the user has - two-factor authentication enabled, this code is required to log in. + code (str | Unset): One-time password verification code for two-factor authentication. If the user has two- + factor authentication enabled, this code is required to log in. """ password: str username: str - schema: Union[Unset, str] = UNSET - code: Union[Unset, str] = UNSET + schema: str | Unset = UNSET + code: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: password = self.password @@ -35,6 +37,7 @@ def to_dict(self) -> dict[str, Any]: code = self.code field_dict: dict[str, Any] = {} + field_dict.update( { "password": password, diff --git a/src/tower/tower_api_client/models/create_session_response.py b/src/tower/tower_api_client/models/create_session_response.py index 4ad05118..7f0490d1 100644 --- a/src/tower/tower_api_client/models/create_session_response.py +++ b/src/tower/tower_api_client/models/create_session_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateSessionResponse: """ Attributes: session (Session): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateSessionResponse.json. """ - session: "Session" - schema: Union[Unset, str] = UNSET + session: Session + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: session = self.session.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "session": session, diff --git a/src/tower/tower_api_client/models/create_team_params.py b/src/tower/tower_api_client/models/create_team_params.py index 133b67a9..58e53f60 100644 --- a/src/tower/tower_api_client/models/create_team_params.py +++ b/src/tower/tower_api_client/models/create_team_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class CreateTeamParams: """ Attributes: name (str): The name of the team to create - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateTeamParams.json. """ name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/create_team_response.py b/src/tower/tower_api_client/models/create_team_response.py index 34a37954..ffbdde2e 100644 --- a/src/tower/tower_api_client/models/create_team_response.py +++ b/src/tower/tower_api_client/models/create_team_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class CreateTeamResponse: """ Attributes: team (Team): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/CreateTeamResponse.json. """ - team: "Team" - schema: Union[Unset, str] = UNSET + team: Team + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team": team, diff --git a/src/tower/tower_api_client/models/create_webhook_params.py b/src/tower/tower_api_client/models/create_webhook_params.py new file mode 100644 index 00000000..ea81c248 --- /dev/null +++ b/src/tower/tower_api_client/models/create_webhook_params.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreateWebhookParams") + + +@_attrs_define +class CreateWebhookParams: + """ + Attributes: + name (str): The name of the webhook. + url (str): The webhook URL. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateWebhookParams.json. + """ + + name: str + url: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + url = self.url + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "url": url, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + url = d.pop("url") + + schema = d.pop("$schema", UNSET) + + create_webhook_params = cls( + name=name, + url=url, + schema=schema, + ) + + return create_webhook_params diff --git a/src/tower/tower_api_client/models/create_webhook_response.py b/src/tower/tower_api_client/models/create_webhook_response.py new file mode 100644 index 00000000..307dc4df --- /dev/null +++ b/src/tower/tower_api_client/models/create_webhook_response.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="CreateWebhookResponse") + + +@_attrs_define +class CreateWebhookResponse: + """ + Attributes: + signing_key (str): + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/CreateWebhookResponse.json. + """ + + signing_key: str + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + signing_key = self.signing_key + + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "signing_key": signing_key, + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + signing_key = d.pop("signing_key") + + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + create_webhook_response = cls( + signing_key=signing_key, + webhook=webhook, + schema=schema, + ) + + return create_webhook_response diff --git a/src/tower/tower_api_client/models/delete_api_key_params.py b/src/tower/tower_api_client/models/delete_api_key_params.py index c439720a..ed8f4576 100644 --- a/src/tower/tower_api_client/models/delete_api_key_params.py +++ b/src/tower/tower_api_client/models/delete_api_key_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DeleteAPIKeyParams: """ Attributes: identifier (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteAPIKeyParams.json. """ identifier: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: identifier = self.identifier @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "identifier": identifier, diff --git a/src/tower/tower_api_client/models/delete_api_key_response.py b/src/tower/tower_api_client/models/delete_api_key_response.py index 14ce3951..6620c674 100644 --- a/src/tower/tower_api_client/models/delete_api_key_response.py +++ b/src/tower/tower_api_client/models/delete_api_key_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteAPIKeyResponse: """ Attributes: api_key (APIKey): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteAPIKeyResponse.json. """ - api_key: "APIKey" - schema: Union[Unset, str] = UNSET + api_key: APIKey + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: api_key = self.api_key.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "api_key": api_key, diff --git a/src/tower/tower_api_client/models/delete_app_response.py b/src/tower/tower_api_client/models/delete_app_response.py index b2c1c244..b85ab342 100644 --- a/src/tower/tower_api_client/models/delete_app_response.py +++ b/src/tower/tower_api_client/models/delete_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteAppResponse: """ Attributes: app (App): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteAppResponse.json. """ - app: "App" - schema: Union[Unset, str] = UNSET + app: App + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: app = self.app.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "app": app, diff --git a/src/tower/tower_api_client/models/delete_authenticator_params.py b/src/tower/tower_api_client/models/delete_authenticator_params.py index be6a4fb7..375f3c9b 100644 --- a/src/tower/tower_api_client/models/delete_authenticator_params.py +++ b/src/tower/tower_api_client/models/delete_authenticator_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DeleteAuthenticatorParams: """ Attributes: authenticator_id (str): The ID of the authenticator to delete - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteAuthenticatorParams.json. """ authenticator_id: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticator_id = self.authenticator_id @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticator_id": authenticator_id, diff --git a/src/tower/tower_api_client/models/delete_authenticator_response.py b/src/tower/tower_api_client/models/delete_authenticator_response.py index 02696edb..e4076887 100644 --- a/src/tower/tower_api_client/models/delete_authenticator_response.py +++ b/src/tower/tower_api_client/models/delete_authenticator_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteAuthenticatorResponse: """ Attributes: authenticator (VerifiedAuthenticator): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteAuthenticatorResponse.json. """ - authenticator: "VerifiedAuthenticator" - schema: Union[Unset, str] = UNSET + authenticator: VerifiedAuthenticator + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticator = self.authenticator.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticator": authenticator, diff --git a/src/tower/tower_api_client/models/delete_catalog_response.py b/src/tower/tower_api_client/models/delete_catalog_response.py index d5c04c21..296e6813 100644 --- a/src/tower/tower_api_client/models/delete_catalog_response.py +++ b/src/tower/tower_api_client/models/delete_catalog_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteCatalogResponse: """ Attributes: catalog (Catalog): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteCatalogResponse.json. """ - catalog: "Catalog" - schema: Union[Unset, str] = UNSET + catalog: Catalog + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalog = self.catalog.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "catalog": catalog, diff --git a/src/tower/tower_api_client/models/delete_schedule_params.py b/src/tower/tower_api_client/models/delete_schedule_params.py index 29ee4ed6..81b6f2be 100644 --- a/src/tower/tower_api_client/models/delete_schedule_params.py +++ b/src/tower/tower_api_client/models/delete_schedule_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DeleteScheduleParams: """ Attributes: ids (list[str]): The IDs of the schedules to delete. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteScheduleParams.json. """ ids: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: ids = self.ids @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "ids": ids, diff --git a/src/tower/tower_api_client/models/delete_schedule_response.py b/src/tower/tower_api_client/models/delete_schedule_response.py index d1ad4891..9f18199e 100644 --- a/src/tower/tower_api_client/models/delete_schedule_response.py +++ b/src/tower/tower_api_client/models/delete_schedule_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class DeleteScheduleResponse: """ Attributes: - schedules (list['Schedule']): the schedules successfully deleted - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schedules (list[Schedule]): the schedules successfully deleted + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteScheduleResponse.json. """ - schedules: list["Schedule"] - schema: Union[Unset, str] = UNSET + schedules: list[Schedule] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schedules = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "schedules": schedules, diff --git a/src/tower/tower_api_client/models/delete_secret_response.py b/src/tower/tower_api_client/models/delete_secret_response.py index 274d6c7a..296708f1 100644 --- a/src/tower/tower_api_client/models/delete_secret_response.py +++ b/src/tower/tower_api_client/models/delete_secret_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteSecretResponse: """ Attributes: secret (Secret): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteSecretResponse.json. """ - secret: "Secret" - schema: Union[Unset, str] = UNSET + secret: Secret + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: secret = self.secret.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "secret": secret, diff --git a/src/tower/tower_api_client/models/delete_session_params.py b/src/tower/tower_api_client/models/delete_session_params.py new file mode 100644 index 00000000..a2972c2f --- /dev/null +++ b/src/tower/tower_api_client/models/delete_session_params.py @@ -0,0 +1,52 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteSessionParams") + + +@_attrs_define +class DeleteSessionParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteSessionParams.json. + session_id (str | Unset): The ID of the session to delete. If not provided, the current session will be deleted. + """ + + schema: str | Unset = UNSET + session_id: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + session_id = self.session_id + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if session_id is not UNSET: + field_dict["session_id"] = session_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + session_id = d.pop("session_id", UNSET) + + delete_session_params = cls( + schema=schema, + session_id=session_id, + ) + + return delete_session_params diff --git a/src/tower/tower_api_client/models/delete_session_response.py b/src/tower/tower_api_client/models/delete_session_response.py new file mode 100644 index 00000000..144f146d --- /dev/null +++ b/src/tower/tower_api_client/models/delete_session_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.session import Session + + +T = TypeVar("T", bound="DeleteSessionResponse") + + +@_attrs_define +class DeleteSessionResponse: + """ + Attributes: + session (Session): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteSessionResponse.json. + """ + + session: Session + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + session = self.session.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "session": session, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.session import Session + + d = dict(src_dict) + session = Session.from_dict(d.pop("session")) + + schema = d.pop("$schema", UNSET) + + delete_session_response = cls( + session=session, + schema=schema, + ) + + return delete_session_response diff --git a/src/tower/tower_api_client/models/delete_team_invitation_params.py b/src/tower/tower_api_client/models/delete_team_invitation_params.py index 98ddb9dd..6f380838 100644 --- a/src/tower/tower_api_client/models/delete_team_invitation_params.py +++ b/src/tower/tower_api_client/models/delete_team_invitation_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DeleteTeamInvitationParams: """ Attributes: email (str): The email address of the team member to remove - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteTeamInvitationParams.json. """ email: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, diff --git a/src/tower/tower_api_client/models/delete_team_invitation_response.py b/src/tower/tower_api_client/models/delete_team_invitation_response.py index 1feb8f19..50594e98 100644 --- a/src/tower/tower_api_client/models/delete_team_invitation_response.py +++ b/src/tower/tower_api_client/models/delete_team_invitation_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteTeamInvitationResponse: """ Attributes: invitation (TeamInvitation): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteTeamInvitationResponse.json. """ - invitation: "TeamInvitation" - schema: Union[Unset, str] = UNSET + invitation: TeamInvitation + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: invitation = self.invitation.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "invitation": invitation, diff --git a/src/tower/tower_api_client/models/delete_team_params.py b/src/tower/tower_api_client/models/delete_team_params.py index 379b45b6..6621caf9 100644 --- a/src/tower/tower_api_client/models/delete_team_params.py +++ b/src/tower/tower_api_client/models/delete_team_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DeleteTeamParams: """ Attributes: name (str): The name of the team to delete - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteTeamParams.json. """ name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/delete_team_response.py b/src/tower/tower_api_client/models/delete_team_response.py index d530b37e..efb2335f 100644 --- a/src/tower/tower_api_client/models/delete_team_response.py +++ b/src/tower/tower_api_client/models/delete_team_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeleteTeamResponse: """ Attributes: team (Team): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeleteTeamResponse.json. """ - team: "Team" - schema: Union[Unset, str] = UNSET + team: Team + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team": team, diff --git a/src/tower/tower_api_client/models/delete_webhook_response.py b/src/tower/tower_api_client/models/delete_webhook_response.py new file mode 100644 index 00000000..f62d5f75 --- /dev/null +++ b/src/tower/tower_api_client/models/delete_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="DeleteWebhookResponse") + + +@_attrs_define +class DeleteWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DeleteWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + delete_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return delete_webhook_response diff --git a/src/tower/tower_api_client/models/deploy_app_json_body.py b/src/tower/tower_api_client/models/deploy_app_json_body.py index f2d8fd93..6109dff8 100644 --- a/src/tower/tower_api_client/models/deploy_app_json_body.py +++ b/src/tower/tower_api_client/models/deploy_app_json_body.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/src/tower/tower_api_client/models/deploy_app_response.py b/src/tower/tower_api_client/models/deploy_app_response.py index 2ce1c74b..f79f32b2 100644 --- a/src/tower/tower_api_client/models/deploy_app_response.py +++ b/src/tower/tower_api_client/models/deploy_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DeployAppResponse: """ Attributes: version (AppVersion): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DeployAppResponse.json. """ - version: "AppVersion" - schema: Union[Unset, str] = UNSET + version: AppVersion + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: version = self.version.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "version": version, diff --git a/src/tower/tower_api_client/models/describe_account_body.py b/src/tower/tower_api_client/models/describe_account_body.py index 2f849f74..dd52a92e 100644 --- a/src/tower/tower_api_client/models/describe_account_body.py +++ b/src/tower/tower_api_client/models/describe_account_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DescribeAccountBody: """ Attributes: account (Account): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeAccountBody.json. """ - account: "Account" - schema: Union[Unset, str] = UNSET + account: Account + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: account = self.account.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "account": account, diff --git a/src/tower/tower_api_client/models/describe_app_response.py b/src/tower/tower_api_client/models/describe_app_response.py index 5ac79e33..6609f92d 100644 --- a/src/tower/tower_api_client/models/describe_app_response.py +++ b/src/tower/tower_api_client/models/describe_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class DescribeAppResponse: """ Attributes: app (App): - runs (list['Run']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeAppResponse.json. """ - app: "App" - runs: list["Run"] - schema: Union[Unset, str] = UNSET + app: App + runs: list[Run] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: app = self.app.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "app": app, diff --git a/src/tower/tower_api_client/models/describe_app_version_response.py b/src/tower/tower_api_client/models/describe_app_version_response.py index 71e67608..a073e3e5 100644 --- a/src/tower/tower_api_client/models/describe_app_version_response.py +++ b/src/tower/tower_api_client/models/describe_app_version_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DescribeAppVersionResponse: """ Attributes: version (AppVersion): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeAppVersionResponse.json. """ - version: "AppVersion" - schema: Union[Unset, str] = UNSET + version: AppVersion + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: version = self.version.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "version": version, diff --git a/src/tower/tower_api_client/models/describe_authentication_context_body.py b/src/tower/tower_api_client/models/describe_authentication_context_body.py new file mode 100644 index 00000000..b0e5b414 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_authentication_context_body.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.authentication_context import AuthenticationContext + + +T = TypeVar("T", bound="DescribeAuthenticationContextBody") + + +@_attrs_define +class DescribeAuthenticationContextBody: + """ + Attributes: + authentication_context (AuthenticationContext): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeAuthenticationContextBody.json. + """ + + authentication_context: AuthenticationContext + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + authentication_context = self.authentication_context.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "authentication_context": authentication_context, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.authentication_context import AuthenticationContext + + d = dict(src_dict) + authentication_context = AuthenticationContext.from_dict( + d.pop("authentication_context") + ) + + schema = d.pop("$schema", UNSET) + + describe_authentication_context_body = cls( + authentication_context=authentication_context, + schema=schema, + ) + + return describe_authentication_context_body diff --git a/src/tower/tower_api_client/models/describe_device_login_session_response.py b/src/tower/tower_api_client/models/describe_device_login_session_response.py index 93e0e393..807a7cd0 100644 --- a/src/tower/tower_api_client/models/describe_device_login_session_response.py +++ b/src/tower/tower_api_client/models/describe_device_login_session_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DescribeDeviceLoginSessionResponse: """ Attributes: session (Session): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeDeviceLoginSessionResponse.json. """ - session: "Session" - schema: Union[Unset, str] = UNSET + session: Session + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: session = self.session.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "session": session, diff --git a/src/tower/tower_api_client/models/describe_email_preferences_body.py b/src/tower/tower_api_client/models/describe_email_preferences_body.py index 8841477b..9c554994 100644 --- a/src/tower/tower_api_client/models/describe_email_preferences_body.py +++ b/src/tower/tower_api_client/models/describe_email_preferences_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DescribeEmailPreferencesBody: """ Attributes: subscriptions (EmailSubscriptions): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeEmailPreferencesBody.json. """ - subscriptions: "EmailSubscriptions" - schema: Union[Unset, str] = UNSET + subscriptions: EmailSubscriptions + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: subscriptions = self.subscriptions.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "subscriptions": subscriptions, diff --git a/src/tower/tower_api_client/models/describe_plan_response.py b/src/tower/tower_api_client/models/describe_plan_response.py new file mode 100644 index 00000000..3b6e8416 --- /dev/null +++ b/src/tower/tower_api_client/models/describe_plan_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.plan import Plan + + +T = TypeVar("T", bound="DescribePlanResponse") + + +@_attrs_define +class DescribePlanResponse: + """ + Attributes: + plan (Plan): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribePlanResponse.json. + """ + + plan: Plan + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + plan = self.plan.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "plan": plan, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.plan import Plan + + d = dict(src_dict) + plan = Plan.from_dict(d.pop("plan")) + + schema = d.pop("$schema", UNSET) + + describe_plan_response = cls( + plan=plan, + schema=schema, + ) + + return describe_plan_response diff --git a/src/tower/tower_api_client/models/describe_run_graph_response.py b/src/tower/tower_api_client/models/describe_run_graph_response.py index ed131b61..2f3d3230 100644 --- a/src/tower/tower_api_client/models/describe_run_graph_response.py +++ b/src/tower/tower_api_client/models/describe_run_graph_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class DescribeRunGraphResponse: """ Attributes: - runs (list['RunGraphNode']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + runs (list[RunGraphNode]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeRunGraphResponse.json. """ - runs: list["RunGraphNode"] - schema: Union[Unset, str] = UNSET + runs: list[RunGraphNode] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: runs = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "runs": runs, diff --git a/src/tower/tower_api_client/models/describe_run_links.py b/src/tower/tower_api_client/models/describe_run_links.py index 03f717fb..4089aead 100644 --- a/src/tower/tower_api_client/models/describe_run_links.py +++ b/src/tower/tower_api_client/models/describe_run_links.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -10,25 +12,26 @@ class DescribeRunLinks: """ Attributes: - next_ (Union[None, str]): The URL of the next run, if any. - prev (Union[None, str]): The URL of the previous run, if any. + next_ (None | str): The URL of the next run, if any. + prev (None | str): The URL of the previous run, if any. self_ (str): The URL of this run. """ - next_: Union[None, str] - prev: Union[None, str] + next_: None | str + prev: None | str self_: str def to_dict(self) -> dict[str, Any]: - next_: Union[None, str] + next_: None | str next_ = self.next_ - prev: Union[None, str] + prev: None | str prev = self.prev self_ = self.self_ field_dict: dict[str, Any] = {} + field_dict.update( { "next": next_, @@ -43,17 +46,17 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_next_(data: object) -> Union[None, str]: + def _parse_next_(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) next_ = _parse_next_(d.pop("next")) - def _parse_prev(data: object) -> Union[None, str]: + def _parse_prev(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) prev = _parse_prev(d.pop("prev")) diff --git a/src/tower/tower_api_client/models/describe_run_logs_response.py b/src/tower/tower_api_client/models/describe_run_logs_response.py index 83a09d8f..9140272f 100644 --- a/src/tower/tower_api_client/models/describe_run_logs_response.py +++ b/src/tower/tower_api_client/models/describe_run_logs_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class DescribeRunLogsResponse: """ Attributes: - log_lines (list['RunLogLine']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + log_lines (list[RunLogLine]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeRunLogsResponse.json. """ - log_lines: list["RunLogLine"] - schema: Union[Unset, str] = UNSET + log_lines: list[RunLogLine] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: log_lines = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "log_lines": log_lines, diff --git a/src/tower/tower_api_client/models/describe_run_response.py b/src/tower/tower_api_client/models/describe_run_response.py index d1275df3..eb1a0fa8 100644 --- a/src/tower/tower_api_client/models/describe_run_response.py +++ b/src/tower/tower_api_client/models/describe_run_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -19,13 +21,13 @@ class DescribeRunResponse: Attributes: links (DescribeRunLinks): run (Run): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeRunResponse.json. """ - links: "DescribeRunLinks" - run: "Run" - schema: Union[Unset, str] = UNSET + links: DescribeRunLinks + run: Run + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: links = self.links.to_dict() @@ -35,6 +37,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "$links": links, diff --git a/src/tower/tower_api_client/models/describe_secrets_key_response.py b/src/tower/tower_api_client/models/describe_secrets_key_response.py index adb2c56e..855a4cdd 100644 --- a/src/tower/tower_api_client/models/describe_secrets_key_response.py +++ b/src/tower/tower_api_client/models/describe_secrets_key_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class DescribeSecretsKeyResponse: """ Attributes: public_key (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeSecretsKeyResponse.json. """ public_key: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: public_key = self.public_key @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "public_key": public_key, diff --git a/src/tower/tower_api_client/models/describe_session_response.py b/src/tower/tower_api_client/models/describe_session_response.py index 5c519fac..132b2c0b 100644 --- a/src/tower/tower_api_client/models/describe_session_response.py +++ b/src/tower/tower_api_client/models/describe_session_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class DescribeSessionResponse: """ Attributes: session (Session): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/DescribeSessionResponse.json. """ - session: "Session" - schema: Union[Unset, str] = UNSET + session: Session + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: session = self.session.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "session": session, diff --git a/src/tower/tower_api_client/models/describe_team_response.py b/src/tower/tower_api_client/models/describe_team_response.py new file mode 100644 index 00000000..1d065bef --- /dev/null +++ b/src/tower/tower_api_client/models/describe_team_response.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team import Team + from ..models.team_invitation import TeamInvitation + from ..models.user import User + + +T = TypeVar("T", bound="DescribeTeamResponse") + + +@_attrs_define +class DescribeTeamResponse: + """ + Attributes: + invitations (list[TeamInvitation]): Pending team invitations + members (list[User]): The members of the team + team (Team): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeTeamResponse.json. + """ + + invitations: list[TeamInvitation] + members: list[User] + team: Team + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + invitations = [] + for invitations_item_data in self.invitations: + invitations_item = invitations_item_data.to_dict() + invitations.append(invitations_item) + + members = [] + for members_item_data in self.members: + members_item = members_item_data.to_dict() + members.append(members_item) + + team = self.team.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "invitations": invitations, + "members": members, + "team": team, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + from ..models.team_invitation import TeamInvitation + from ..models.user import User + + d = dict(src_dict) + invitations = [] + _invitations = d.pop("invitations") + for invitations_item_data in _invitations: + invitations_item = TeamInvitation.from_dict(invitations_item_data) + + invitations.append(invitations_item) + + members = [] + _members = d.pop("members") + for members_item_data in _members: + members_item = User.from_dict(members_item_data) + + members.append(members_item) + + team = Team.from_dict(d.pop("team")) + + schema = d.pop("$schema", UNSET) + + describe_team_response = cls( + invitations=invitations, + members=members, + team=team, + schema=schema, + ) + + return describe_team_response diff --git a/src/tower/tower_api_client/models/describe_webhook_response.py b/src/tower/tower_api_client/models/describe_webhook_response.py new file mode 100644 index 00000000..0d34a83e --- /dev/null +++ b/src/tower/tower_api_client/models/describe_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="DescribeWebhookResponse") + + +@_attrs_define +class DescribeWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/DescribeWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + describe_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return describe_webhook_response diff --git a/src/tower/tower_api_client/models/email_subscriptions.py b/src/tower/tower_api_client/models/email_subscriptions.py index d14390c9..c83bc98c 100644 --- a/src/tower/tower_api_client/models/email_subscriptions.py +++ b/src/tower/tower_api_client/models/email_subscriptions.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,14 +14,14 @@ class EmailSubscriptions: """ Attributes: - feature_updates (Union[Unset, bool]): - marketing_emails (Union[Unset, bool]): - tower_newsletter (Union[Unset, bool]): + feature_updates (bool | Unset): + marketing_emails (bool | Unset): + tower_newsletter (bool | Unset): """ - feature_updates: Union[Unset, bool] = UNSET - marketing_emails: Union[Unset, bool] = UNSET - tower_newsletter: Union[Unset, bool] = UNSET + feature_updates: bool | Unset = UNSET + marketing_emails: bool | Unset = UNSET + tower_newsletter: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: feature_updates = self.feature_updates @@ -29,6 +31,7 @@ def to_dict(self) -> dict[str, Any]: tower_newsletter = self.tower_newsletter field_dict: dict[str, Any] = {} + field_dict.update({}) if feature_updates is not UNSET: field_dict["feature_updates"] = feature_updates diff --git a/src/tower/tower_api_client/models/encrypted_catalog_property.py b/src/tower/tower_api_client/models/encrypted_catalog_property.py index a4ec7368..368ee0d6 100644 --- a/src/tower/tower_api_client/models/encrypted_catalog_property.py +++ b/src/tower/tower_api_client/models/encrypted_catalog_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -27,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: preview = self.preview field_dict: dict[str, Any] = {} + field_dict.update( { "encrypted_value": encrypted_value, diff --git a/src/tower/tower_api_client/models/environment.py b/src/tower/tower_api_client/models/environment.py index 8c6ec596..065ebd2e 100644 --- a/src/tower/tower_api_client/models/environment.py +++ b/src/tower/tower_api_client/models/environment.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,6 +21,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/error_detail.py b/src/tower/tower_api_client/models/error_detail.py index 6b5c094d..fbcb181a 100644 --- a/src/tower/tower_api_client/models/error_detail.py +++ b/src/tower/tower_api_client/models/error_detail.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,14 +14,14 @@ class ErrorDetail: """ Attributes: - location (Union[Unset, str]): Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' - message (Union[Unset, str]): Error message text - value (Union[Unset, Any]): The value at the given location + location (str | Unset): Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' + message (str | Unset): Error message text + value (Any | Unset): The value at the given location """ - location: Union[Unset, str] = UNSET - message: Union[Unset, str] = UNSET - value: Union[Unset, Any] = UNSET + location: str | Unset = UNSET + message: str | Unset = UNSET + value: Any | Unset = UNSET def to_dict(self) -> dict[str, Any]: location = self.location @@ -29,6 +31,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} + field_dict.update({}) if location is not UNSET: field_dict["location"] = location diff --git a/src/tower/tower_api_client/models/error_model.py b/src/tower/tower_api_client/models/error_model.py index 686ce2c3..64710047 100644 --- a/src/tower/tower_api_client/models/error_model.py +++ b/src/tower/tower_api_client/models/error_model.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,34 +18,34 @@ class ErrorModel: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ErrorModel.json. - detail (Union[Unset, str]): A human-readable explanation specific to this occurrence of the problem. Example: - Property foo is required but is missing.. - errors (Union[Unset, list['ErrorDetail']]): Optional list of individual error details - instance (Union[Unset, str]): A URI reference that identifies the specific occurrence of the problem. Example: + detail (str | Unset): A human-readable explanation specific to this occurrence of the problem. Example: Property + foo is required but is missing.. + errors (list[ErrorDetail] | Unset): Optional list of individual error details + instance (str | Unset): A URI reference that identifies the specific occurrence of the problem. Example: https://example.com/error-log/abc123. - status (Union[Unset, int]): HTTP status code Example: 400. - title (Union[Unset, str]): A short, human-readable summary of the problem type. This value should not change - between occurrences of the error. Example: Bad Request. - type_ (Union[Unset, str]): A URI reference to human-readable documentation for the error. Default: - 'about:blank'. Example: https://example.com/errors/example. + status (int | Unset): HTTP status code Example: 400. + title (str | Unset): A short, human-readable summary of the problem type. This value should not change between + occurrences of the error. Example: Bad Request. + type_ (str | Unset): A URI reference to human-readable documentation for the error. Default: 'about:blank'. + Example: https://example.com/errors/example. """ - schema: Union[Unset, str] = UNSET - detail: Union[Unset, str] = UNSET - errors: Union[Unset, list["ErrorDetail"]] = UNSET - instance: Union[Unset, str] = UNSET - status: Union[Unset, int] = UNSET - title: Union[Unset, str] = UNSET - type_: Union[Unset, str] = "about:blank" + schema: str | Unset = UNSET + detail: str | Unset = UNSET + errors: list[ErrorDetail] | Unset = UNSET + instance: str | Unset = UNSET + status: int | Unset = UNSET + title: str | Unset = UNSET + type_: str | Unset = "about:blank" def to_dict(self) -> dict[str, Any]: schema = self.schema detail = self.detail - errors: Union[Unset, list[dict[str, Any]]] = UNSET + errors: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.errors, Unset): errors = [] for errors_item_data in self.errors: @@ -59,6 +61,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema @@ -86,12 +89,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: detail = d.pop("detail", UNSET) - errors = [] _errors = d.pop("errors", UNSET) - for errors_item_data in _errors or []: - errors_item = ErrorDetail.from_dict(errors_item_data) + errors: list[ErrorDetail] | Unset = UNSET + if _errors is not UNSET: + errors = [] + for errors_item_data in _errors: + errors_item = ErrorDetail.from_dict(errors_item_data) - errors.append(errors_item) + errors.append(errors_item) instance = d.pop("instance", UNSET) diff --git a/src/tower/tower_api_client/models/export_catalogs_params.py b/src/tower/tower_api_client/models/export_catalogs_params.py index 0959f686..8183ce47 100644 --- a/src/tower/tower_api_client/models/export_catalogs_params.py +++ b/src/tower/tower_api_client/models/export_catalogs_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +19,7 @@ class ExportCatalogsParams: page (int): The page number to fetch. Default: 1. page_size (int): The number of records to fetch on each page. Default: 20. public_key (str): The PEM-encoded public key you want to use to encrypt sensitive catalog properties. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ExportCatalogsParams.json. """ @@ -26,7 +28,7 @@ class ExportCatalogsParams: environment: str = "default" page: int = 1 page_size: int = 20 - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: all_ = self.all_ @@ -42,6 +44,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "all": all_, diff --git a/src/tower/tower_api_client/models/export_catalogs_response.py b/src/tower/tower_api_client/models/export_catalogs_response.py index 9a825c09..967665bf 100644 --- a/src/tower/tower_api_client/models/export_catalogs_response.py +++ b/src/tower/tower_api_client/models/export_catalogs_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ExportCatalogsResponse: """ Attributes: - catalogs (list['ExportedCatalog']): + catalogs (list[ExportedCatalog]): pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ExportCatalogsResponse.json. """ - catalogs: list["ExportedCatalog"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + catalogs: list[ExportedCatalog] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalogs = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "catalogs": catalogs, diff --git a/src/tower/tower_api_client/models/export_secrets_params.py b/src/tower/tower_api_client/models/export_secrets_params.py index 2fc31955..a4ffbedc 100644 --- a/src/tower/tower_api_client/models/export_secrets_params.py +++ b/src/tower/tower_api_client/models/export_secrets_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -17,7 +19,7 @@ class ExportSecretsParams: page (int): The page number to fetch. Default: 1. page_size (int): The number of records to fetch on each page. Default: 20. public_key (str): The PEM-encoded public key you want to use to encrypt sensitive secret values. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ExportSecretsParams.json. """ @@ -26,7 +28,7 @@ class ExportSecretsParams: environment: str = "default" page: int = 1 page_size: int = 20 - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: all_ = self.all_ @@ -42,6 +44,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "all": all_, diff --git a/src/tower/tower_api_client/models/export_secrets_response.py b/src/tower/tower_api_client/models/export_secrets_response.py index 3663adaa..7002e11e 100644 --- a/src/tower/tower_api_client/models/export_secrets_response.py +++ b/src/tower/tower_api_client/models/export_secrets_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ExportSecretsResponse: """ Attributes: pages (Pagination): - secrets (list['ExportedSecret']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + secrets (list[ExportedSecret]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ExportSecretsResponse.json. """ - pages: "Pagination" - secrets: list["ExportedSecret"] - schema: Union[Unset, str] = UNSET + pages: Pagination + secrets: list[ExportedSecret] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/exported_catalog.py b/src/tower/tower_api_client/models/exported_catalog.py index 183a169a..0a18c5db 100644 --- a/src/tower/tower_api_client/models/exported_catalog.py +++ b/src/tower/tower_api_client/models/exported_catalog.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -21,17 +23,17 @@ class ExportedCatalog: created_at (datetime.datetime): environment (str): name (str): - properties (list['ExportedCatalogProperty']): + properties (list[ExportedCatalogProperty]): type_ (str): - slug (Union[Unset, str]): This property is deprecated. Please use name instead. + slug (str | Unset): This property is deprecated. Use name instead. """ created_at: datetime.datetime environment: str name: str - properties: list["ExportedCatalogProperty"] + properties: list[ExportedCatalogProperty] type_: str - slug: Union[Unset, str] = UNSET + slug: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() @@ -50,6 +52,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug field_dict: dict[str, Any] = {} + field_dict.update( { "CreatedAt": created_at, diff --git a/src/tower/tower_api_client/models/exported_catalog_property.py b/src/tower/tower_api_client/models/exported_catalog_property.py index 0da6c872..f29e0a05 100644 --- a/src/tower/tower_api_client/models/exported_catalog_property.py +++ b/src/tower/tower_api_client/models/exported_catalog_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -27,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: preview = self.preview field_dict: dict[str, Any] = {} + field_dict.update( { "encrypted_value": encrypted_value, diff --git a/src/tower/tower_api_client/models/exported_secret.py b/src/tower/tower_api_client/models/exported_secret.py index c46ba8a2..608e8609 100644 --- a/src/tower/tower_api_client/models/exported_secret.py +++ b/src/tower/tower_api_client/models/exported_secret.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, diff --git a/src/tower/tower_api_client/models/feature.py b/src/tower/tower_api_client/models/feature.py new file mode 100644 index 00000000..22c2e91e --- /dev/null +++ b/src/tower/tower_api_client/models/feature.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="Feature") + + +@_attrs_define +class Feature: + """ + Attributes: + code (str): + name (str): + type_ (str): + value (int): + """ + + code: str + name: str + type_: str + value: int + + def to_dict(self) -> dict[str, Any]: + code = self.code + + name = self.name + + type_ = self.type_ + + value = self.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "code": code, + "name": name, + "type": type_, + "value": value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + code = d.pop("code") + + name = d.pop("name") + + type_ = d.pop("type") + + value = d.pop("value") + + feature = cls( + code=code, + name=name, + type_=type_, + value=value, + ) + + return feature diff --git a/src/tower/tower_api_client/models/featurebase_identity.py b/src/tower/tower_api_client/models/featurebase_identity.py index d1b01059..129d51a6 100644 --- a/src/tower/tower_api_client/models/featurebase_identity.py +++ b/src/tower/tower_api_client/models/featurebase_identity.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -23,6 +25,7 @@ def to_dict(self) -> dict[str, Any]: user_hash = self.user_hash field_dict: dict[str, Any] = {} + field_dict.update( { "company_hash": company_hash, diff --git a/src/tower/tower_api_client/models/features.py b/src/tower/tower_api_client/models/features.py deleted file mode 100644 index 4543f273..00000000 --- a/src/tower/tower_api_client/models/features.py +++ /dev/null @@ -1,75 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, Union - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Features") - - -@_attrs_define -class Features: - """ - Attributes: - has_self_hosted_runners (Union[Unset, bool]): Whether self-hosted runners are enabled - num_apps (Union[Unset, int]): The number of apps that can be created - num_minutes (Union[Unset, int]): The number of minutes that can be used for free per month - num_schedules (Union[Unset, int]): The number of schedules that can be created - num_team_members (Union[Unset, int]): The number of team members that can be added - """ - - has_self_hosted_runners: Union[Unset, bool] = UNSET - num_apps: Union[Unset, int] = UNSET - num_minutes: Union[Unset, int] = UNSET - num_schedules: Union[Unset, int] = UNSET - num_team_members: Union[Unset, int] = UNSET - - def to_dict(self) -> dict[str, Any]: - has_self_hosted_runners = self.has_self_hosted_runners - - num_apps = self.num_apps - - num_minutes = self.num_minutes - - num_schedules = self.num_schedules - - num_team_members = self.num_team_members - - field_dict: dict[str, Any] = {} - field_dict.update({}) - if has_self_hosted_runners is not UNSET: - field_dict["has_self_hosted_runners"] = has_self_hosted_runners - if num_apps is not UNSET: - field_dict["num_apps"] = num_apps - if num_minutes is not UNSET: - field_dict["num_minutes"] = num_minutes - if num_schedules is not UNSET: - field_dict["num_schedules"] = num_schedules - if num_team_members is not UNSET: - field_dict["num_team_members"] = num_team_members - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - has_self_hosted_runners = d.pop("has_self_hosted_runners", UNSET) - - num_apps = d.pop("num_apps", UNSET) - - num_minutes = d.pop("num_minutes", UNSET) - - num_schedules = d.pop("num_schedules", UNSET) - - num_team_members = d.pop("num_team_members", UNSET) - - features = cls( - has_self_hosted_runners=has_self_hosted_runners, - num_apps=num_apps, - num_minutes=num_minutes, - num_schedules=num_schedules, - num_team_members=num_team_members, - ) - - return features diff --git a/src/tower/tower_api_client/models/generate_app_statistics_response.py b/src/tower/tower_api_client/models/generate_app_statistics_response.py index 4d99a62d..175f6ed0 100644 --- a/src/tower/tower_api_client/models/generate_app_statistics_response.py +++ b/src/tower/tower_api_client/models/generate_app_statistics_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class GenerateAppStatisticsResponse: """ Attributes: statistics (AppStatistics): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/GenerateAppStatisticsResponse.json. """ - statistics: "AppStatistics" - schema: Union[Unset, str] = UNSET + statistics: AppStatistics + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: statistics = self.statistics.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "statistics": statistics, diff --git a/src/tower/tower_api_client/models/generate_authenticator_response.py b/src/tower/tower_api_client/models/generate_authenticator_response.py index aab9405b..1a2a39f0 100644 --- a/src/tower/tower_api_client/models/generate_authenticator_response.py +++ b/src/tower/tower_api_client/models/generate_authenticator_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class GenerateAuthenticatorResponse: """ Attributes: authenticator (UnverifiedAuthenticator): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/GenerateAuthenticatorResponse.json. """ - authenticator: "UnverifiedAuthenticator" - schema: Union[Unset, str] = UNSET + authenticator: UnverifiedAuthenticator + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticator = self.authenticator.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticator": authenticator, diff --git a/src/tower/tower_api_client/models/generate_run_statistics_response.py b/src/tower/tower_api_client/models/generate_run_statistics_response.py index 48bc6786..babee7b8 100644 --- a/src/tower/tower_api_client/models/generate_run_statistics_response.py +++ b/src/tower/tower_api_client/models/generate_run_statistics_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,17 +20,17 @@ class GenerateRunStatisticsResponse: """ Attributes: - series (list['RunTimeseriesPoint']): + series (list[RunTimeseriesPoint]): settings (StatisticsSettings): stats (RunStatistics): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/GenerateRunStatisticsResponse.json. """ - series: list["RunTimeseriesPoint"] - settings: "StatisticsSettings" - stats: "RunStatistics" - schema: Union[Unset, str] = UNSET + series: list[RunTimeseriesPoint] + settings: StatisticsSettings + stats: RunStatistics + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: series = [] @@ -43,6 +45,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "series": series, diff --git a/src/tower/tower_api_client/models/generate_runner_credentials_response.py b/src/tower/tower_api_client/models/generate_runner_credentials_response.py index 928b6cd6..f00c2ac3 100644 --- a/src/tower/tower_api_client/models/generate_runner_credentials_response.py +++ b/src/tower/tower_api_client/models/generate_runner_credentials_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class GenerateRunnerCredentialsResponse: """ Attributes: credentials (RunnerCredentials): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/GenerateRunnerCredentialsResponse.json. """ - credentials: "RunnerCredentials" - schema: Union[Unset, str] = UNSET + credentials: RunnerCredentials + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: credentials = self.credentials.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "credentials": credentials, diff --git a/src/tower/tower_api_client/models/get_feature_flag_response_body.py b/src/tower/tower_api_client/models/get_feature_flag_response_body.py index c61447c8..6dbae81b 100644 --- a/src/tower/tower_api_client/models/get_feature_flag_response_body.py +++ b/src/tower/tower_api_client/models/get_feature_flag_response_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -19,7 +21,7 @@ class GetFeatureFlagResponseBody: key (str): The feature flag key value (Any): The flag value (type depends on value_type) value_type (GetFeatureFlagResponseBodyValueType): The type of the value - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/GetFeatureFlagResponseBody.json. """ @@ -27,7 +29,7 @@ class GetFeatureFlagResponseBody: key: str value: Any value_type: GetFeatureFlagResponseBodyValueType - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: enabled = self.enabled @@ -41,6 +43,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "enabled": enabled, diff --git a/src/tower/tower_api_client/models/invite_team_member_params.py b/src/tower/tower_api_client/models/invite_team_member_params.py index 9bc20561..4d09366c 100644 --- a/src/tower/tower_api_client/models/invite_team_member_params.py +++ b/src/tower/tower_api_client/models/invite_team_member_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,14 +16,14 @@ class InviteTeamMemberParams: Attributes: emails (str): The email addresses of the people to invite. It can be a list in any format (comma separated, newline separated, etc.) and it will be parsed into individual addresses - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/InviteTeamMemberParams.json. - message (Union[Unset, str]): Optional message to include in the invite email + message (str | Unset): Optional message to include in the invite email """ emails: str - schema: Union[Unset, str] = UNSET - message: Union[Unset, str] = UNSET + schema: str | Unset = UNSET + message: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: emails = self.emails @@ -31,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message field_dict: dict[str, Any] = {} + field_dict.update( { "emails": emails, diff --git a/src/tower/tower_api_client/models/invite_team_member_response.py b/src/tower/tower_api_client/models/invite_team_member_response.py index e166b164..8e2faf3e 100644 --- a/src/tower/tower_api_client/models/invite_team_member_response.py +++ b/src/tower/tower_api_client/models/invite_team_member_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class InviteTeamMemberResponse: """ Attributes: - team_invitations (list['TeamInvitation']): The team invitation that you created - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + team_invitations (list[TeamInvitation]): The team invitation that you created + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/InviteTeamMemberResponse.json. """ - team_invitations: list["TeamInvitation"] - schema: Union[Unset, str] = UNSET + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_invitations = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_invitations": team_invitations, diff --git a/src/tower/tower_api_client/models/leave_team_response.py b/src/tower/tower_api_client/models/leave_team_response.py index 3c6dc07e..381a9b26 100644 --- a/src/tower/tower_api_client/models/leave_team_response.py +++ b/src/tower/tower_api_client/models/leave_team_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class LeaveTeamResponse: """ Attributes: team (Team): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/LeaveTeamResponse.json. """ - team: "Team" - schema: Union[Unset, str] = UNSET + team: Team + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team": team, diff --git a/src/tower/tower_api_client/models/list_account_plans_response.py b/src/tower/tower_api_client/models/list_account_plans_response.py deleted file mode 100644 index 5831fa00..00000000 --- a/src/tower/tower_api_client/models/list_account_plans_response.py +++ /dev/null @@ -1,75 +0,0 @@ -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union - -from attrs import define as _attrs_define - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.pagination import Pagination - from ..models.plan import Plan - - -T = TypeVar("T", bound="ListAccountPlansResponse") - - -@_attrs_define -class ListAccountPlansResponse: - """ - Attributes: - pages (Pagination): - plans (list['Plan']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: - https://api.tower.dev/v1/schemas/ListAccountPlansResponse.json. - """ - - pages: "Pagination" - plans: list["Plan"] - schema: Union[Unset, str] = UNSET - - def to_dict(self) -> dict[str, Any]: - pages = self.pages.to_dict() - - plans = [] - for plans_item_data in self.plans: - plans_item = plans_item_data.to_dict() - plans.append(plans_item) - - schema = self.schema - - field_dict: dict[str, Any] = {} - field_dict.update( - { - "pages": pages, - "plans": plans, - } - ) - if schema is not UNSET: - field_dict["$schema"] = schema - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.pagination import Pagination - from ..models.plan import Plan - - d = dict(src_dict) - pages = Pagination.from_dict(d.pop("pages")) - - plans = [] - _plans = d.pop("plans") - for plans_item_data in _plans: - plans_item = Plan.from_dict(plans_item_data) - - plans.append(plans_item) - - schema = d.pop("$schema", UNSET) - - list_account_plans_response = cls( - pages=pages, - plans=plans, - schema=schema, - ) - - return list_account_plans_response diff --git a/src/tower/tower_api_client/models/list_alerts_response.py b/src/tower/tower_api_client/models/list_alerts_response.py index 585f75ab..d08e0e19 100644 --- a/src/tower/tower_api_client/models/list_alerts_response.py +++ b/src/tower/tower_api_client/models/list_alerts_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ListAlertsResponse: """ Attributes: - alerts (list['Alert']): List of alerts + alerts (list[Alert]): List of alerts pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAlertsResponse.json. """ - alerts: list["Alert"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + alerts: list[Alert] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: alerts = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "alerts": alerts, diff --git a/src/tower/tower_api_client/models/list_api_keys_response.py b/src/tower/tower_api_client/models/list_api_keys_response.py index 33793d88..9ae9a7e6 100644 --- a/src/tower/tower_api_client/models/list_api_keys_response.py +++ b/src/tower/tower_api_client/models/list_api_keys_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ListAPIKeysResponse: """ Attributes: - api_keys (list['APIKey']): List of API keys + api_keys (list[APIKey]): List of API keys pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAPIKeysResponse.json. """ - api_keys: list["APIKey"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + api_keys: list[APIKey] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: api_keys = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "api_keys": api_keys, diff --git a/src/tower/tower_api_client/models/list_app_environments_response.py b/src/tower/tower_api_client/models/list_app_environments_response.py index e82672be..6eacb692 100644 --- a/src/tower/tower_api_client/models/list_app_environments_response.py +++ b/src/tower/tower_api_client/models/list_app_environments_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class ListAppEnvironmentsResponse: """ Attributes: environments (list[str]): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAppEnvironmentsResponse.json. """ environments: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environments = self.environments @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environments": environments, diff --git a/src/tower/tower_api_client/models/list_app_versions_response.py b/src/tower/tower_api_client/models/list_app_versions_response.py index db846de8..28013c23 100644 --- a/src/tower/tower_api_client/models/list_app_versions_response.py +++ b/src/tower/tower_api_client/models/list_app_versions_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class ListAppVersionsResponse: """ Attributes: - versions (list['AppVersion']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + versions (list[AppVersion]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAppVersionsResponse.json. """ - versions: list["AppVersion"] - schema: Union[Unset, str] = UNSET + versions: list[AppVersion] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: versions = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "versions": versions, diff --git a/src/tower/tower_api_client/models/list_apps_filter.py b/src/tower/tower_api_client/models/list_apps_filter.py index 0caee18d..491a047f 100644 --- a/src/tower/tower_api_client/models/list_apps_filter.py +++ b/src/tower/tower_api_client/models/list_apps_filter.py @@ -5,6 +5,7 @@ class ListAppsFilter(str, Enum): DISABLED = "disabled" HEALTHY = "healthy" RUNNING = "running" + SCHEDULED = "scheduled" WITHWARNING = "withWarning" def __str__(self) -> str: diff --git a/src/tower/tower_api_client/models/list_apps_response.py b/src/tower/tower_api_client/models/list_apps_response.py index cb4b1854..6804cec0 100644 --- a/src/tower/tower_api_client/models/list_apps_response.py +++ b/src/tower/tower_api_client/models/list_apps_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ListAppsResponse: """ Attributes: - apps (list['AppSummary']): + apps (list[AppSummary]): pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAppsResponse.json. """ - apps: list["AppSummary"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + apps: list[AppSummary] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: apps = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "apps": apps, diff --git a/src/tower/tower_api_client/models/list_authenticators_response.py b/src/tower/tower_api_client/models/list_authenticators_response.py index 167a01c0..ba5bcac4 100644 --- a/src/tower/tower_api_client/models/list_authenticators_response.py +++ b/src/tower/tower_api_client/models/list_authenticators_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class ListAuthenticatorsResponse: """ Attributes: - authenticators (list['VerifiedAuthenticator']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + authenticators (list[VerifiedAuthenticator]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListAuthenticatorsResponse.json. """ - authenticators: list["VerifiedAuthenticator"] - schema: Union[Unset, str] = UNSET + authenticators: list[VerifiedAuthenticator] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: authenticators = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "authenticators": authenticators, diff --git a/src/tower/tower_api_client/models/list_catalogs_response.py b/src/tower/tower_api_client/models/list_catalogs_response.py index 3f235ae9..53e12797 100644 --- a/src/tower/tower_api_client/models/list_catalogs_response.py +++ b/src/tower/tower_api_client/models/list_catalogs_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ListCatalogsResponse: """ Attributes: - catalogs (list['Catalog']): + catalogs (list[Catalog]): pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListCatalogsResponse.json. """ - catalogs: list["Catalog"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + catalogs: list[Catalog] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalogs = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "catalogs": catalogs, diff --git a/src/tower/tower_api_client/models/list_environments_response.py b/src/tower/tower_api_client/models/list_environments_response.py index dd9c7922..0078a00f 100644 --- a/src/tower/tower_api_client/models/list_environments_response.py +++ b/src/tower/tower_api_client/models/list_environments_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,15 +19,15 @@ class ListEnvironmentsResponse: """ Attributes: - environments (list['Environment']): + environments (list[Environment]): pages (Pagination): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListEnvironmentsResponse.json. """ - environments: list["Environment"] - pages: "Pagination" - schema: Union[Unset, str] = UNSET + environments: list[Environment] + pages: Pagination + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environments = [] @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environments": environments, diff --git a/src/tower/tower_api_client/models/list_my_team_invitations_response.py b/src/tower/tower_api_client/models/list_my_team_invitations_response.py index f2f44563..3723ec83 100644 --- a/src/tower/tower_api_client/models/list_my_team_invitations_response.py +++ b/src/tower/tower_api_client/models/list_my_team_invitations_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class ListMyTeamInvitationsResponse: """ Attributes: - team_invitations (list['TeamInvitation']): All of team invitations - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + team_invitations (list[TeamInvitation]): All of team invitations + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListMyTeamInvitationsResponse.json. """ - team_invitations: list["TeamInvitation"] - schema: Union[Unset, str] = UNSET + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_invitations = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_invitations": team_invitations, diff --git a/src/tower/tower_api_client/models/list_runners_response.py b/src/tower/tower_api_client/models/list_runners_response.py index 6ad1da7b..dfb1be95 100644 --- a/src/tower/tower_api_client/models/list_runners_response.py +++ b/src/tower/tower_api_client/models/list_runners_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ListRunnersResponse: """ Attributes: pages (Pagination): - runners (list['Runner']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + runners (list[Runner]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListRunnersResponse.json. """ - pages: "Pagination" - runners: list["Runner"] - schema: Union[Unset, str] = UNSET + pages: Pagination + runners: list[Runner] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/list_runs_response.py b/src/tower/tower_api_client/models/list_runs_response.py index b2ab237f..a58100a0 100644 --- a/src/tower/tower_api_client/models/list_runs_response.py +++ b/src/tower/tower_api_client/models/list_runs_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ListRunsResponse: """ Attributes: pages (Pagination): - runs (list['Run']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListRunsResponse.json. """ - pages: "Pagination" - runs: list["Run"] - schema: Union[Unset, str] = UNSET + pages: Pagination + runs: list[Run] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/list_schedules_response.py b/src/tower/tower_api_client/models/list_schedules_response.py index 93d717f5..766adbae 100644 --- a/src/tower/tower_api_client/models/list_schedules_response.py +++ b/src/tower/tower_api_client/models/list_schedules_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ListSchedulesResponse: """ Attributes: pages (Pagination): - schedules (list['Schedule']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schedules (list[Schedule]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListSchedulesResponse.json. """ - pages: "Pagination" - schedules: list["Schedule"] - schema: Union[Unset, str] = UNSET + pages: Pagination + schedules: list[Schedule] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/list_secret_environments_response.py b/src/tower/tower_api_client/models/list_secret_environments_response.py index a287f476..0b44f822 100644 --- a/src/tower/tower_api_client/models/list_secret_environments_response.py +++ b/src/tower/tower_api_client/models/list_secret_environments_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class ListSecretEnvironmentsResponse: """ Attributes: environments (list[str]): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListSecretEnvironmentsResponse.json. """ environments: list[str] - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environments = self.environments @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environments": environments, diff --git a/src/tower/tower_api_client/models/list_secrets_response.py b/src/tower/tower_api_client/models/list_secrets_response.py index 230dafa2..04fac0e7 100644 --- a/src/tower/tower_api_client/models/list_secrets_response.py +++ b/src/tower/tower_api_client/models/list_secrets_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ListSecretsResponse: """ Attributes: pages (Pagination): - secrets (list['Secret']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + secrets (list[Secret]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListSecretsResponse.json. """ - pages: "Pagination" - secrets: list["Secret"] - schema: Union[Unset, str] = UNSET + pages: Pagination + secrets: list[Secret] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/list_team_invitations_response.py b/src/tower/tower_api_client/models/list_team_invitations_response.py index f23d4cbc..52846ca3 100644 --- a/src/tower/tower_api_client/models/list_team_invitations_response.py +++ b/src/tower/tower_api_client/models/list_team_invitations_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,13 +18,13 @@ class ListTeamInvitationsResponse: """ Attributes: - team_invitations (list['TeamInvitation']): All of team invitations - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + team_invitations (list[TeamInvitation]): All of team invitations + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListTeamInvitationsResponse.json. """ - team_invitations: list["TeamInvitation"] - schema: Union[Unset, str] = UNSET + team_invitations: list[TeamInvitation] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_invitations = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_invitations": team_invitations, diff --git a/src/tower/tower_api_client/models/list_team_members_response.py b/src/tower/tower_api_client/models/list_team_members_response.py index 3f751382..7c5921be 100644 --- a/src/tower/tower_api_client/models/list_team_members_response.py +++ b/src/tower/tower_api_client/models/list_team_members_response.py @@ -1,12 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.user import User + from ..models.team_membership import TeamMembership T = TypeVar("T", bound="ListTeamMembersResponse") @@ -16,13 +18,13 @@ class ListTeamMembersResponse: """ Attributes: - team_members (list['User']): All of the members of a team - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + team_members (list[TeamMembership]): All of the members of a team + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListTeamMembersResponse.json. """ - team_members: list["User"] - schema: Union[Unset, str] = UNSET + team_members: list[TeamMembership] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_members = [] @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_members": team_members, @@ -45,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user import User + from ..models.team_membership import TeamMembership d = dict(src_dict) team_members = [] _team_members = d.pop("team_members") for team_members_item_data in _team_members: - team_members_item = User.from_dict(team_members_item_data) + team_members_item = TeamMembership.from_dict(team_members_item_data) team_members.append(team_members_item) diff --git a/src/tower/tower_api_client/models/list_teams_response.py b/src/tower/tower_api_client/models/list_teams_response.py index 26893d49..bff5edee 100644 --- a/src/tower/tower_api_client/models/list_teams_response.py +++ b/src/tower/tower_api_client/models/list_teams_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class ListTeamsResponse: """ Attributes: pages (Pagination): - teams (list['Team']): List of teams - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + teams (list[Team]): List of teams + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ListTeamsResponse.json. """ - pages: "Pagination" - teams: list["Team"] - schema: Union[Unset, str] = UNSET + pages: Pagination + teams: list[Team] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/list_webhooks_response.py b/src/tower/tower_api_client/models/list_webhooks_response.py new file mode 100644 index 00000000..b10e5c4e --- /dev/null +++ b/src/tower/tower_api_client/models/list_webhooks_response.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.pagination import Pagination + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="ListWebhooksResponse") + + +@_attrs_define +class ListWebhooksResponse: + """ + Attributes: + pages (Pagination): + webhooks (list[Webhook]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/ListWebhooksResponse.json. + """ + + pages: Pagination + webhooks: list[Webhook] + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + pages = self.pages.to_dict() + + webhooks = [] + for webhooks_item_data in self.webhooks: + webhooks_item = webhooks_item_data.to_dict() + webhooks.append(webhooks_item) + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "pages": pages, + "webhooks": webhooks, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.pagination import Pagination + from ..models.webhook import Webhook + + d = dict(src_dict) + pages = Pagination.from_dict(d.pop("pages")) + + webhooks = [] + _webhooks = d.pop("webhooks") + for webhooks_item_data in _webhooks: + webhooks_item = Webhook.from_dict(webhooks_item_data) + + webhooks.append(webhooks_item) + + schema = d.pop("$schema", UNSET) + + list_webhooks_response = cls( + pages=pages, + webhooks=webhooks, + schema=schema, + ) + + return list_webhooks_response diff --git a/src/tower/tower_api_client/models/organization.py b/src/tower/tower_api_client/models/organization.py new file mode 100644 index 00000000..8fe5c4a3 --- /dev/null +++ b/src/tower/tower_api_client/models/organization.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.user import User + + +T = TypeVar("T", bound="Organization") + + +@_attrs_define +class Organization: + """ + Attributes: + name (str): The name of the organization + owner (User): + """ + + name: str + owner: User + + def to_dict(self) -> dict[str, Any]: + name = self.name + + owner = self.owner.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "owner": owner, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user import User + + d = dict(src_dict) + name = d.pop("name") + + owner = User.from_dict(d.pop("owner")) + + organization = cls( + name=name, + owner=owner, + ) + + return organization diff --git a/src/tower/tower_api_client/models/pagination.py b/src/tower/tower_api_client/models/pagination.py index 257a6b63..70bef512 100644 --- a/src/tower/tower_api_client/models/pagination.py +++ b/src/tower/tower_api_client/models/pagination.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -31,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: total = self.total field_dict: dict[str, Any] = {} + field_dict.update( { "num_pages": num_pages, diff --git a/src/tower/tower_api_client/models/parameter.py b/src/tower/tower_api_client/models/parameter.py index 919f5daf..fb161761 100644 --- a/src/tower/tower_api_client/models/parameter.py +++ b/src/tower/tower_api_client/models/parameter.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -27,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} + field_dict.update( { "default": default, diff --git a/src/tower/tower_api_client/models/plan.py b/src/tower/tower_api_client/models/plan.py index f17575f7..83476e8c 100644 --- a/src/tower/tower_api_client/models/plan.py +++ b/src/tower/tower_api_client/models/plan.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -8,7 +10,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.features import Features + from ..models.feature import Feature T = TypeVar("T", bound="Plan") @@ -18,60 +20,57 @@ class Plan: """ Attributes: - account_id (str): base_plan_name (str): created_at (datetime.datetime): - features (Features): + features (list[Feature]): id (str): start_at (datetime.datetime): - status (str): - end_at (Union[Unset, datetime.datetime]): - extras (Union[Unset, Features]): + end_at (datetime.datetime | Unset): + extras (list[Feature] | Unset): """ - account_id: str base_plan_name: str created_at: datetime.datetime - features: "Features" + features: list[Feature] id: str start_at: datetime.datetime - status: str - end_at: Union[Unset, datetime.datetime] = UNSET - extras: Union[Unset, "Features"] = UNSET + end_at: datetime.datetime | Unset = UNSET + extras: list[Feature] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - account_id = self.account_id - base_plan_name = self.base_plan_name created_at = self.created_at.isoformat() - features = self.features.to_dict() + features = [] + for features_item_data in self.features: + features_item = features_item_data.to_dict() + features.append(features_item) id = self.id start_at = self.start_at.isoformat() - status = self.status - - end_at: Union[Unset, str] = UNSET + end_at: str | Unset = UNSET if not isinstance(self.end_at, Unset): end_at = self.end_at.isoformat() - extras: Union[Unset, dict[str, Any]] = UNSET + extras: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.extras, Unset): - extras = self.extras.to_dict() + extras = [] + for extras_item_data in self.extras: + extras_item = extras_item_data.to_dict() + extras.append(extras_item) field_dict: dict[str, Any] = {} + field_dict.update( { - "account_id": account_id, "base_plan_name": base_plan_name, "created_at": created_at, "features": features, "id": id, "start_at": start_at, - "status": status, } ) if end_at is not UNSET: @@ -83,45 +82,46 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.features import Features + from ..models.feature import Feature d = dict(src_dict) - account_id = d.pop("account_id") - base_plan_name = d.pop("base_plan_name") created_at = isoparse(d.pop("created_at")) - features = Features.from_dict(d.pop("features")) + features = [] + _features = d.pop("features") + for features_item_data in _features: + features_item = Feature.from_dict(features_item_data) + + features.append(features_item) id = d.pop("id") start_at = isoparse(d.pop("start_at")) - status = d.pop("status") - _end_at = d.pop("end_at", UNSET) - end_at: Union[Unset, datetime.datetime] + end_at: datetime.datetime | Unset if isinstance(_end_at, Unset): end_at = UNSET else: end_at = isoparse(_end_at) _extras = d.pop("extras", UNSET) - extras: Union[Unset, Features] - if isinstance(_extras, Unset): - extras = UNSET - else: - extras = Features.from_dict(_extras) + extras: list[Feature] | Unset = UNSET + if _extras is not UNSET: + extras = [] + for extras_item_data in _extras: + extras_item = Feature.from_dict(extras_item_data) + + extras.append(extras_item) plan = cls( - account_id=account_id, base_plan_name=base_plan_name, created_at=created_at, features=features, id=id, start_at=start_at, - status=status, end_at=end_at, extras=extras, ) diff --git a/src/tower/tower_api_client/models/refresh_session_params.py b/src/tower/tower_api_client/models/refresh_session_params.py index d7a98391..bbf86d5f 100644 --- a/src/tower/tower_api_client/models/refresh_session_params.py +++ b/src/tower/tower_api_client/models/refresh_session_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,19 +14,26 @@ class RefreshSessionParams: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RefreshSessionParams.json. + refresh_token (str | Unset): The refresh token associated with the session to refresh. """ - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET + refresh_token: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema + refresh_token = self.refresh_token + field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema + if refresh_token is not UNSET: + field_dict["refresh_token"] = refresh_token return field_dict @@ -33,8 +42,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schema = d.pop("$schema", UNSET) + refresh_token = d.pop("refresh_token", UNSET) + refresh_session_params = cls( schema=schema, + refresh_token=refresh_token, ) return refresh_session_params diff --git a/src/tower/tower_api_client/models/refresh_session_response.py b/src/tower/tower_api_client/models/refresh_session_response.py index c02f83e6..f694faa8 100644 --- a/src/tower/tower_api_client/models/refresh_session_response.py +++ b/src/tower/tower_api_client/models/refresh_session_response.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -20,13 +22,13 @@ class RefreshSessionResponse: Attributes: refreshed_at (datetime.datetime): A timestamp that indicates the last time the session data was refreshed. session (Session): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RefreshSessionResponse.json. """ refreshed_at: datetime.datetime - session: "Session" - schema: Union[Unset, str] = UNSET + session: Session + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: refreshed_at = self.refreshed_at.isoformat() @@ -36,6 +38,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "refreshed_at": refreshed_at, diff --git a/src/tower/tower_api_client/models/remove_team_member_params.py b/src/tower/tower_api_client/models/remove_team_member_params.py index 1084b7b7..4f2cebfc 100644 --- a/src/tower/tower_api_client/models/remove_team_member_params.py +++ b/src/tower/tower_api_client/models/remove_team_member_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class RemoveTeamMemberParams: """ Attributes: email (str): The email address of the team member to remove - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RemoveTeamMemberParams.json. """ email: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, diff --git a/src/tower/tower_api_client/models/remove_team_member_response.py b/src/tower/tower_api_client/models/remove_team_member_response.py index 573b866c..bfc98bcd 100644 --- a/src/tower/tower_api_client/models/remove_team_member_response.py +++ b/src/tower/tower_api_client/models/remove_team_member_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class RemoveTeamMemberResponse: """ Attributes: team_member (User): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RemoveTeamMemberResponse.json. """ - team_member: "User" - schema: Union[Unset, str] = UNSET + team_member: User + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_member = self.team_member.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_member": team_member, diff --git a/src/tower/tower_api_client/models/resend_team_invitation_params.py b/src/tower/tower_api_client/models/resend_team_invitation_params.py index dde057fa..66142e9e 100644 --- a/src/tower/tower_api_client/models/resend_team_invitation_params.py +++ b/src/tower/tower_api_client/models/resend_team_invitation_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,14 +15,14 @@ class ResendTeamInvitationParams: """ Attributes: email (str): The email address of team invitation to resend - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ResendTeamInvitationParams.json. - message (Union[Unset, str]): Optional message to include in the invite email + message (str | Unset): Optional message to include in the invite email """ email: str - schema: Union[Unset, str] = UNSET - message: Union[Unset, str] = UNSET + schema: str | Unset = UNSET + message: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, diff --git a/src/tower/tower_api_client/models/resend_team_invitation_response.py b/src/tower/tower_api_client/models/resend_team_invitation_response.py index ecdd47c0..6821b60a 100644 --- a/src/tower/tower_api_client/models/resend_team_invitation_response.py +++ b/src/tower/tower_api_client/models/resend_team_invitation_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class ResendTeamInvitationResponse: """ Attributes: team_invitation (TeamInvitation): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/ResendTeamInvitationResponse.json. """ - team_invitation: "TeamInvitation" - schema: Union[Unset, str] = UNSET + team_invitation: TeamInvitation + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team_invitation = self.team_invitation.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team_invitation": team_invitation, diff --git a/src/tower/tower_api_client/models/run.py b/src/tower/tower_api_client/models/run.py index 45b2da2b..17fd56ae 100644 --- a/src/tower/tower_api_client/models/run.py +++ b/src/tower/tower_api_client/models/run.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -24,47 +26,47 @@ class Run: link (str): $link is deprecated. Individual responses include links. app_name (str): app_version (str): - cancelled_at (Union[None, datetime.datetime]): + cancelled_at (datetime.datetime | None): created_at (datetime.datetime): - ended_at (Union[None, datetime.datetime]): + ended_at (datetime.datetime | None): environment (str): - exit_code (Union[None, int]): Exit code of the run, if the run is completed. Null if there is no exit code + exit_code (int | None): Exit code of the run, if the run is completed. Null if there is no exit code initiator (RunInitiator): is_scheduled (bool): Whether this run was triggered by a schedule (true) or on-demand (false). Historical records default to false. number (int): - parameters (list['RunParameter']): Parameters used to invoke this run. + parameters (list[RunParameter]): Parameters used to invoke this run. run_id (str): scheduled_at (datetime.datetime): - started_at (Union[None, datetime.datetime]): + started_at (datetime.datetime | None): status (RunStatus): status_group (RunStatusGroup): - app_slug (Union[Unset, str]): This property is deprecated. Please use app_name instead. - hostname (Union[Unset, str]): hostname is deprecated, use subdomain - subdomain (Union[None, Unset, str]): If app is externally accessible, then you can access this run with this + app_slug (str | Unset): This property is deprecated. Use app_name instead. + hostname (str | Unset): hostname is deprecated, use subdomain + subdomain (None | str | Unset): If app is externally accessible, then you can access this run with this hostname. """ link: str app_name: str app_version: str - cancelled_at: Union[None, datetime.datetime] + cancelled_at: datetime.datetime | None created_at: datetime.datetime - ended_at: Union[None, datetime.datetime] + ended_at: datetime.datetime | None environment: str - exit_code: Union[None, int] - initiator: "RunInitiator" + exit_code: int | None + initiator: RunInitiator is_scheduled: bool number: int - parameters: list["RunParameter"] + parameters: list[RunParameter] run_id: str scheduled_at: datetime.datetime - started_at: Union[None, datetime.datetime] + started_at: datetime.datetime | None status: RunStatus status_group: RunStatusGroup - app_slug: Union[Unset, str] = UNSET - hostname: Union[Unset, str] = UNSET - subdomain: Union[None, Unset, str] = UNSET + app_slug: str | Unset = UNSET + hostname: str | Unset = UNSET + subdomain: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: link = self.link @@ -73,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: app_version = self.app_version - cancelled_at: Union[None, str] + cancelled_at: None | str if isinstance(self.cancelled_at, datetime.datetime): cancelled_at = self.cancelled_at.isoformat() else: @@ -81,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at.isoformat() - ended_at: Union[None, str] + ended_at: None | str if isinstance(self.ended_at, datetime.datetime): ended_at = self.ended_at.isoformat() else: @@ -89,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: environment = self.environment - exit_code: Union[None, int] + exit_code: int | None exit_code = self.exit_code initiator = self.initiator.to_dict() @@ -107,7 +109,7 @@ def to_dict(self) -> dict[str, Any]: scheduled_at = self.scheduled_at.isoformat() - started_at: Union[None, str] + started_at: None | str if isinstance(self.started_at, datetime.datetime): started_at = self.started_at.isoformat() else: @@ -121,13 +123,14 @@ def to_dict(self) -> dict[str, Any]: hostname = self.hostname - subdomain: Union[None, Unset, str] + subdomain: None | str | Unset if isinstance(self.subdomain, Unset): subdomain = UNSET else: subdomain = self.subdomain field_dict: dict[str, Any] = {} + field_dict.update( { "$link": link, @@ -170,7 +173,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: app_version = d.pop("app_version") - def _parse_cancelled_at(data: object) -> Union[None, datetime.datetime]: + def _parse_cancelled_at(data: object) -> datetime.datetime | None: if data is None: return data try: @@ -179,15 +182,15 @@ def _parse_cancelled_at(data: object) -> Union[None, datetime.datetime]: cancelled_at_type_0 = isoparse(data) return cancelled_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union[None, datetime.datetime], data) + return cast(datetime.datetime | None, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at")) created_at = isoparse(d.pop("created_at")) - def _parse_ended_at(data: object) -> Union[None, datetime.datetime]: + def _parse_ended_at(data: object) -> datetime.datetime | None: if data is None: return data try: @@ -196,18 +199,18 @@ def _parse_ended_at(data: object) -> Union[None, datetime.datetime]: ended_at_type_0 = isoparse(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union[None, datetime.datetime], data) + return cast(datetime.datetime | None, data) ended_at = _parse_ended_at(d.pop("ended_at")) environment = d.pop("environment") - def _parse_exit_code(data: object) -> Union[None, int]: + def _parse_exit_code(data: object) -> int | None: if data is None: return data - return cast(Union[None, int], data) + return cast(int | None, data) exit_code = _parse_exit_code(d.pop("exit_code")) @@ -228,7 +231,7 @@ def _parse_exit_code(data: object) -> Union[None, int]: scheduled_at = isoparse(d.pop("scheduled_at")) - def _parse_started_at(data: object) -> Union[None, datetime.datetime]: + def _parse_started_at(data: object) -> datetime.datetime | None: if data is None: return data try: @@ -237,9 +240,9 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: started_at_type_0 = isoparse(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union[None, datetime.datetime], data) + return cast(datetime.datetime | None, data) started_at = _parse_started_at(d.pop("started_at")) @@ -251,12 +254,12 @@ def _parse_started_at(data: object) -> Union[None, datetime.datetime]: hostname = d.pop("hostname", UNSET) - def _parse_subdomain(data: object) -> Union[None, Unset, str]: + def _parse_subdomain(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) diff --git a/src/tower/tower_api_client/models/run_app_initiator_data.py b/src/tower/tower_api_client/models/run_app_initiator_data.py index 88ec5051..36a382bd 100644 --- a/src/tower/tower_api_client/models/run_app_initiator_data.py +++ b/src/tower/tower_api_client/models/run_app_initiator_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,6 +23,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_.value field_dict: dict[str, Any] = {} + field_dict.update( { "type": type_, diff --git a/src/tower/tower_api_client/models/run_app_params.py b/src/tower/tower_api_client/models/run_app_params.py index 7f5bc203..21a6d82e 100644 --- a/src/tower/tower_api_client/models/run_app_params.py +++ b/src/tower/tower_api_client/models/run_app_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,18 +21,18 @@ class RunAppParams: Attributes: environment (str): The environment to run this app in. parameters (RunAppParamsParameters): The parameters to pass into this app. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RunAppParams.json. - initiator (Union[Unset, RunAppInitiatorData]): - parent_run_id (Union[None, Unset, str]): The ID of the run that invoked this run, if relevant. Should be null, - if none. + initiator (RunAppInitiatorData | Unset): + parent_run_id (None | str | Unset): The ID of the run that invoked this run, if relevant. Should be null, if + none. """ environment: str - parameters: "RunAppParamsParameters" - schema: Union[Unset, str] = UNSET - initiator: Union[Unset, "RunAppInitiatorData"] = UNSET - parent_run_id: Union[None, Unset, str] = UNSET + parameters: RunAppParamsParameters + schema: str | Unset = UNSET + initiator: RunAppInitiatorData | Unset = UNSET + parent_run_id: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment @@ -39,17 +41,18 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema - initiator: Union[Unset, dict[str, Any]] = UNSET + initiator: dict[str, Any] | Unset = UNSET if not isinstance(self.initiator, Unset): initiator = self.initiator.to_dict() - parent_run_id: Union[None, Unset, str] + parent_run_id: None | str | Unset if isinstance(self.parent_run_id, Unset): parent_run_id = UNSET else: parent_run_id = self.parent_run_id field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, @@ -78,18 +81,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) _initiator = d.pop("initiator", UNSET) - initiator: Union[Unset, RunAppInitiatorData] + initiator: RunAppInitiatorData | Unset if isinstance(_initiator, Unset): initiator = UNSET else: initiator = RunAppInitiatorData.from_dict(_initiator) - def _parse_parent_run_id(data: object) -> Union[None, Unset, str]: + def _parse_parent_run_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) parent_run_id = _parse_parent_run_id(d.pop("parent_run_id", UNSET)) diff --git a/src/tower/tower_api_client/models/run_app_params_parameters.py b/src/tower/tower_api_client/models/run_app_params_parameters.py index c6522b9a..fff7dd8f 100644 --- a/src/tower/tower_api_client/models/run_app_params_parameters.py +++ b/src/tower/tower_api_client/models/run_app_params_parameters.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/src/tower/tower_api_client/models/run_app_response.py b/src/tower/tower_api_client/models/run_app_response.py index 491a3a0b..ae1464b6 100644 --- a/src/tower/tower_api_client/models/run_app_response.py +++ b/src/tower/tower_api_client/models/run_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class RunAppResponse: """ Attributes: run (Run): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/RunAppResponse.json. """ - run: "Run" - schema: Union[Unset, str] = UNSET + run: Run + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: run = self.run.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "run": run, diff --git a/src/tower/tower_api_client/models/run_failure_alert.py b/src/tower/tower_api_client/models/run_failure_alert.py index 5038c55c..6a799b4b 100644 --- a/src/tower/tower_api_client/models/run_failure_alert.py +++ b/src/tower/tower_api_client/models/run_failure_alert.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -16,21 +18,27 @@ class RunFailureAlert: """ Attributes: app (App): + environment (str): Environment this run was in run (Run): """ - app: "App" - run: "Run" + app: App + environment: str + run: Run def to_dict(self) -> dict[str, Any]: app = self.app.to_dict() + environment = self.environment + run = self.run.to_dict() field_dict: dict[str, Any] = {} + field_dict.update( { "app": app, + "environment": environment, "run": run, } ) @@ -45,10 +53,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) app = App.from_dict(d.pop("app")) + environment = d.pop("environment") + run = Run.from_dict(d.pop("run")) run_failure_alert = cls( app=app, + environment=environment, run=run, ) diff --git a/src/tower/tower_api_client/models/run_graph_node.py b/src/tower/tower_api_client/models/run_graph_node.py index d70142c0..4c94b26a 100644 --- a/src/tower/tower_api_client/models/run_graph_node.py +++ b/src/tower/tower_api_client/models/run_graph_node.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,8 +20,8 @@ class RunGraphNode: parent_id (RunGraphRunID): """ - id: "RunGraphRunID" - parent_id: "RunGraphRunID" + id: RunGraphRunID + parent_id: RunGraphRunID def to_dict(self) -> dict[str, Any]: id = self.id.to_dict() @@ -27,6 +29,7 @@ def to_dict(self) -> dict[str, Any]: parent_id = self.parent_id.to_dict() field_dict: dict[str, Any] = {} + field_dict.update( { "id": id, diff --git a/src/tower/tower_api_client/models/run_graph_run_id.py b/src/tower/tower_api_client/models/run_graph_run_id.py index ceb06e25..d9c503a8 100644 --- a/src/tower/tower_api_client/models/run_graph_run_id.py +++ b/src/tower/tower_api_client/models/run_graph_run_id.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -23,6 +25,7 @@ def to_dict(self) -> dict[str, Any]: number = self.number field_dict: dict[str, Any] = {} + field_dict.update( { "app_name": app_name, diff --git a/src/tower/tower_api_client/models/run_initiator.py b/src/tower/tower_api_client/models/run_initiator.py index 90d49167..e0df03d9 100644 --- a/src/tower/tower_api_client/models/run_initiator.py +++ b/src/tower/tower_api_client/models/run_initiator.py @@ -1,8 +1,15 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define +if TYPE_CHECKING: + from ..models.run_run_initiator_details import RunRunInitiatorDetails + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + + T = TypeVar("T", bound="RunInitiator") @@ -10,18 +17,31 @@ class RunInitiator: """ Attributes: - type_ (Union[None, str]): The type of initiator for this run + details (RunRunInitiatorDetails | ScheduleRunInitiatorDetails): Additional information about the initiator of a + run. + type_ (None | str): The type of initiator for this run. Null if none or unknown. """ - type_: Union[None, str] + details: RunRunInitiatorDetails | ScheduleRunInitiatorDetails + type_: None | str def to_dict(self) -> dict[str, Any]: - type_: Union[None, str] + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + + details: dict[str, Any] + if isinstance(self.details, ScheduleRunInitiatorDetails): + details = self.details.to_dict() + else: + details = self.details.to_dict() + + type_: None | str type_ = self.type_ field_dict: dict[str, Any] = {} + field_dict.update( { + "details": details, "type": type_, } ) @@ -30,16 +50,39 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.run_run_initiator_details import RunRunInitiatorDetails + from ..models.schedule_run_initiator_details import ScheduleRunInitiatorDetails + d = dict(src_dict) - def _parse_type_(data: object) -> Union[None, str]: + def _parse_details( + data: object, + ) -> RunRunInitiatorDetails | ScheduleRunInitiatorDetails: + try: + if not isinstance(data, dict): + raise TypeError() + details_type_0 = ScheduleRunInitiatorDetails.from_dict(data) + + return details_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + details_type_1 = RunRunInitiatorDetails.from_dict(data) + + return details_type_1 + + details = _parse_details(d.pop("details")) + + def _parse_type_(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) type_ = _parse_type_(d.pop("type")) run_initiator = cls( + details=details, type_=type_, ) diff --git a/src/tower/tower_api_client/models/run_log_line.py b/src/tower/tower_api_client/models/run_log_line.py index dcd98ea2..7d6fcab6 100644 --- a/src/tower/tower_api_client/models/run_log_line.py +++ b/src/tower/tower_api_client/models/run_log_line.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -20,8 +22,8 @@ class RunLogLine: line_num (int): Line number. reported_at (datetime.datetime): Timestamp of the log line. run_id (str): The uuid of the Run. - message (Union[Unset, str]): This property is deprecated. Please use content instead. - timestamp (Union[Unset, datetime.datetime]): This property is deprecated. Please use reported_at instead. + message (str | Unset): This property is deprecated. Use content instead. + timestamp (datetime.datetime | Unset): This property is deprecated. Use reported_at instead. """ channel: RunLogLineChannel @@ -29,8 +31,8 @@ class RunLogLine: line_num: int reported_at: datetime.datetime run_id: str - message: Union[Unset, str] = UNSET - timestamp: Union[Unset, datetime.datetime] = UNSET + message: str | Unset = UNSET + timestamp: datetime.datetime | Unset = UNSET def to_dict(self) -> dict[str, Any]: channel = self.channel.value @@ -45,11 +47,12 @@ def to_dict(self) -> dict[str, Any]: message = self.message - timestamp: Union[Unset, str] = UNSET + timestamp: str | Unset = UNSET if not isinstance(self.timestamp, Unset): timestamp = self.timestamp.isoformat() field_dict: dict[str, Any] = {} + field_dict.update( { "channel": channel, @@ -82,7 +85,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: message = d.pop("message", UNSET) _timestamp = d.pop("timestamp", UNSET) - timestamp: Union[Unset, datetime.datetime] + timestamp: datetime.datetime | Unset if isinstance(_timestamp, Unset): timestamp = UNSET else: diff --git a/src/tower/tower_api_client/models/run_parameter.py b/src/tower/tower_api_client/models/run_parameter.py index c61bf925..5089c844 100644 --- a/src/tower/tower_api_client/models/run_parameter.py +++ b/src/tower/tower_api_client/models/run_parameter.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -23,6 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, diff --git a/src/tower/tower_api_client/models/run_results.py b/src/tower/tower_api_client/models/run_results.py index e45f9de1..c3d1e24c 100644 --- a/src/tower/tower_api_client/models/run_results.py +++ b/src/tower/tower_api_client/models/run_results.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -39,6 +41,7 @@ def to_dict(self) -> dict[str, Any]: running = self.running field_dict: dict[str, Any] = {} + field_dict.update( { "cancelled": cancelled, diff --git a/src/tower/tower_api_client/models/run_run_initiator_details.py b/src/tower/tower_api_client/models/run_run_initiator_details.py new file mode 100644 index 00000000..a111d53d --- /dev/null +++ b/src/tower/tower_api_client/models/run_run_initiator_details.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 ..types import UNSET, Unset + +T = TypeVar("T", bound="RunRunInitiatorDetails") + + +@_attrs_define +class RunRunInitiatorDetails: + """ + Attributes: + run_app_name (str | Unset): The name of the app that initiated this run, if type is 'tower_run' + run_number (int | Unset): The number of the run that initaited this run, if type is 'tower_run' + """ + + run_app_name: str | Unset = UNSET + run_number: int | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + run_app_name = self.run_app_name + + run_number = self.run_number + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if run_app_name is not UNSET: + field_dict["run_app_name"] = run_app_name + if run_number is not UNSET: + field_dict["run_number"] = run_number + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + run_app_name = d.pop("run_app_name", UNSET) + + run_number = d.pop("run_number", UNSET) + + run_run_initiator_details = cls( + run_app_name=run_app_name, + run_number=run_number, + ) + + return run_run_initiator_details diff --git a/src/tower/tower_api_client/models/run_statistics.py b/src/tower/tower_api_client/models/run_statistics.py index 02254b1a..92e20b21 100644 --- a/src/tower/tower_api_client/models/run_statistics.py +++ b/src/tower/tower_api_client/models/run_statistics.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -39,6 +41,7 @@ def to_dict(self) -> dict[str, Any]: total_runs = self.total_runs field_dict: dict[str, Any] = {} + field_dict.update( { "cancelled_runs": cancelled_runs, diff --git a/src/tower/tower_api_client/models/run_timeseries_point.py b/src/tower/tower_api_client/models/run_timeseries_point.py index 79f0632a..39d127b1 100644 --- a/src/tower/tower_api_client/models/run_timeseries_point.py +++ b/src/tower/tower_api_client/models/run_timeseries_point.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -49,6 +51,7 @@ def to_dict(self) -> dict[str, Any]: scheduled = self.scheduled field_dict: dict[str, Any] = {} + field_dict.update( { "cancelled": cancelled, diff --git a/src/tower/tower_api_client/models/runner.py b/src/tower/tower_api_client/models/runner.py index c90bffa7..00d718b3 100644 --- a/src/tower/tower_api_client/models/runner.py +++ b/src/tower/tower_api_client/models/runner.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,22 +18,22 @@ class Runner: """ Attributes: - active_runs (list['Run']): + active_runs (list[Run]): created_at (str): id (str): max_concurrent_apps (int): num_runs (int): status (str): - last_health_check_at (Union[Unset, str]): + last_health_check_at (str | Unset): """ - active_runs: list["Run"] + active_runs: list[Run] created_at: str id: str max_concurrent_apps: int num_runs: int status: str - last_health_check_at: Union[Unset, str] = UNSET + last_health_check_at: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: active_runs = [] @@ -52,6 +54,7 @@ def to_dict(self) -> dict[str, Any]: last_health_check_at = self.last_health_check_at field_dict: dict[str, Any] = {} + field_dict.update( { "active_runs": active_runs, diff --git a/src/tower/tower_api_client/models/runner_credentials.py b/src/tower/tower_api_client/models/runner_credentials.py index f99ae433..a04a5e82 100644 --- a/src/tower/tower_api_client/models/runner_credentials.py +++ b/src/tower/tower_api_client/models/runner_credentials.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -12,15 +14,15 @@ class RunnerCredentials: Attributes: certificate (str): The signed certificate used by the runner to authenticate itself to Tower. private_key (str): The private key used by the runner to authenticate itself to Tower. - root_ca (Union[None, str]): The PEM encoded root CA certificate that is used to verify the runner's certificate - when Tower is responsible for signing server certs. + root_ca (None | str): The PEM encoded root CA certificate that is used to verify the runner's certificate when + Tower is responsible for signing server certs. runner_service_url (str): The host of the runner service that this runner will connect to. This is typically the Tower service host. """ certificate: str private_key: str - root_ca: Union[None, str] + root_ca: None | str runner_service_url: str def to_dict(self) -> dict[str, Any]: @@ -28,12 +30,13 @@ def to_dict(self) -> dict[str, Any]: private_key = self.private_key - root_ca: Union[None, str] + root_ca: None | str root_ca = self.root_ca runner_service_url = self.runner_service_url field_dict: dict[str, Any] = {} + field_dict.update( { "certificate": certificate, @@ -52,10 +55,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: private_key = d.pop("private_key") - def _parse_root_ca(data: object) -> Union[None, str]: + def _parse_root_ca(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) root_ca = _parse_root_ca(d.pop("root_ca")) diff --git a/src/tower/tower_api_client/models/schedule.py b/src/tower/tower_api_client/models/schedule.py index c63d2928..ed44493a 100644 --- a/src/tower/tower_api_client/models/schedule.py +++ b/src/tower/tower_api_client/models/schedule.py @@ -1,10 +1,14 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse +from ..models.schedule_app_status import ScheduleAppStatus +from ..models.schedule_overlap_policy import ScheduleOverlapPolicy from ..models.schedule_status import ScheduleStatus from ..types import UNSET, Unset @@ -20,29 +24,37 @@ class Schedule: """ Attributes: app_name (str): The name of the app that will be executed + app_status (ScheduleAppStatus): The status of the app created_at (datetime.datetime): The timestamp when the schedule was created cron (str): The cron expression defining when the app should run environment (str): The environment to run the app in id (str): The unique identifier for the schedule + name (str): The name of this schedule + overlap_policy (ScheduleOverlapPolicy): The policy for handling overlapping runs status (ScheduleStatus): The status of the schedule updated_at (datetime.datetime): The timestamp when the schedule was last updated - app_version (Union[Unset, str]): The specific app version to run, or null for the default version - parameters (Union[Unset, list['RunParameter']]): The parameters to pass when running the app + app_version (str | Unset): The specific app version to run, or null for the default version + parameters (list[RunParameter] | Unset): The parameters to pass when running the app """ app_name: str + app_status: ScheduleAppStatus created_at: datetime.datetime cron: str environment: str id: str + name: str + overlap_policy: ScheduleOverlapPolicy status: ScheduleStatus updated_at: datetime.datetime - app_version: Union[Unset, str] = UNSET - parameters: Union[Unset, list["RunParameter"]] = UNSET + app_version: str | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET def to_dict(self) -> dict[str, Any]: app_name = self.app_name + app_status = self.app_status.value + created_at = self.created_at.isoformat() cron = self.cron @@ -51,13 +63,17 @@ def to_dict(self) -> dict[str, Any]: id = self.id + name = self.name + + overlap_policy = self.overlap_policy.value + status = self.status.value updated_at = self.updated_at.isoformat() app_version = self.app_version - parameters: Union[Unset, list[dict[str, Any]]] = UNSET + parameters: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: @@ -65,13 +81,17 @@ def to_dict(self) -> dict[str, Any]: parameters.append(parameters_item) field_dict: dict[str, Any] = {} + field_dict.update( { "app_name": app_name, + "app_status": app_status, "created_at": created_at, "cron": cron, "environment": environment, "id": id, + "name": name, + "overlap_policy": overlap_policy, "status": status, "updated_at": updated_at, } @@ -90,6 +110,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) app_name = d.pop("app_name") + app_status = ScheduleAppStatus(d.pop("app_status")) + created_at = isoparse(d.pop("created_at")) cron = d.pop("cron") @@ -98,25 +120,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id") + name = d.pop("name") + + overlap_policy = ScheduleOverlapPolicy(d.pop("overlap_policy")) + status = ScheduleStatus(d.pop("status")) updated_at = isoparse(d.pop("updated_at")) app_version = d.pop("app_version", UNSET) - parameters = [] _parameters = d.pop("parameters", UNSET) - for parameters_item_data in _parameters or []: - parameters_item = RunParameter.from_dict(parameters_item_data) + parameters: list[RunParameter] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameter.from_dict(parameters_item_data) - parameters.append(parameters_item) + parameters.append(parameters_item) schedule = cls( app_name=app_name, + app_status=app_status, created_at=created_at, cron=cron, environment=environment, id=id, + name=name, + overlap_policy=overlap_policy, status=status, updated_at=updated_at, app_version=app_version, diff --git a/src/tower/tower_api_client/models/schedule_app_status.py b/src/tower/tower_api_client/models/schedule_app_status.py new file mode 100644 index 00000000..cc79ba66 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_app_status.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleAppStatus(str, Enum): + ACTIVE = "active" + DISABLED = "disabled" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_overlap_policy.py b/src/tower/tower_api_client/models/schedule_overlap_policy.py new file mode 100644 index 00000000..2f4c0e12 --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class ScheduleOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/schedule_run_initiator_details.py b/src/tower/tower_api_client/models/schedule_run_initiator_details.py new file mode 100644 index 00000000..ccb85ded --- /dev/null +++ b/src/tower/tower_api_client/models/schedule_run_initiator_details.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScheduleRunInitiatorDetails") + + +@_attrs_define +class ScheduleRunInitiatorDetails: + """ + Attributes: + schedule_name (str | Unset): The name of the schedule that initiated this run, if type is 'tower_schedule' + """ + + schedule_name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schedule_name = self.schedule_name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schedule_name is not UNSET: + field_dict["schedule_name"] = schedule_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schedule_name = d.pop("schedule_name", UNSET) + + schedule_run_initiator_details = cls( + schedule_name=schedule_name, + ) + + return schedule_run_initiator_details diff --git a/src/tower/tower_api_client/models/search_runs_response.py b/src/tower/tower_api_client/models/search_runs_response.py index 7ee4755d..365ae75c 100644 --- a/src/tower/tower_api_client/models/search_runs_response.py +++ b/src/tower/tower_api_client/models/search_runs_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class SearchRunsResponse: """ Attributes: pages (Pagination): - runs (list['Run']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + runs (list[Run]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/SearchRunsResponse.json. """ - pages: "Pagination" - runs: list["Run"] - schema: Union[Unset, str] = UNSET + pages: Pagination + runs: list[Run] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: pages = self.pages.to_dict() @@ -38,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "pages": pages, diff --git a/src/tower/tower_api_client/models/secret.py b/src/tower/tower_api_client/models/secret.py index a5eacd50..acac2b20 100644 --- a/src/tower/tower_api_client/models/secret.py +++ b/src/tower/tower_api_client/models/secret.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: preview = self.preview field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, diff --git a/src/tower/tower_api_client/models/session.py b/src/tower/tower_api_client/models/session.py index 7dc85bde..a3c8bcaa 100644 --- a/src/tower/tower_api_client/models/session.py +++ b/src/tower/tower_api_client/models/session.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,15 +20,15 @@ class Session: """ Attributes: featurebase_identity (FeaturebaseIdentity): - teams (list['Team']): + teams (list[Team]): token (Token): user (User): """ - featurebase_identity: "FeaturebaseIdentity" - teams: list["Team"] - token: "Token" - user: "User" + featurebase_identity: FeaturebaseIdentity + teams: list[Team] + token: Token + user: User def to_dict(self) -> dict[str, Any]: featurebase_identity = self.featurebase_identity.to_dict() @@ -41,6 +43,7 @@ def to_dict(self) -> dict[str, Any]: user = self.user.to_dict() field_dict: dict[str, Any] = {} + field_dict.update( { "featurebase_identity": featurebase_identity, diff --git a/src/tower/tower_api_client/models/shoulder_tap.py b/src/tower/tower_api_client/models/shoulder_tap.py new file mode 100644 index 00000000..181e7ae4 --- /dev/null +++ b/src/tower/tower_api_client/models/shoulder_tap.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +T = TypeVar("T", bound="ShoulderTap") + + +@_attrs_define +class ShoulderTap: + """ + Attributes: + account_id (str): Account ID that owns the resource. + event_type (str): Event type in format resource.changed (e.g., apps.changed, runs.changed). + resource_id (str): Unique identifier of the resource. + resource_type (str): Type of resource (apps, runs, schedules, secrets, environments, catalogs). + timestamp (datetime.datetime): Timestamp when the event occurred. + """ + + account_id: str + event_type: str + resource_id: str + resource_type: str + timestamp: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + event_type = self.event_type + + resource_id = self.resource_id + + resource_type = self.resource_type + + timestamp = self.timestamp.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account_id": account_id, + "event_type": event_type, + "resource_id": resource_id, + "resource_type": resource_type, + "timestamp": timestamp, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("account_id") + + event_type = d.pop("event_type") + + resource_id = d.pop("resource_id") + + resource_type = d.pop("resource_type") + + timestamp = isoparse(d.pop("timestamp")) + + shoulder_tap = cls( + account_id=account_id, + event_type=event_type, + resource_id=resource_id, + resource_type=resource_type, + timestamp=timestamp, + ) + + return shoulder_tap diff --git a/src/tower/tower_api_client/models/sse_warning.py b/src/tower/tower_api_client/models/sse_warning.py index 8fee3757..6b6cfdcf 100644 --- a/src/tower/tower_api_client/models/sse_warning.py +++ b/src/tower/tower_api_client/models/sse_warning.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -25,6 +27,7 @@ def to_dict(self) -> dict[str, Any]: reported_at = self.reported_at.isoformat() field_dict: dict[str, Any] = {} + field_dict.update( { "content": content, diff --git a/src/tower/tower_api_client/models/statistics_settings.py b/src/tower/tower_api_client/models/statistics_settings.py index 7810a52e..2791d517 100644 --- a/src/tower/tower_api_client/models/statistics_settings.py +++ b/src/tower/tower_api_client/models/statistics_settings.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -39,6 +41,7 @@ def to_dict(self) -> dict[str, Any]: timezone = self.timezone field_dict: dict[str, Any] = {} + field_dict.update( { "end_at": end_at, diff --git a/src/tower/tower_api_client/models/stream_alerts_event_alert.py b/src/tower/tower_api_client/models/stream_alerts_event_alert.py index 2267a8e7..53a97347 100644 --- a/src/tower/tower_api_client/models/stream_alerts_event_alert.py +++ b/src/tower/tower_api_client/models/stream_alerts_event_alert.py @@ -1,10 +1,11 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import ( TYPE_CHECKING, Any, Literal, TypeVar, - Union, cast, ) @@ -26,14 +27,14 @@ class StreamAlertsEventAlert: Attributes: data (Alert): event (Literal['alert']): The event name. - id (Union[Unset, int]): The event ID. - retry (Union[Unset, int]): The retry time in milliseconds. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. """ - data: "Alert" + data: Alert event: Literal["alert"] - id: Union[Unset, int] = UNSET - retry: Union[Unset, int] = UNSET + id: int | Unset = UNSET + retry: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/tower/tower_api_client/models/stream_alerts_event_error.py b/src/tower/tower_api_client/models/stream_alerts_event_error.py index 8456720d..ffd5e1d1 100644 --- a/src/tower/tower_api_client/models/stream_alerts_event_error.py +++ b/src/tower/tower_api_client/models/stream_alerts_event_error.py @@ -1,10 +1,11 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import ( TYPE_CHECKING, Any, Literal, TypeVar, - Union, cast, ) @@ -26,14 +27,14 @@ class StreamAlertsEventError: Attributes: data (SSEWarning): event (Literal['error']): The event name. - id (Union[Unset, int]): The event ID. - retry (Union[Unset, int]): The retry time in milliseconds. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. """ - data: "SSEWarning" + data: SSEWarning event: Literal["error"] - id: Union[Unset, int] = UNSET - retry: Union[Unset, int] = UNSET + id: int | Unset = UNSET + retry: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_log.py b/src/tower/tower_api_client/models/stream_run_logs_event_log.py index 3d9c2c44..ec751a57 100644 --- a/src/tower/tower_api_client/models/stream_run_logs_event_log.py +++ b/src/tower/tower_api_client/models/stream_run_logs_event_log.py @@ -1,10 +1,11 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import ( TYPE_CHECKING, Any, Literal, TypeVar, - Union, cast, ) @@ -26,14 +27,14 @@ class StreamRunLogsEventLog: Attributes: data (RunLogLine): event (Literal['log']): The event name. - id (Union[Unset, int]): The event ID. - retry (Union[Unset, int]): The retry time in milliseconds. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. """ - data: "RunLogLine" + data: RunLogLine event: Literal["log"] - id: Union[Unset, int] = UNSET - retry: Union[Unset, int] = UNSET + id: int | Unset = UNSET + retry: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py index 3aabe9c9..4419d8ee 100644 --- a/src/tower/tower_api_client/models/stream_run_logs_event_warning.py +++ b/src/tower/tower_api_client/models/stream_run_logs_event_warning.py @@ -1,10 +1,11 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import ( TYPE_CHECKING, Any, Literal, TypeVar, - Union, cast, ) @@ -26,14 +27,14 @@ class StreamRunLogsEventWarning: Attributes: data (SSEWarning): event (Literal['warning']): The event name. - id (Union[Unset, int]): The event ID. - retry (Union[Unset, int]): The retry time in milliseconds. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. """ - data: "SSEWarning" + data: SSEWarning event: Literal["warning"] - id: Union[Unset, int] = UNSET - retry: Union[Unset, int] = UNSET + id: int | Unset = UNSET + retry: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py new file mode 100644 index 00000000..4f983426 --- /dev/null +++ b/src/tower/tower_api_client/models/stream_shouldertaps_event_shouldertap.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + 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.shoulder_tap import ShoulderTap + + +T = TypeVar("T", bound="StreamShouldertapsEventShouldertap") + + +@_attrs_define +class StreamShouldertapsEventShouldertap: + """ + Attributes: + data (ShoulderTap): + event (Literal['shouldertap']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: ShoulderTap + event: Literal["shouldertap"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.shoulder_tap import ShoulderTap + + d = dict(src_dict) + data = ShoulderTap.from_dict(d.pop("data")) + + event = cast(Literal["shouldertap"], d.pop("event")) + if event != "shouldertap": + raise ValueError(f"event must match const 'shouldertap', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_shouldertaps_event_shouldertap = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_shouldertaps_event_shouldertap.additional_properties = d + return stream_shouldertaps_event_shouldertap + + @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/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py b/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py new file mode 100644 index 00000000..b1fc8a4c --- /dev/null +++ b/src/tower/tower_api_client/models/stream_shouldertaps_event_warning.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import ( + TYPE_CHECKING, + Any, + Literal, + 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.sse_warning import SSEWarning + + +T = TypeVar("T", bound="StreamShouldertapsEventWarning") + + +@_attrs_define +class StreamShouldertapsEventWarning: + """ + Attributes: + data (SSEWarning): + event (Literal['warning']): The event name. + id (int | Unset): The event ID. + retry (int | Unset): The retry time in milliseconds. + """ + + data: SSEWarning + event: Literal["warning"] + id: int | Unset = UNSET + retry: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + event = self.event + + id = self.id + + retry = self.retry + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "event": event, + } + ) + if id is not UNSET: + field_dict["id"] = id + if retry is not UNSET: + field_dict["retry"] = retry + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.sse_warning import SSEWarning + + d = dict(src_dict) + data = SSEWarning.from_dict(d.pop("data")) + + event = cast(Literal["warning"], d.pop("event")) + if event != "warning": + raise ValueError(f"event must match const 'warning', got '{event}'") + + id = d.pop("id", UNSET) + + retry = d.pop("retry", UNSET) + + stream_shouldertaps_event_warning = cls( + data=data, + event=event, + id=id, + retry=retry, + ) + + stream_shouldertaps_event_warning.additional_properties = d + return stream_shouldertaps_event_warning + + @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/src/tower/tower_api_client/models/team.py b/src/tower/tower_api_client/models/team.py index 869598e9..7a834d75 100644 --- a/src/tower/tower_api_client/models/team.py +++ b/src/tower/tower_api_client/models/team.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -18,14 +20,14 @@ class Team: Attributes: name (str): type_ (str): The type of team, either 'personal' or 'team'. - slug (Union[Unset, str]): This property is deprecated. Please use name instead. - token (Union[Unset, Token]): + slug (str | Unset): This property is deprecated. Use name instead. + token (Token | Unset): """ name: str type_: str - slug: Union[Unset, str] = UNSET - token: Union[Unset, "Token"] = UNSET + slug: str | Unset = UNSET + token: Token | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -34,11 +36,12 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - token: Union[Unset, dict[str, Any]] = UNSET + token: dict[str, Any] | Unset = UNSET if not isinstance(self.token, Unset): token = self.token.to_dict() field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, @@ -64,7 +67,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) _token = d.pop("token", UNSET) - token: Union[Unset, Token] + token: Token | Unset if isinstance(_token, Unset): token = UNSET else: diff --git a/src/tower/tower_api_client/models/team_invitation.py b/src/tower/tower_api_client/models/team_invitation.py index 49a1c45f..f83c7203 100644 --- a/src/tower/tower_api_client/models/team_invitation.py +++ b/src/tower/tower_api_client/models/team_invitation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -5,6 +7,8 @@ from attrs import define as _attrs_define from dateutil.parser import isoparse +from ..types import UNSET, Unset + if TYPE_CHECKING: from ..models.team import Team @@ -19,11 +23,17 @@ class TeamInvitation: email (str): invitation_sent_at (datetime.datetime): team (Team): + target_organization_name (str | Unset): The name of the organization the user will move to if they accept this + invitation + will_change_organization (bool | Unset): Indicates if accepting this invitation will move the user to a + different organization """ email: str invitation_sent_at: datetime.datetime - team: "Team" + team: Team + target_organization_name: str | Unset = UNSET + will_change_organization: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email @@ -32,7 +42,12 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() + target_organization_name = self.target_organization_name + + will_change_organization = self.will_change_organization + field_dict: dict[str, Any] = {} + field_dict.update( { "email": email, @@ -40,6 +55,10 @@ def to_dict(self) -> dict[str, Any]: "team": team, } ) + if target_organization_name is not UNSET: + field_dict["target_organization_name"] = target_organization_name + if will_change_organization is not UNSET: + field_dict["will_change_organization"] = will_change_organization return field_dict @@ -54,10 +73,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team = Team.from_dict(d.pop("team")) + target_organization_name = d.pop("target_organization_name", UNSET) + + will_change_organization = d.pop("will_change_organization", UNSET) + team_invitation = cls( email=email, invitation_sent_at=invitation_sent_at, team=team, + target_organization_name=target_organization_name, + will_change_organization=will_change_organization, ) return team_invitation diff --git a/src/tower/tower_api_client/models/team_membership.py b/src/tower/tower_api_client/models/team_membership.py new file mode 100644 index 00000000..21a0df06 --- /dev/null +++ b/src/tower/tower_api_client/models/team_membership.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.team_membership_role import TeamMembershipRole + +if TYPE_CHECKING: + from ..models.team import Team + from ..models.user import User + + +T = TypeVar("T", bound="TeamMembership") + + +@_attrs_define +class TeamMembership: + """ + Attributes: + role (TeamMembershipRole): + team (Team): + user (User): + """ + + role: TeamMembershipRole + team: Team + user: User + + def to_dict(self) -> dict[str, Any]: + role = self.role.value + + team = self.team.to_dict() + + user = self.user.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "role": role, + "team": team, + "user": user, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team import Team + from ..models.user import User + + d = dict(src_dict) + role = TeamMembershipRole(d.pop("role")) + + team = Team.from_dict(d.pop("team")) + + user = User.from_dict(d.pop("user")) + + team_membership = cls( + role=role, + team=team, + user=user, + ) + + return team_membership diff --git a/src/tower/tower_api_client/models/team_membership_role.py b/src/tower/tower_api_client/models/team_membership_role.py new file mode 100644 index 00000000..64f85be0 --- /dev/null +++ b/src/tower/tower_api_client/models/team_membership_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class TeamMembershipRole(str, Enum): + ADMIN = "admin" + DEVELOPER = "developer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/test_webhook_response.py b/src/tower/tower_api_client/models/test_webhook_response.py new file mode 100644 index 00000000..fc269b07 --- /dev/null +++ b/src/tower/tower_api_client/models/test_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="TestWebhookResponse") + + +@_attrs_define +class TestWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/TestWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + test_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return test_webhook_response diff --git a/src/tower/tower_api_client/models/token.py b/src/tower/tower_api_client/models/token.py index 9ab4987f..598af35c 100644 --- a/src/tower/tower_api_client/models/token.py +++ b/src/tower/tower_api_client/models/token.py @@ -1,8 +1,12 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define +from ..types import UNSET, Unset + T = TypeVar("T", bound="Token") @@ -10,30 +14,50 @@ class Token: """ Attributes: + access_token (str): The access token to use when authenticating API requests with Tower. jwt (str): + refresh_token (str | Unset): The refresh token to use when refreshing an expired access token. For security + reasons, refresh tokens should only be transmitted over secure channels and never logged or stored in plaintext. + It will only be returned upon initial authentication or when explicitly refreshing the access token. """ + access_token: str jwt: str + refresh_token: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: + access_token = self.access_token + jwt = self.jwt + refresh_token = self.refresh_token + field_dict: dict[str, Any] = {} + field_dict.update( { + "access_token": access_token, "jwt": jwt, } ) + if refresh_token is not UNSET: + field_dict["refresh_token"] = refresh_token return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) + access_token = d.pop("access_token") + jwt = d.pop("jwt") + refresh_token = d.pop("refresh_token", UNSET) + token = cls( + access_token=access_token, jwt=jwt, + refresh_token=refresh_token, ) return token diff --git a/src/tower/tower_api_client/models/unverified_authenticator.py b/src/tower/tower_api_client/models/unverified_authenticator.py index ddba6568..6fd77faa 100644 --- a/src/tower/tower_api_client/models/unverified_authenticator.py +++ b/src/tower/tower_api_client/models/unverified_authenticator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -31,6 +33,7 @@ def to_dict(self) -> dict[str, Any]: url = self.url field_dict: dict[str, Any] = {} + field_dict.update( { "issuer": issuer, diff --git a/src/tower/tower_api_client/models/update_account_params.py b/src/tower/tower_api_client/models/update_account_params.py index 23fcac84..60fe36d1 100644 --- a/src/tower/tower_api_client/models/update_account_params.py +++ b/src/tower/tower_api_client/models/update_account_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,15 +14,15 @@ class UpdateAccountParams: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateAccountParams.json. - is_self_hosted_only (Union[Unset, bool]): Whether the account is for self-hosted use only - name (Union[Unset, str]): The new name for the account, if any + is_self_hosted_only (bool | Unset): Whether the account is for self-hosted use only + name (str | Unset): The new name for the account, if any """ - schema: Union[Unset, str] = UNSET - is_self_hosted_only: Union[Unset, bool] = UNSET - name: Union[Unset, str] = UNSET + schema: str | Unset = UNSET + is_self_hosted_only: bool | Unset = UNSET + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema diff --git a/src/tower/tower_api_client/models/update_account_response.py b/src/tower/tower_api_client/models/update_account_response.py index 7c7addf3..df301652 100644 --- a/src/tower/tower_api_client/models/update_account_response.py +++ b/src/tower/tower_api_client/models/update_account_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateAccountResponse: """ Attributes: account (Account): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateAccountResponse.json. """ - account: "Account" - schema: Union[Unset, str] = UNSET + account: Account + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: account = self.account.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "account": account, diff --git a/src/tower/tower_api_client/models/update_app_params.py b/src/tower/tower_api_client/models/update_app_params.py index 4e0c0ab7..98fbac83 100644 --- a/src/tower/tower_api_client/models/update_app_params.py +++ b/src/tower/tower_api_client/models/update_app_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -12,50 +14,69 @@ class UpdateAppParams: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateAppParams.json. - description (Union[None, Unset, str]): New description for the App - is_externally_accessible (Union[None, Unset, bool]): Indicates that web traffic should be routed to this app and - that its runs should get a hostname assigned to it. - status (Union[None, Unset, str]): New status for the App - subdomain (Union[None, Unset, str]): The subdomain this app is accessible under. Requires - is_externally_accessible to be true. + description (None | str | Unset): New description for the App + is_externally_accessible (bool | None | Unset): Indicates that web traffic should be routed to this app and that + its runs should get a hostname assigned to it. + pending_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in pending + state before being marked as failed. + running_timeout (int | None | Unset): The amount of time in seconds that runs of this app can stay in running + state before being marked as failed. + status (None | str | Unset): New status for the App + subdomain (None | str | Unset): The subdomain this app is accessible under. Requires is_externally_accessible to + be true. """ - schema: Union[Unset, str] = UNSET - description: Union[None, Unset, str] = UNSET - is_externally_accessible: Union[None, Unset, bool] = UNSET - status: Union[None, Unset, str] = UNSET - subdomain: Union[None, Unset, str] = UNSET + schema: str | Unset = UNSET + description: None | str | Unset = UNSET + is_externally_accessible: bool | None | Unset = UNSET + pending_timeout: int | None | Unset = UNSET + running_timeout: int | None | Unset = UNSET + status: None | str | Unset = UNSET + subdomain: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema - description: Union[None, Unset, str] + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_externally_accessible: Union[None, Unset, bool] + is_externally_accessible: bool | None | Unset if isinstance(self.is_externally_accessible, Unset): is_externally_accessible = UNSET else: is_externally_accessible = self.is_externally_accessible - status: Union[None, Unset, str] + pending_timeout: int | None | Unset + if isinstance(self.pending_timeout, Unset): + pending_timeout = UNSET + else: + pending_timeout = self.pending_timeout + + running_timeout: int | None | Unset + if isinstance(self.running_timeout, Unset): + running_timeout = UNSET + else: + running_timeout = self.running_timeout + + status: None | str | Unset if isinstance(self.status, Unset): status = UNSET else: status = self.status - subdomain: Union[None, Unset, str] + subdomain: None | str | Unset if isinstance(self.subdomain, Unset): subdomain = UNSET else: subdomain = self.subdomain field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema @@ -63,6 +84,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if is_externally_accessible is not UNSET: field_dict["is_externally_accessible"] = is_externally_accessible + if pending_timeout is not UNSET: + field_dict["pending_timeout"] = pending_timeout + if running_timeout is not UNSET: + field_dict["running_timeout"] = running_timeout if status is not UNSET: field_dict["status"] = status if subdomain is not UNSET: @@ -75,41 +100,59 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schema = d.pop("$schema", UNSET) - def _parse_description(data: object) -> Union[None, Unset, str]: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_externally_accessible(data: object) -> Union[None, Unset, bool]: + def _parse_is_externally_accessible(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(bool | None | Unset, data) is_externally_accessible = _parse_is_externally_accessible( d.pop("is_externally_accessible", UNSET) ) - def _parse_status(data: object) -> Union[None, Unset, str]: + def _parse_pending_timeout(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + pending_timeout = _parse_pending_timeout(d.pop("pending_timeout", UNSET)) + + def _parse_running_timeout(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + running_timeout = _parse_running_timeout(d.pop("running_timeout", UNSET)) + + def _parse_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_subdomain(data: object) -> Union[None, Unset, str]: + def _parse_subdomain(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) subdomain = _parse_subdomain(d.pop("subdomain", UNSET)) @@ -117,6 +160,8 @@ def _parse_subdomain(data: object) -> Union[None, Unset, str]: schema=schema, description=description, is_externally_accessible=is_externally_accessible, + pending_timeout=pending_timeout, + running_timeout=running_timeout, status=status, subdomain=subdomain, ) diff --git a/src/tower/tower_api_client/models/update_app_response.py b/src/tower/tower_api_client/models/update_app_response.py index 1ca4db2d..d5d9817d 100644 --- a/src/tower/tower_api_client/models/update_app_response.py +++ b/src/tower/tower_api_client/models/update_app_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -16,23 +18,31 @@ class UpdateAppResponse: """ Attributes: + App (App): app (App): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateAppResponse.json. """ - app: "App" - schema: Union[Unset, str] = UNSET + App: App + app: App + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.app import App + + App = self.App.to_dict() + app = self.app.to_dict() schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { - "App": app, + "App": App, + "app": app, } ) if schema is not UNSET: @@ -45,11 +55,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app import App d = dict(src_dict) - app = App.from_dict(d.pop("App")) + App = App.from_dict(d.pop("App")) + + app = App.from_dict(d.pop("app")) schema = d.pop("$schema", UNSET) update_app_response = cls( + App=App, app=app, schema=schema, ) diff --git a/src/tower/tower_api_client/models/update_catalog_params.py b/src/tower/tower_api_client/models/update_catalog_params.py index a313c0f7..673099c9 100644 --- a/src/tower/tower_api_client/models/update_catalog_params.py +++ b/src/tower/tower_api_client/models/update_catalog_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,14 +19,14 @@ class UpdateCatalogParams: """ Attributes: environment (str): New environment for the catalog - properties (list['EncryptedCatalogProperty']): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + properties (list[EncryptedCatalogProperty]): + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateCatalogParams.json. """ environment: str - properties: list["EncryptedCatalogProperty"] - schema: Union[Unset, str] = UNSET + properties: list[EncryptedCatalogProperty] + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment @@ -37,6 +39,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, diff --git a/src/tower/tower_api_client/models/update_catalog_response.py b/src/tower/tower_api_client/models/update_catalog_response.py index 25de02ca..6a8cd272 100644 --- a/src/tower/tower_api_client/models/update_catalog_response.py +++ b/src/tower/tower_api_client/models/update_catalog_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateCatalogResponse: """ Attributes: catalog (Catalog): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateCatalogResponse.json. """ - catalog: "Catalog" - schema: Union[Unset, str] = UNSET + catalog: Catalog + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalog = self.catalog.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "catalog": catalog, diff --git a/src/tower/tower_api_client/models/update_email_preferences_body.py b/src/tower/tower_api_client/models/update_email_preferences_body.py index a85f7c0f..0b810b28 100644 --- a/src/tower/tower_api_client/models/update_email_preferences_body.py +++ b/src/tower/tower_api_client/models/update_email_preferences_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateEmailPreferencesBody: """ Attributes: subscriptions (EmailSubscriptions): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateEmailPreferencesBody.json. """ - subscriptions: "EmailSubscriptions" - schema: Union[Unset, str] = UNSET + subscriptions: EmailSubscriptions + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: subscriptions = self.subscriptions.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "subscriptions": subscriptions, diff --git a/src/tower/tower_api_client/models/update_environment_params.py b/src/tower/tower_api_client/models/update_environment_params.py index 462fd892..bfab90bd 100644 --- a/src/tower/tower_api_client/models/update_environment_params.py +++ b/src/tower/tower_api_client/models/update_environment_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class UpdateEnvironmentParams: """ Attributes: new_name (str): The desired new name of the environment - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateEnvironmentParams.json. """ new_name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: new_name = self.new_name @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "new_name": new_name, diff --git a/src/tower/tower_api_client/models/update_environment_response.py b/src/tower/tower_api_client/models/update_environment_response.py index 3051af64..1fd5d864 100644 --- a/src/tower/tower_api_client/models/update_environment_response.py +++ b/src/tower/tower_api_client/models/update_environment_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateEnvironmentResponse: """ Attributes: environment (Environment): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateEnvironmentResponse.json. """ - environment: "Environment" - schema: Union[Unset, str] = UNSET + environment: Environment + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: environment = self.environment.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "environment": environment, diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_params.py b/src/tower/tower_api_client/models/update_my_team_invitation_params.py index 2ae654ae..88efaa64 100644 --- a/src/tower/tower_api_client/models/update_my_team_invitation_params.py +++ b/src/tower/tower_api_client/models/update_my_team_invitation_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -14,13 +16,13 @@ class UpdateMyTeamInvitationParams: Attributes: accepted (bool): Whether or not the invitation was accepted. If false, it's considered rejected. name (str): The name of the team invitation to update - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationParams.json. """ accepted: bool name: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: accepted = self.accepted @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "accepted": accepted, diff --git a/src/tower/tower_api_client/models/update_my_team_invitation_response.py b/src/tower/tower_api_client/models/update_my_team_invitation_response.py index 6a86a55d..ec74b580 100644 --- a/src/tower/tower_api_client/models/update_my_team_invitation_response.py +++ b/src/tower/tower_api_client/models/update_my_team_invitation_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -12,16 +14,17 @@ class UpdateMyTeamInvitationResponse: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateMyTeamInvitationResponse.json. """ - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema diff --git a/src/tower/tower_api_client/models/update_organization_params.py b/src/tower/tower_api_client/models/update_organization_params.py new file mode 100644 index 00000000..877b7b2a --- /dev/null +++ b/src/tower/tower_api_client/models/update_organization_params.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateOrganizationParams") + + +@_attrs_define +class UpdateOrganizationParams: + """ + Attributes: + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateOrganizationParams.json. + name (str | Unset): The name of the organization to update. This is optional, if you supply null it will not + update the organization name. + """ + + schema: str | Unset = UNSET + name: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + schema = self.schema + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if schema is not UNSET: + field_dict["$schema"] = schema + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + schema = d.pop("$schema", UNSET) + + name = d.pop("name", UNSET) + + update_organization_params = cls( + schema=schema, + name=name, + ) + + return update_organization_params diff --git a/src/tower/tower_api_client/models/update_organization_response.py b/src/tower/tower_api_client/models/update_organization_response.py new file mode 100644 index 00000000..06af12a5 --- /dev/null +++ b/src/tower/tower_api_client/models/update_organization_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.organization import Organization + + +T = TypeVar("T", bound="UpdateOrganizationResponse") + + +@_attrs_define +class UpdateOrganizationResponse: + """ + Attributes: + organization (Organization): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateOrganizationResponse.json. + """ + + organization: Organization + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + organization = self.organization.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "organization": organization, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.organization import Organization + + d = dict(src_dict) + organization = Organization.from_dict(d.pop("organization")) + + schema = d.pop("$schema", UNSET) + + update_organization_response = cls( + organization=organization, + schema=schema, + ) + + return update_organization_response diff --git a/src/tower/tower_api_client/models/update_password_reset_params.py b/src/tower/tower_api_client/models/update_password_reset_params.py index 7b55294a..a7dd2720 100644 --- a/src/tower/tower_api_client/models/update_password_reset_params.py +++ b/src/tower/tower_api_client/models/update_password_reset_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class UpdatePasswordResetParams: """ Attributes: password (str): The new password that you want to set for your account - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdatePasswordResetParams.json. """ password: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: password = self.password @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "password": password, diff --git a/src/tower/tower_api_client/models/update_password_reset_response.py b/src/tower/tower_api_client/models/update_password_reset_response.py index 62573168..3e18fc74 100644 --- a/src/tower/tower_api_client/models/update_password_reset_response.py +++ b/src/tower/tower_api_client/models/update_password_reset_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class UpdatePasswordResetResponse: """ Attributes: ok (bool): A boolean indicating the request was successfully processed. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdatePasswordResetResponse.json. """ ok: bool - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: ok = self.ok @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "ok": ok, diff --git a/src/tower/tower_api_client/models/update_plan_params.py b/src/tower/tower_api_client/models/update_plan_params.py index 5b9c2e5d..61e124aa 100644 --- a/src/tower/tower_api_client/models/update_plan_params.py +++ b/src/tower/tower_api_client/models/update_plan_params.py @@ -1,9 +1,9 @@ -import datetime +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -15,25 +15,20 @@ class UpdatePlanParams: """ Attributes: base_plan_name (str): The name of the base plan to use. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdatePlanParams.json. - end_at (Union[Unset, datetime.datetime]): Optional expiration date for the plan. """ base_plan_name: str - schema: Union[Unset, str] = UNSET - end_at: Union[Unset, datetime.datetime] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: base_plan_name = self.base_plan_name schema = self.schema - end_at: Union[Unset, str] = UNSET - if not isinstance(self.end_at, Unset): - end_at = self.end_at.isoformat() - field_dict: dict[str, Any] = {} + field_dict.update( { "base_plan_name": base_plan_name, @@ -41,8 +36,6 @@ def to_dict(self) -> dict[str, Any]: ) if schema is not UNSET: field_dict["$schema"] = schema - if end_at is not UNSET: - field_dict["end_at"] = end_at return field_dict @@ -53,17 +46,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: schema = d.pop("$schema", UNSET) - _end_at = d.pop("end_at", UNSET) - end_at: Union[Unset, datetime.datetime] - if isinstance(_end_at, Unset): - end_at = UNSET - else: - end_at = isoparse(_end_at) - update_plan_params = cls( base_plan_name=base_plan_name, schema=schema, - end_at=end_at, ) return update_plan_params diff --git a/src/tower/tower_api_client/models/update_plan_response.py b/src/tower/tower_api_client/models/update_plan_response.py index 2c55c359..196b5503 100644 --- a/src/tower/tower_api_client/models/update_plan_response.py +++ b/src/tower/tower_api_client/models/update_plan_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdatePlanResponse: """ Attributes: plan (Plan): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdatePlanResponse.json. """ - plan: "Plan" - schema: Union[Unset, str] = UNSET + plan: Plan + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: plan = self.plan.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "plan": plan, diff --git a/src/tower/tower_api_client/models/update_schedule_params.py b/src/tower/tower_api_client/models/update_schedule_params.py index 49462551..1d891105 100644 --- a/src/tower/tower_api_client/models/update_schedule_params.py +++ b/src/tower/tower_api_client/models/update_schedule_params.py @@ -1,8 +1,13 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.update_schedule_params_overlap_policy import ( + UpdateScheduleParamsOverlapPolicy, +) from ..models.update_schedule_params_status import UpdateScheduleParamsStatus from ..types import UNSET, Unset @@ -17,27 +22,34 @@ class UpdateScheduleParams: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + name (None | str): The name for this schedule. Must be unique per team. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateScheduleParams.json. - app_version (Union[None, Unset, str]): The specific app version to run (if omitted, will use the app's default + app_version (None | str | Unset): The specific app version to run (if omitted, will use the app's default version) - cron (Union[Unset, str]): The cron expression defining when the app should run - environment (Union[Unset, str]): The environment to run the app in - parameters (Union[Unset, list['RunParameter']]): Parameters to pass when running the app - status (Union[Unset, UpdateScheduleParamsStatus]): The status of the schedule + cron (str | Unset): The cron expression defining when the app should run + environment (str | Unset): The environment to run the app in Default: 'default'. + overlap_policy (UpdateScheduleParamsOverlapPolicy | Unset): The overlap policy for the schedule + parameters (list[RunParameter] | Unset): Parameters to pass when running the app + status (UpdateScheduleParamsStatus | Unset): The status of the schedule """ - schema: Union[Unset, str] = UNSET - app_version: Union[None, Unset, str] = UNSET - cron: Union[Unset, str] = UNSET - environment: Union[Unset, str] = UNSET - parameters: Union[Unset, list["RunParameter"]] = UNSET - status: Union[Unset, UpdateScheduleParamsStatus] = UNSET + name: None | str + schema: str | Unset = UNSET + app_version: None | str | Unset = UNSET + cron: str | Unset = UNSET + environment: str | Unset = "default" + overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset = UNSET + parameters: list[RunParameter] | Unset = UNSET + status: UpdateScheduleParamsStatus | Unset = UNSET def to_dict(self) -> dict[str, Any]: + name: None | str + name = self.name + schema = self.schema - app_version: Union[None, Unset, str] + app_version: None | str | Unset if isinstance(self.app_version, Unset): app_version = UNSET else: @@ -47,19 +59,28 @@ def to_dict(self) -> dict[str, Any]: environment = self.environment - parameters: Union[Unset, list[dict[str, Any]]] = UNSET + overlap_policy: str | Unset = UNSET + if not isinstance(self.overlap_policy, Unset): + overlap_policy = self.overlap_policy.value + + parameters: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: parameters_item = parameters_item_data.to_dict() parameters.append(parameters_item) - status: Union[Unset, str] = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.value field_dict: dict[str, Any] = {} - field_dict.update({}) + + field_dict.update( + { + "name": name, + } + ) if schema is not UNSET: field_dict["$schema"] = schema if app_version is not UNSET: @@ -68,6 +89,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["cron"] = cron if environment is not UNSET: field_dict["environment"] = environment + if overlap_policy is not UNSET: + field_dict["overlap_policy"] = overlap_policy if parameters is not UNSET: field_dict["parameters"] = parameters if status is not UNSET: @@ -80,14 +103,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.run_parameter import RunParameter d = dict(src_dict) + + def _parse_name(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + name = _parse_name(d.pop("name")) + schema = d.pop("$schema", UNSET) - def _parse_app_version(data: object) -> Union[None, Unset, str]: + def _parse_app_version(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) app_version = _parse_app_version(d.pop("app_version", UNSET)) @@ -95,25 +126,36 @@ def _parse_app_version(data: object) -> Union[None, Unset, str]: environment = d.pop("environment", UNSET) - parameters = [] + _overlap_policy = d.pop("overlap_policy", UNSET) + overlap_policy: UpdateScheduleParamsOverlapPolicy | Unset + if isinstance(_overlap_policy, Unset): + overlap_policy = UNSET + else: + overlap_policy = UpdateScheduleParamsOverlapPolicy(_overlap_policy) + _parameters = d.pop("parameters", UNSET) - for parameters_item_data in _parameters or []: - parameters_item = RunParameter.from_dict(parameters_item_data) + parameters: list[RunParameter] | Unset = UNSET + if _parameters is not UNSET: + parameters = [] + for parameters_item_data in _parameters: + parameters_item = RunParameter.from_dict(parameters_item_data) - parameters.append(parameters_item) + parameters.append(parameters_item) _status = d.pop("status", UNSET) - status: Union[Unset, UpdateScheduleParamsStatus] + status: UpdateScheduleParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = UpdateScheduleParamsStatus(_status) update_schedule_params = cls( + name=name, schema=schema, app_version=app_version, cron=cron, environment=environment, + overlap_policy=overlap_policy, parameters=parameters, status=status, ) diff --git a/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py b/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py new file mode 100644 index 00000000..ffa1779a --- /dev/null +++ b/src/tower/tower_api_client/models/update_schedule_params_overlap_policy.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateScheduleParamsOverlapPolicy(str, Enum): + ALLOW = "allow" + SKIP = "skip" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_schedule_response.py b/src/tower/tower_api_client/models/update_schedule_response.py index 94e8496a..d1a534b8 100644 --- a/src/tower/tower_api_client/models/update_schedule_response.py +++ b/src/tower/tower_api_client/models/update_schedule_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateScheduleResponse: """ Attributes: schedule (Schedule): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateScheduleResponse.json. """ - schedule: "Schedule" - schema: Union[Unset, str] = UNSET + schedule: Schedule + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "schedule": schedule, diff --git a/src/tower/tower_api_client/models/update_secret_params.py b/src/tower/tower_api_client/models/update_secret_params.py index 9fe02220..072e0f74 100644 --- a/src/tower/tower_api_client/models/update_secret_params.py +++ b/src/tower/tower_api_client/models/update_secret_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -15,14 +17,14 @@ class UpdateSecretParams: encrypted_value (str): environment (str): preview (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateSecretParams.json. """ encrypted_value: str environment: str preview: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: encrypted_value = self.encrypted_value @@ -34,6 +36,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "encrypted_value": encrypted_value, diff --git a/src/tower/tower_api_client/models/update_secret_response.py b/src/tower/tower_api_client/models/update_secret_response.py index 1784805f..6fa42112 100644 --- a/src/tower/tower_api_client/models/update_secret_response.py +++ b/src/tower/tower_api_client/models/update_secret_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateSecretResponse: """ Attributes: secret (Secret): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateSecretResponse.json. """ - secret: "Secret" - schema: Union[Unset, str] = UNSET + secret: Secret + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: secret = self.secret.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "secret": secret, diff --git a/src/tower/tower_api_client/models/update_team_member_params.py b/src/tower/tower_api_client/models/update_team_member_params.py new file mode 100644 index 00000000..626d50f1 --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_params.py @@ -0,0 +1,71 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_team_member_params_role import UpdateTeamMemberParamsRole +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateTeamMemberParams") + + +@_attrs_define +class UpdateTeamMemberParams: + """ + Attributes: + email (str): The email address of the team member to update + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamMemberParams.json. + role (UpdateTeamMemberParamsRole | Unset): The role to update the team member to + """ + + email: str + schema: str | Unset = UNSET + role: UpdateTeamMemberParamsRole | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + email = self.email + + schema = self.schema + + role: str | Unset = UNSET + if not isinstance(self.role, Unset): + role = self.role.value + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + if role is not UNSET: + field_dict["role"] = role + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + schema = d.pop("$schema", UNSET) + + _role = d.pop("role", UNSET) + role: UpdateTeamMemberParamsRole | Unset + if isinstance(_role, Unset): + role = UNSET + else: + role = UpdateTeamMemberParamsRole(_role) + + update_team_member_params = cls( + email=email, + schema=schema, + role=role, + ) + + return update_team_member_params diff --git a/src/tower/tower_api_client/models/update_team_member_params_role.py b/src/tower/tower_api_client/models/update_team_member_params_role.py new file mode 100644 index 00000000..f594165e --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_params_role.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class UpdateTeamMemberParamsRole(str, Enum): + ADMIN = "admin" + DEVELOPER = "developer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/models/update_team_member_response.py b/src/tower/tower_api_client/models/update_team_member_response.py new file mode 100644 index 00000000..f736a542 --- /dev/null +++ b/src/tower/tower_api_client/models/update_team_member_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.team_membership import TeamMembership + + +T = TypeVar("T", bound="UpdateTeamMemberResponse") + + +@_attrs_define +class UpdateTeamMemberResponse: + """ + Attributes: + team_member (TeamMembership): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateTeamMemberResponse.json. + """ + + team_member: TeamMembership + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + team_member = self.team_member.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "team_member": team_member, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.team_membership import TeamMembership + + d = dict(src_dict) + team_member = TeamMembership.from_dict(d.pop("team_member")) + + schema = d.pop("$schema", UNSET) + + update_team_member_response = cls( + team_member=team_member, + schema=schema, + ) + + return update_team_member_response diff --git a/src/tower/tower_api_client/models/update_team_params.py b/src/tower/tower_api_client/models/update_team_params.py index 52955553..310819f3 100644 --- a/src/tower/tower_api_client/models/update_team_params.py +++ b/src/tower/tower_api_client/models/update_team_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -12,22 +14,23 @@ class UpdateTeamParams: """ Attributes: - name (Union[None, str]): The name of the team to update. This is optional, if you supply null it will not update - the team name. - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + name (None | str): The name of the team to update. This is optional, if you supply null it will not update the + team name. + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateTeamParams.json. """ - name: Union[None, str] - schema: Union[Unset, str] = UNSET + name: None | str + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - name: Union[None, str] + name: None | str name = self.name schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "name": name, @@ -42,10 +45,10 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> Union[None, str]: + def _parse_name(data: object) -> None | str: if data is None: return data - return cast(Union[None, str], data) + return cast(None | str, data) name = _parse_name(d.pop("name")) diff --git a/src/tower/tower_api_client/models/update_team_response.py b/src/tower/tower_api_client/models/update_team_response.py index d461cbe5..fe2bc66b 100644 --- a/src/tower/tower_api_client/models/update_team_response.py +++ b/src/tower/tower_api_client/models/update_team_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateTeamResponse: """ Attributes: team (Team): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateTeamResponse.json. """ - team: "Team" - schema: Union[Unset, str] = UNSET + team: Team + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "team": team, diff --git a/src/tower/tower_api_client/models/update_user_params.py b/src/tower/tower_api_client/models/update_user_params.py index 26cff24b..79efdc87 100644 --- a/src/tower/tower_api_client/models/update_user_params.py +++ b/src/tower/tower_api_client/models/update_user_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define @@ -12,90 +14,98 @@ class UpdateUserParams: """ Attributes: - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateUserParams.json. - company (Union[None, Unset, str]): - country (Union[None, Unset, str]): - first_name (Union[None, Unset, str]): - is_alerts_enabled (Union[None, Unset, bool]): - is_subscribed_to_changelog (Union[None, Unset, bool]): If true, the user will receive changelog updates via - email. - is_subscribed_to_marketing_emails (Union[None, Unset, bool]): If true, the user will receive marketing emails - from Tower. - is_subscribed_to_newsletter (Union[None, Unset, bool]): If true, the user will receive the Tower newsletter. - last_name (Union[None, Unset, str]): - password (Union[None, Unset, str]): + company (None | str | Unset): + country (None | str | Unset): + first_name (None | str | Unset): + is_alerts_enabled (bool | None | Unset): + is_subscribed_to_changelog (bool | None | Unset): If true, the user will receive changelog updates via email. + is_subscribed_to_marketing_emails (bool | None | Unset): If true, the user will receive marketing emails from + Tower. + is_subscribed_to_newsletter (bool | None | Unset): If true, the user will receive the Tower newsletter. + last_name (None | str | Unset): + password (None | str | Unset): + promo_code (None | str | Unset): """ - schema: Union[Unset, str] = UNSET - company: Union[None, Unset, str] = UNSET - country: Union[None, Unset, str] = UNSET - first_name: Union[None, Unset, str] = UNSET - is_alerts_enabled: Union[None, Unset, bool] = UNSET - is_subscribed_to_changelog: Union[None, Unset, bool] = UNSET - is_subscribed_to_marketing_emails: Union[None, Unset, bool] = UNSET - is_subscribed_to_newsletter: Union[None, Unset, bool] = UNSET - last_name: Union[None, Unset, str] = UNSET - password: Union[None, Unset, str] = UNSET + schema: str | Unset = UNSET + company: None | str | Unset = UNSET + country: None | str | Unset = UNSET + first_name: None | str | Unset = UNSET + is_alerts_enabled: bool | None | Unset = UNSET + is_subscribed_to_changelog: bool | None | Unset = UNSET + is_subscribed_to_marketing_emails: bool | None | Unset = UNSET + is_subscribed_to_newsletter: bool | None | Unset = UNSET + last_name: None | str | Unset = UNSET + password: None | str | Unset = UNSET + promo_code: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: schema = self.schema - company: Union[None, Unset, str] + company: None | str | Unset if isinstance(self.company, Unset): company = UNSET else: company = self.company - country: Union[None, Unset, str] + country: None | str | Unset if isinstance(self.country, Unset): country = UNSET else: country = self.country - first_name: Union[None, Unset, str] + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - is_alerts_enabled: Union[None, Unset, bool] + is_alerts_enabled: bool | None | Unset if isinstance(self.is_alerts_enabled, Unset): is_alerts_enabled = UNSET else: is_alerts_enabled = self.is_alerts_enabled - is_subscribed_to_changelog: Union[None, Unset, bool] + is_subscribed_to_changelog: bool | None | Unset if isinstance(self.is_subscribed_to_changelog, Unset): is_subscribed_to_changelog = UNSET else: is_subscribed_to_changelog = self.is_subscribed_to_changelog - is_subscribed_to_marketing_emails: Union[None, Unset, bool] + is_subscribed_to_marketing_emails: bool | None | Unset if isinstance(self.is_subscribed_to_marketing_emails, Unset): is_subscribed_to_marketing_emails = UNSET else: is_subscribed_to_marketing_emails = self.is_subscribed_to_marketing_emails - is_subscribed_to_newsletter: Union[None, Unset, bool] + is_subscribed_to_newsletter: bool | None | Unset if isinstance(self.is_subscribed_to_newsletter, Unset): is_subscribed_to_newsletter = UNSET else: is_subscribed_to_newsletter = self.is_subscribed_to_newsletter - last_name: Union[None, Unset, str] + last_name: None | str | Unset if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - password: Union[None, Unset, str] + password: None | str | Unset if isinstance(self.password, Unset): password = UNSET else: password = self.password + promo_code: None | str | Unset + if isinstance(self.promo_code, Unset): + promo_code = UNSET + else: + promo_code = self.promo_code + field_dict: dict[str, Any] = {} + field_dict.update({}) if schema is not UNSET: field_dict["$schema"] = schema @@ -119,6 +129,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["last_name"] = last_name if password is not UNSET: field_dict["password"] = password + if promo_code is not UNSET: + field_dict["promo_code"] = promo_code return field_dict @@ -127,48 +139,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) schema = d.pop("$schema", UNSET) - def _parse_company(data: object) -> Union[None, Unset, str]: + def _parse_company(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) company = _parse_company(d.pop("company", UNSET)) - def _parse_country(data: object) -> Union[None, Unset, str]: + def _parse_country(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) country = _parse_country(d.pop("country", UNSET)) - def _parse_first_name(data: object) -> Union[None, Unset, str]: + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_is_alerts_enabled(data: object) -> Union[None, Unset, bool]: + def _parse_is_alerts_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(bool | None | Unset, data) is_alerts_enabled = _parse_is_alerts_enabled(d.pop("is_alerts_enabled", UNSET)) - def _parse_is_subscribed_to_changelog(data: object) -> Union[None, Unset, bool]: + def _parse_is_subscribed_to_changelog(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(bool | None | Unset, data) is_subscribed_to_changelog = _parse_is_subscribed_to_changelog( d.pop("is_subscribed_to_changelog", UNSET) @@ -176,48 +188,55 @@ def _parse_is_subscribed_to_changelog(data: object) -> Union[None, Unset, bool]: def _parse_is_subscribed_to_marketing_emails( data: object, - ) -> Union[None, Unset, bool]: + ) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(bool | None | Unset, data) is_subscribed_to_marketing_emails = _parse_is_subscribed_to_marketing_emails( d.pop("is_subscribed_to_marketing_emails", UNSET) ) - def _parse_is_subscribed_to_newsletter( - data: object, - ) -> Union[None, Unset, bool]: + def _parse_is_subscribed_to_newsletter(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, bool], data) + return cast(bool | None | Unset, data) is_subscribed_to_newsletter = _parse_is_subscribed_to_newsletter( d.pop("is_subscribed_to_newsletter", UNSET) ) - def _parse_last_name(data: object) -> Union[None, Unset, str]: + def _parse_last_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_password(data: object) -> Union[None, Unset, str]: + def _parse_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(Union[None, Unset, str], data) + return cast(None | str | Unset, data) password = _parse_password(d.pop("password", UNSET)) + def _parse_promo_code(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + promo_code = _parse_promo_code(d.pop("promo_code", UNSET)) + update_user_params = cls( schema=schema, company=company, @@ -229,6 +248,7 @@ def _parse_password(data: object) -> Union[None, Unset, str]: is_subscribed_to_newsletter=is_subscribed_to_newsletter, last_name=last_name, password=password, + promo_code=promo_code, ) return update_user_params diff --git a/src/tower/tower_api_client/models/update_user_response.py b/src/tower/tower_api_client/models/update_user_response.py index 81125405..38069893 100644 --- a/src/tower/tower_api_client/models/update_user_response.py +++ b/src/tower/tower_api_client/models/update_user_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class UpdateUserResponse: """ Attributes: user (User): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/UpdateUserResponse.json. """ - user: "User" - schema: Union[Unset, str] = UNSET + user: User + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: user = self.user.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "user": user, diff --git a/src/tower/tower_api_client/models/update_webhook_params.py b/src/tower/tower_api_client/models/update_webhook_params.py new file mode 100644 index 00000000..f286e619 --- /dev/null +++ b/src/tower/tower_api_client/models/update_webhook_params.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateWebhookParams") + + +@_attrs_define +class UpdateWebhookParams: + """ + Attributes: + name (str): The new name of the webhook. + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateWebhookParams.json. + """ + + name: str + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + schema = d.pop("$schema", UNSET) + + update_webhook_params = cls( + name=name, + schema=schema, + ) + + return update_webhook_params diff --git a/src/tower/tower_api_client/models/update_webhook_response.py b/src/tower/tower_api_client/models/update_webhook_response.py new file mode 100644 index 00000000..fe698626 --- /dev/null +++ b/src/tower/tower_api_client/models/update_webhook_response.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook import Webhook + + +T = TypeVar("T", bound="UpdateWebhookResponse") + + +@_attrs_define +class UpdateWebhookResponse: + """ + Attributes: + webhook (Webhook): + schema (str | Unset): A URL to the JSON Schema for this object. Example: + https://api.tower.dev/v1/schemas/UpdateWebhookResponse.json. + """ + + webhook: Webhook + schema: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + webhook = self.webhook.to_dict() + + schema = self.schema + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "webhook": webhook, + } + ) + if schema is not UNSET: + field_dict["$schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.webhook import Webhook + + d = dict(src_dict) + webhook = Webhook.from_dict(d.pop("webhook")) + + schema = d.pop("$schema", UNSET) + + update_webhook_response = cls( + webhook=webhook, + schema=schema, + ) + + return update_webhook_response diff --git a/src/tower/tower_api_client/models/user.py b/src/tower/tower_api_client/models/user.py index b628e336..0ef65262 100644 --- a/src/tower/tower_api_client/models/user.py +++ b/src/tower/tower_api_client/models/user.py @@ -1,6 +1,8 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define from dateutil.parser import isoparse @@ -24,7 +26,8 @@ class User: is_subscribed_to_changelog (bool): last_name (str): profile_photo_url (str): - is_invitation_claimed (Union[Unset, bool]): This property is deprecated. It will be removed in a future version. + promo_code (str): + is_invitation_claimed (bool | Unset): This property is deprecated. It will be removed in a future version. """ company: str @@ -37,7 +40,8 @@ class User: is_subscribed_to_changelog: bool last_name: str profile_photo_url: str - is_invitation_claimed: Union[Unset, bool] = UNSET + promo_code: str + is_invitation_claimed: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: company = self.company @@ -60,9 +64,12 @@ def to_dict(self) -> dict[str, Any]: profile_photo_url = self.profile_photo_url + promo_code = self.promo_code + is_invitation_claimed = self.is_invitation_claimed field_dict: dict[str, Any] = {} + field_dict.update( { "company": company, @@ -75,6 +82,7 @@ def to_dict(self) -> dict[str, Any]: "is_subscribed_to_changelog": is_subscribed_to_changelog, "last_name": last_name, "profile_photo_url": profile_photo_url, + "promo_code": promo_code, } ) if is_invitation_claimed is not UNSET: @@ -105,6 +113,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: profile_photo_url = d.pop("profile_photo_url") + promo_code = d.pop("promo_code") + is_invitation_claimed = d.pop("is_invitation_claimed", UNSET) user = cls( @@ -118,6 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: is_subscribed_to_changelog=is_subscribed_to_changelog, last_name=last_name, profile_photo_url=profile_photo_url, + promo_code=promo_code, is_invitation_claimed=is_invitation_claimed, ) diff --git a/src/tower/tower_api_client/models/verified_authenticator.py b/src/tower/tower_api_client/models/verified_authenticator.py index 0a0764af..d9ee4201 100644 --- a/src/tower/tower_api_client/models/verified_authenticator.py +++ b/src/tower/tower_api_client/models/verified_authenticator.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -33,6 +35,7 @@ def to_dict(self) -> dict[str, Any]: label = self.label field_dict: dict[str, Any] = {} + field_dict.update( { "created_at": created_at, diff --git a/src/tower/tower_api_client/models/verify_email_params.py b/src/tower/tower_api_client/models/verify_email_params.py index 9af6b609..32e1b394 100644 --- a/src/tower/tower_api_client/models/verify_email_params.py +++ b/src/tower/tower_api_client/models/verify_email_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -13,12 +15,12 @@ class VerifyEmailParams: """ Attributes: code (str): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/VerifyEmailParams.json. """ code: str - schema: Union[Unset, str] = UNSET + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: code = self.code @@ -26,6 +28,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "code": code, diff --git a/src/tower/tower_api_client/models/verify_email_response.py b/src/tower/tower_api_client/models/verify_email_response.py index 54a8d7aa..40f4135d 100644 --- a/src/tower/tower_api_client/models/verify_email_response.py +++ b/src/tower/tower_api_client/models/verify_email_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -17,12 +19,12 @@ class VerifyEmailResponse: """ Attributes: user (User): - schema (Union[Unset, str]): A URL to the JSON Schema for this object. Example: + schema (str | Unset): A URL to the JSON Schema for this object. Example: https://api.tower.dev/v1/schemas/VerifyEmailResponse.json. """ - user: "User" - schema: Union[Unset, str] = UNSET + user: User + schema: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: user = self.user.to_dict() @@ -30,6 +32,7 @@ def to_dict(self) -> dict[str, Any]: schema = self.schema field_dict: dict[str, Any] = {} + field_dict.update( { "user": user, diff --git a/src/tower/tower_api_client/models/webhook.py b/src/tower/tower_api_client/models/webhook.py new file mode 100644 index 00000000..023f8948 --- /dev/null +++ b/src/tower/tower_api_client/models/webhook.py @@ -0,0 +1,128 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.webhook_state import WebhookState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Webhook") + + +@_attrs_define +class Webhook: + """ + Attributes: + account_id (str): + created_at (datetime.datetime): + created_by_id (str): + last_checked_at (datetime.datetime | None): + name (str): + state (WebhookState): + url (str): + deleted_at (datetime.datetime | Unset): + """ + + account_id: str + created_at: datetime.datetime + created_by_id: str + last_checked_at: datetime.datetime | None + name: str + state: WebhookState + url: str + deleted_at: datetime.datetime | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + account_id = self.account_id + + created_at = self.created_at.isoformat() + + created_by_id = self.created_by_id + + last_checked_at: None | str + if isinstance(self.last_checked_at, datetime.datetime): + last_checked_at = self.last_checked_at.isoformat() + else: + last_checked_at = self.last_checked_at + + name = self.name + + state = self.state.value + + url = self.url + + deleted_at: str | Unset = UNSET + if not isinstance(self.deleted_at, Unset): + deleted_at = self.deleted_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "account_id": account_id, + "created_at": created_at, + "created_by_id": created_by_id, + "last_checked_at": last_checked_at, + "name": name, + "state": state, + "url": url, + } + ) + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + account_id = d.pop("account_id") + + created_at = isoparse(d.pop("created_at")) + + created_by_id = d.pop("created_by_id") + + def _parse_last_checked_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_checked_at_type_0 = isoparse(data) + + return last_checked_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_checked_at = _parse_last_checked_at(d.pop("last_checked_at")) + + name = d.pop("name") + + state = WebhookState(d.pop("state")) + + url = d.pop("url") + + _deleted_at = d.pop("deleted_at", UNSET) + deleted_at: datetime.datetime | Unset + if isinstance(_deleted_at, Unset): + deleted_at = UNSET + else: + deleted_at = isoparse(_deleted_at) + + webhook = cls( + account_id=account_id, + created_at=created_at, + created_by_id=created_by_id, + last_checked_at=last_checked_at, + name=name, + state=state, + url=url, + deleted_at=deleted_at, + ) + + return webhook diff --git a/src/tower/tower_api_client/models/webhook_state.py b/src/tower/tower_api_client/models/webhook_state.py new file mode 100644 index 00000000..b302e807 --- /dev/null +++ b/src/tower/tower_api_client/models/webhook_state.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class WebhookState(str, Enum): + HEALTHY = "healthy" + UNHEALTHY = "unhealthy" + UNKNOWN = "unknown" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/tower/tower_api_client/types.py b/src/tower/tower_api_client/types.py index b9ed58b8..b64af095 100644 --- a/src/tower/tower_api_client/types.py +++ b/src/tower/tower_api_client/types.py @@ -1,8 +1,8 @@ """Contains some shared types for properties""" -from collections.abc import MutableMapping +from collections.abc import Mapping, MutableMapping from http import HTTPStatus -from typing import BinaryIO, Generic, Literal, Optional, TypeVar +from typing import IO, BinaryIO, Generic, Literal, TypeVar from attrs import define @@ -14,7 +14,15 @@ def __bool__(self) -> Literal[False]: UNSET: Unset = Unset() -FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]] +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] @define @@ -22,10 +30,10 @@ class File: """Contains information for file uploads""" payload: BinaryIO - file_name: Optional[str] = None - mime_type: Optional[str] = None + file_name: str | None = None + mime_type: str | None = None - def to_tuple(self) -> FileJsonType: + def to_tuple(self) -> FileTypes: """Return a tuple representation that httpx will accept for multipart/form-data""" return self.file_name, self.payload, self.mime_type @@ -40,7 +48,7 @@ class Response(Generic[T]): status_code: HTTPStatus content: bytes headers: MutableMapping[str, str] - parsed: Optional[T] + parsed: T | None -__all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"] +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"] diff --git a/tests/tower/test_client.py b/tests/tower/test_client.py index 1d06c3e9..78b04f34 100644 --- a/tests/tower/test_client.py +++ b/tests/tower/test_client.py @@ -55,7 +55,7 @@ def _create_run_response( "exit_code": None, "status_group": status_group, "parameters": parameters, - "initiator": {"type": "tower_cli"}, + "initiator": {"type": "tower_cli", "details": {}}, "is_scheduled": False, }, "$links": { @@ -103,6 +103,7 @@ def _create_run( initiator=RunInitiator.from_dict( { "type": "tower_cli", + "details": {}, } ), is_scheduled=False, diff --git a/uv.lock b/uv.lock index 84bec35c..f6d822a4 100644 --- a/uv.lock +++ b/uv.lock @@ -1,10 +1,9 @@ version = 1 -revision = 2 -requires-python = ">=3.9" +revision = 3 +requires-python = ">=3.10" resolution-markers = [ "python_full_version >= '3.11'", - "python_full_version == '3.10.*'", - "python_full_version < '3.10'", + "python_full_version < '3.11'", ] [[package]] @@ -109,21 +108,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3c/3b/aea9c3e70ff4e030f46902df28b4cdf486695f4d78fd9c6698827e2bafab/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:38e3c4f80196b4f6c3a85d134a534a56f52da9cb8d8e7af1b79a32eefee73a00", size = 1273772, upload-time = "2024-11-13T16:38:56.846Z" }, { url = "https://files.pythonhosted.org/packages/e9/9e/4b4c5705270d1c4ee146516ad288af720798d957ba46504aaf99b86e85d9/aiohttp-3.10.11-cp313-cp313-win32.whl", hash = "sha256:fc31820cfc3b2863c6e95e14fcf815dc7afe52480b4dc03393c4873bb5599f71", size = 358679, upload-time = "2024-11-13T16:38:59.787Z" }, { url = "https://files.pythonhosted.org/packages/28/1d/18ef37549901db94717d4389eb7be807acbfbdeab48a73ff2993fc909118/aiohttp-3.10.11-cp313-cp313-win_amd64.whl", hash = "sha256:4996ff1345704ffdd6d75fb06ed175938c133425af616142e7187f28dc75f14e", size = 378073, upload-time = "2024-11-13T16:39:02.065Z" }, - { url = "https://files.pythonhosted.org/packages/cc/df/aa0d1548db818395a372b5f90e62072677ce786d6b19680c49dd4da3825f/aiohttp-3.10.11-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cdc493a2e5d8dc79b2df5bec9558425bcd39aff59fc949810cbd0832e294b106", size = 589833, upload-time = "2024-11-13T16:39:49.72Z" }, - { url = "https://files.pythonhosted.org/packages/75/7c/d11145784b3fa29c0421a3883a4b91ee8c19acb40332b1d2e39f47be4e5b/aiohttp-3.10.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b3e70f24e7d0405be2348da9d5a7836936bf3a9b4fd210f8c37e8d48bc32eca6", size = 401685, upload-time = "2024-11-13T16:39:52.263Z" }, - { url = "https://files.pythonhosted.org/packages/e2/67/1b5f93babeb060cb683d23104b243be1d6299fe6cd807dcb56cf67d2e62c/aiohttp-3.10.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:968b8fb2a5eee2770eda9c7b5581587ef9b96fbdf8dcabc6b446d35ccc69df01", size = 392957, upload-time = "2024-11-13T16:39:54.668Z" }, - { url = "https://files.pythonhosted.org/packages/e1/4d/441df53aafd8dd97b8cfe9e467c641fa19cb5113e7601a7f77f2124518e0/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:deef4362af9493d1382ef86732ee2e4cbc0d7c005947bd54ad1a9a16dd59298e", size = 1229754, upload-time = "2024-11-13T16:39:57.166Z" }, - { url = "https://files.pythonhosted.org/packages/4d/cc/f1397a2501b95cb94580de7051395e85af95a1e27aed1f8af73459ddfa22/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:686b03196976e327412a1b094f4120778c7c4b9cff9bce8d2fdfeca386b89829", size = 1266246, upload-time = "2024-11-13T16:40:00.723Z" }, - { url = "https://files.pythonhosted.org/packages/c2/b5/7d33dae7630b4e9f90d634c6a90cb0923797e011b71cd9b10fe685aec3f6/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3bf6d027d9d1d34e1c2e1645f18a6498c98d634f8e373395221121f1c258ace8", size = 1301720, upload-time = "2024-11-13T16:40:04.111Z" }, - { url = "https://files.pythonhosted.org/packages/51/36/f917bcc63bc489aa3f534fa81efbf895fa5286745dcd8bbd0eb9dbc923a1/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:099fd126bf960f96d34a760e747a629c27fb3634da5d05c7ef4d35ef4ea519fc", size = 1221527, upload-time = "2024-11-13T16:40:06.851Z" }, - { url = "https://files.pythonhosted.org/packages/32/c2/1a303a072b4763d99d4b0664a3a8b952869e3fbb660d4239826bd0c56cc1/aiohttp-3.10.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c73c4d3dae0b4644bc21e3de546530531d6cdc88659cdeb6579cd627d3c206aa", size = 1192309, upload-time = "2024-11-13T16:40:09.65Z" }, - { url = "https://files.pythonhosted.org/packages/62/ef/d62f705dc665382b78ef171e5ba2616c395220ac7c1f452f0d2dcad3f9f5/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0c5580f3c51eea91559db3facd45d72e7ec970b04528b4709b1f9c2555bd6d0b", size = 1189481, upload-time = "2024-11-13T16:40:12.77Z" }, - { url = "https://files.pythonhosted.org/packages/40/22/3e3eb4f97e5c4f52ccd198512b583c0c9135aa4e989c7ade97023c4cd282/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fdf6429f0caabfd8a30c4e2eaecb547b3c340e4730ebfe25139779b9815ba138", size = 1187877, upload-time = "2024-11-13T16:40:15.985Z" }, - { url = "https://files.pythonhosted.org/packages/b5/73/77475777fbe2b3efaceb49db2859f1a22c96fd5869d736e80375db05bbf4/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d97187de3c276263db3564bb9d9fad9e15b51ea10a371ffa5947a5ba93ad6777", size = 1246006, upload-time = "2024-11-13T16:40:19.17Z" }, - { url = "https://files.pythonhosted.org/packages/ef/f7/5b060d19065473da91838b63d8fd4d20ef8426a7d905cc8f9cd11eabd780/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0acafb350cfb2eba70eb5d271f55e08bd4502ec35e964e18ad3e7d34d71f7261", size = 1260403, upload-time = "2024-11-13T16:40:21.761Z" }, - { url = "https://files.pythonhosted.org/packages/6c/ea/e9ad224815cd83c8dfda686d2bafa2cab5b93d7232e09470a8d2a158acde/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c13ed0c779911c7998a58e7848954bd4d63df3e3575f591e321b19a2aec8df9f", size = 1208643, upload-time = "2024-11-13T16:40:24.803Z" }, - { url = "https://files.pythonhosted.org/packages/ba/c1/e1c6bba72f379adbd52958601a8642546ed0807964afba3b1b5b8cfb1bc0/aiohttp-3.10.11-cp39-cp39-win32.whl", hash = "sha256:22b7c540c55909140f63ab4f54ec2c20d2635c0289cdd8006da46f3327f971b9", size = 364419, upload-time = "2024-11-13T16:40:27.817Z" }, - { url = "https://files.pythonhosted.org/packages/30/24/50862e06e86cd263c60661e00b9d2c8d7fdece4fe95454ed5aa21ecf8036/aiohttp-3.10.11-cp39-cp39-win_amd64.whl", hash = "sha256:7b26b1551e481012575dab8e3727b16fe7dd27eb2711d2e63ced7368756268fb", size = 382857, upload-time = "2024-11-13T16:40:30.427Z" }, ] [[package]] @@ -202,7 +186,6 @@ dependencies = [ { name = "parse-type" }, { name = "six" }, { name = "tomli", marker = "python_full_version < '3.11'" }, - { name = "win-unicode-console", marker = "python_full_version < '3.10'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/62/51/f37442fe648b3e35ecf69bee803fa6db3f74c5b46d6c882d0bc5654185a2/behave-1.3.3.tar.gz", hash = "sha256:2b8f4b64ed2ea756a5a2a73e23defc1c4631e9e724c499e46661778453ebaf51", size = 892639, upload-time = "2025-09-04T12:12:02.531Z" } wheels = [ @@ -214,8 +197,7 @@ name = "black" version = "24.10.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "click" }, { name = "mypy-extensions" }, { name = "packaging" }, { name = "pathspec" }, @@ -241,10 +223,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/37/d5/602d0ef5dfcace3fb4f79c436762f130abd9ee8d950fa2abdbf8bbc555e0/black-24.10.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1f93102e0c5bb3907451063e08b9876dbeac810e7da5a8bfb7aeb5a9ef89066b", size = 1448085, upload-time = "2024-10-07T19:28:12.093Z" }, { url = "https://files.pythonhosted.org/packages/47/6d/a3a239e938960df1a662b93d6230d4f3e9b4a22982d060fc38c42f45a56b/black-24.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ddacb691cdcdf77b96f549cf9591701d8db36b2f19519373d60d31746068dbf2", size = 1760928, upload-time = "2024-10-07T19:24:15.233Z" }, { url = "https://files.pythonhosted.org/packages/dd/cf/af018e13b0eddfb434df4d9cd1b2b7892bab119f7a20123e93f6910982e8/black-24.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:680359d932801c76d2e9c9068d05c6b107f2584b2a5b88831c83962eb9984c1b", size = 1436875, upload-time = "2024-10-07T19:24:42.762Z" }, - { url = "https://files.pythonhosted.org/packages/fe/02/f408c804e0ee78c367dcea0a01aedde4f1712af93b8b6e60df981e0228c7/black-24.10.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:17374989640fbca88b6a448129cd1745c5eb8d9547b464f281b251dd00155ccd", size = 1622516, upload-time = "2024-10-07T19:29:40.629Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b9/9b706ed2f55bfb28b436225a9c57da35990c9005b90b8c91f03924454ad7/black-24.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:63f626344343083322233f175aaf372d326de8436f5928c042639a4afbbf1d3f", size = 1456181, upload-time = "2024-10-07T19:28:11.16Z" }, - { url = "https://files.pythonhosted.org/packages/0a/1c/314d7f17434a5375682ad097f6f4cc0e3f414f3c95a9b1bb4df14a0f11f9/black-24.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfa1d0cb6200857f1923b602f978386a3a2758a65b52e0950299ea014be6800", size = 1752801, upload-time = "2024-10-07T19:23:56.594Z" }, - { url = "https://files.pythonhosted.org/packages/39/a7/20e5cd9237d28ad0b31438de5d9f01c8b99814576f4c0cda1edd62caf4b0/black-24.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:2cd9c95431d94adc56600710f8813ee27eea544dd118d45896bb734e9d7a0dc7", size = 1413626, upload-time = "2024-10-07T19:24:46.133Z" }, { url = "https://files.pythonhosted.org/packages/8d/a7/4b27c50537ebca8bec139b872861f9d2bf501c5ec51fcf897cb924d9e264/black-24.10.0-py3-none-any.whl", hash = "sha256:3bb2b7a1f7b685f85b11fed1ef10f8a9148bceb49853e47a294a3dd963c1dd7d", size = 206898, upload-time = "2024-10-07T19:20:48.317Z" }, ] @@ -336,45 +314,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/72/2a/aff5dd112b2f14bcc3462c312dce5445806bfc8ab3a7328555da95330e4b/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", size = 152224, upload-time = "2025-08-09T07:56:51.369Z" }, { url = "https://files.pythonhosted.org/packages/b7/8c/9839225320046ed279c6e839d51f028342eb77c91c89b8ef2549f951f3ec/charset_normalizer-3.4.3-cp314-cp314-win32.whl", hash = "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", size = 100086, upload-time = "2025-08-09T07:56:52.722Z" }, { url = "https://files.pythonhosted.org/packages/ee/7a/36fbcf646e41f710ce0a563c1c9a343c6edf9be80786edeb15b6f62e17db/charset_normalizer-3.4.3-cp314-cp314-win_amd64.whl", hash = "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", size = 107400, upload-time = "2025-08-09T07:56:55.172Z" }, - { url = "https://files.pythonhosted.org/packages/c2/ca/9a0983dd5c8e9733565cf3db4df2b0a2e9a82659fd8aa2a868ac6e4a991f/charset_normalizer-3.4.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05", size = 207520, upload-time = "2025-08-09T07:57:11.026Z" }, - { url = "https://files.pythonhosted.org/packages/39/c6/99271dc37243a4f925b09090493fb96c9333d7992c6187f5cfe5312008d2/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e", size = 147307, upload-time = "2025-08-09T07:57:12.4Z" }, - { url = "https://files.pythonhosted.org/packages/e4/69/132eab043356bba06eb333cc2cc60c6340857d0a2e4ca6dc2b51312886b3/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99", size = 160448, upload-time = "2025-08-09T07:57:13.712Z" }, - { url = "https://files.pythonhosted.org/packages/04/9a/914d294daa4809c57667b77470533e65def9c0be1ef8b4c1183a99170e9d/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7", size = 157758, upload-time = "2025-08-09T07:57:14.979Z" }, - { url = "https://files.pythonhosted.org/packages/b0/a8/6f5bcf1bcf63cb45625f7c5cadca026121ff8a6c8a3256d8d8cd59302663/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7", size = 152487, upload-time = "2025-08-09T07:57:16.332Z" }, - { url = "https://files.pythonhosted.org/packages/c4/72/d3d0e9592f4e504f9dea08b8db270821c909558c353dc3b457ed2509f2fb/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19", size = 150054, upload-time = "2025-08-09T07:57:17.576Z" }, - { url = "https://files.pythonhosted.org/packages/20/30/5f64fe3981677fe63fa987b80e6c01042eb5ff653ff7cec1b7bd9268e54e/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312", size = 161703, upload-time = "2025-08-09T07:57:20.012Z" }, - { url = "https://files.pythonhosted.org/packages/e1/ef/dd08b2cac9284fd59e70f7d97382c33a3d0a926e45b15fc21b3308324ffd/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc", size = 159096, upload-time = "2025-08-09T07:57:21.329Z" }, - { url = "https://files.pythonhosted.org/packages/45/8c/dcef87cfc2b3f002a6478f38906f9040302c68aebe21468090e39cde1445/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34", size = 153852, upload-time = "2025-08-09T07:57:22.608Z" }, - { url = "https://files.pythonhosted.org/packages/63/86/9cbd533bd37883d467fcd1bd491b3547a3532d0fbb46de2b99feeebf185e/charset_normalizer-3.4.3-cp39-cp39-win32.whl", hash = "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432", size = 99840, upload-time = "2025-08-09T07:57:23.883Z" }, - { url = "https://files.pythonhosted.org/packages/ce/d6/7e805c8e5c46ff9729c49950acc4ee0aeb55efb8b3a56687658ad10c3216/charset_normalizer-3.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca", size = 107438, upload-time = "2025-08-09T07:57:25.287Z" }, { url = "https://files.pythonhosted.org/packages/8a/1f/f041989e93b001bc4e44bb1669ccdcf54d3f00e628229a85b08d330615c5/charset_normalizer-3.4.3-py3-none-any.whl", hash = "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", size = 53175, upload-time = "2025-08-09T07:57:26.864Z" }, ] -[[package]] -name = "click" -version = "8.1.8" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.10'", -] -dependencies = [ - { name = "colorama", marker = "python_full_version < '3.10' and sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593, upload-time = "2024-12-21T18:38:44.339Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/d4/7ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c/click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", size = 98188, upload-time = "2024-12-21T18:38:41.666Z" }, -] - [[package]] name = "click" version = "8.2.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.11'", - "python_full_version == '3.10.*'", -] dependencies = [ - { name = "colorama", marker = "python_full_version >= '3.10' and sys_platform == 'win32'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342, upload-time = "2025-05-20T23:19:49.832Z" } wheels = [ @@ -465,8 +413,7 @@ version = "1.9.10" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "agate" }, - { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "click" }, { name = "daff" }, { name = "dbt-adapters" }, { name = "dbt-common" }, @@ -474,8 +421,7 @@ dependencies = [ { name = "dbt-semantic-interfaces" }, { name = "jinja2" }, { name = "mashumaro", extra = ["msgpack"] }, - { name = "networkx", version = "3.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "networkx", version = "3.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.10.*'" }, + { name = "networkx", version = "3.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "networkx", version = "3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "packaging" }, { name = "pathspec" }, @@ -532,8 +478,7 @@ name = "dbt-semantic-interfaces" version = "0.7.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "click" }, { name = "importlib-metadata" }, { name = "jinja2" }, { name = "jsonschema" }, @@ -583,7 +528,7 @@ name = "exceptiongroup" version = "1.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" } wheels = [ @@ -690,23 +635,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/40/37/5f9f3c3fd7f7746082ec67bcdc204db72dad081f4f83a503d33220a92973/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:1a85e345b4c43db8b842cab1feb41be5cc0b10a1830e6295b69d7310f99becaf", size = 282620, upload-time = "2025-06-09T23:02:00.493Z" }, { url = "https://files.pythonhosted.org/packages/0b/31/8fbc5af2d183bff20f21aa743b4088eac4445d2bb1cdece449ae80e4e2d1/frozenlist-1.7.0-cp313-cp313t-win32.whl", hash = "sha256:3a14027124ddb70dfcee5148979998066897e79f89f64b13328595c4bdf77c81", size = 43059, upload-time = "2025-06-09T23:02:02.072Z" }, { url = "https://files.pythonhosted.org/packages/bb/ed/41956f52105b8dbc26e457c5705340c67c8cc2b79f394b79bffc09d0e938/frozenlist-1.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:3bf8010d71d4507775f658e9823210b7427be36625b387221642725b515dcf3e", size = 47516, upload-time = "2025-06-09T23:02:03.779Z" }, - { url = "https://files.pythonhosted.org/packages/dd/b1/ee59496f51cd244039330015d60f13ce5a54a0f2bd8d79e4a4a375ab7469/frozenlist-1.7.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cea3dbd15aea1341ea2de490574a4a37ca080b2ae24e4b4f4b51b9057b4c3630", size = 82434, upload-time = "2025-06-09T23:02:05.195Z" }, - { url = "https://files.pythonhosted.org/packages/75/e1/d518391ce36a6279b3fa5bc14327dde80bcb646bb50d059c6ca0756b8d05/frozenlist-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7d536ee086b23fecc36c2073c371572374ff50ef4db515e4e503925361c24f71", size = 48232, upload-time = "2025-06-09T23:02:07.728Z" }, - { url = "https://files.pythonhosted.org/packages/b7/8d/a0d04f28b6e821a9685c22e67b5fb798a5a7b68752f104bfbc2dccf080c4/frozenlist-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dfcebf56f703cb2e346315431699f00db126d158455e513bd14089d992101e44", size = 47186, upload-time = "2025-06-09T23:02:09.243Z" }, - { url = "https://files.pythonhosted.org/packages/93/3a/a5334c0535c8b7c78eeabda1579179e44fe3d644e07118e59a2276dedaf1/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:974c5336e61d6e7eb1ea5b929cb645e882aadab0095c5a6974a111e6479f8878", size = 226617, upload-time = "2025-06-09T23:02:10.949Z" }, - { url = "https://files.pythonhosted.org/packages/0a/67/8258d971f519dc3f278c55069a775096cda6610a267b53f6248152b72b2f/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c70db4a0ab5ab20878432c40563573229a7ed9241506181bba12f6b7d0dc41cb", size = 224179, upload-time = "2025-06-09T23:02:12.603Z" }, - { url = "https://files.pythonhosted.org/packages/fc/89/8225905bf889b97c6d935dd3aeb45668461e59d415cb019619383a8a7c3b/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1137b78384eebaf70560a36b7b229f752fb64d463d38d1304939984d5cb887b6", size = 235783, upload-time = "2025-06-09T23:02:14.678Z" }, - { url = "https://files.pythonhosted.org/packages/54/6e/ef52375aa93d4bc510d061df06205fa6dcfd94cd631dd22956b09128f0d4/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e793a9f01b3e8b5c0bc646fb59140ce0efcc580d22a3468d70766091beb81b35", size = 229210, upload-time = "2025-06-09T23:02:16.313Z" }, - { url = "https://files.pythonhosted.org/packages/ee/55/62c87d1a6547bfbcd645df10432c129100c5bd0fd92a384de6e3378b07c1/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74739ba8e4e38221d2c5c03d90a7e542cb8ad681915f4ca8f68d04f810ee0a87", size = 215994, upload-time = "2025-06-09T23:02:17.9Z" }, - { url = "https://files.pythonhosted.org/packages/45/d2/263fea1f658b8ad648c7d94d18a87bca7e8c67bd6a1bbf5445b1bd5b158c/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e63344c4e929b1a01e29bc184bbb5fd82954869033765bfe8d65d09e336a677", size = 225122, upload-time = "2025-06-09T23:02:19.479Z" }, - { url = "https://files.pythonhosted.org/packages/7b/22/7145e35d12fb368d92124f679bea87309495e2e9ddf14c6533990cb69218/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2ea2a7369eb76de2217a842f22087913cdf75f63cf1307b9024ab82dfb525938", size = 224019, upload-time = "2025-06-09T23:02:20.969Z" }, - { url = "https://files.pythonhosted.org/packages/44/1e/7dae8c54301beb87bcafc6144b9a103bfd2c8f38078c7902984c9a0c4e5b/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:836b42f472a0e006e02499cef9352ce8097f33df43baaba3e0a28a964c26c7d2", size = 239925, upload-time = "2025-06-09T23:02:22.466Z" }, - { url = "https://files.pythonhosted.org/packages/4b/1e/99c93e54aa382e949a98976a73b9b20c3aae6d9d893f31bbe4991f64e3a8/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e22b9a99741294b2571667c07d9f8cceec07cb92aae5ccda39ea1b6052ed4319", size = 220881, upload-time = "2025-06-09T23:02:24.521Z" }, - { url = "https://files.pythonhosted.org/packages/5e/9c/ca5105fa7fb5abdfa8837581be790447ae051da75d32f25c8f81082ffc45/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:9a19e85cc503d958abe5218953df722748d87172f71b73cf3c9257a91b999890", size = 234046, upload-time = "2025-06-09T23:02:26.206Z" }, - { url = "https://files.pythonhosted.org/packages/8d/4d/e99014756093b4ddbb67fb8f0df11fe7a415760d69ace98e2ac6d5d43402/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f22dac33bb3ee8fe3e013aa7b91dc12f60d61d05b7fe32191ffa84c3aafe77bd", size = 235756, upload-time = "2025-06-09T23:02:27.79Z" }, - { url = "https://files.pythonhosted.org/packages/8b/72/a19a40bcdaa28a51add2aaa3a1a294ec357f36f27bd836a012e070c5e8a5/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ccec739a99e4ccf664ea0775149f2749b8a6418eb5b8384b4dc0a7d15d304cb", size = 222894, upload-time = "2025-06-09T23:02:29.848Z" }, - { url = "https://files.pythonhosted.org/packages/08/49/0042469993e023a758af81db68c76907cd29e847d772334d4d201cbe9a42/frozenlist-1.7.0-cp39-cp39-win32.whl", hash = "sha256:b3950f11058310008a87757f3eee16a8e1ca97979833239439586857bc25482e", size = 39848, upload-time = "2025-06-09T23:02:31.413Z" }, - { url = "https://files.pythonhosted.org/packages/5a/45/827d86ee475c877f5f766fbc23fb6acb6fada9e52f1c9720e2ba3eae32da/frozenlist-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:43a82fce6769c70f2f5a06248b614a7d268080a9d20f7457ef10ecee5af82b63", size = 44102, upload-time = "2025-06-09T23:02:32.808Z" }, { url = "https://files.pythonhosted.org/packages/ee/45/b82e3c16be2182bff01179db177fe144d58b5dc787a7d4492c6ed8b9317f/frozenlist-1.7.0-py3-none-any.whl", hash = "sha256:9a5af342e34f7e97caf8c995864c7a396418ae2859cc6fdf1b1073020d516a7e", size = 13106, upload-time = "2025-06-09T23:02:34.204Z" }, ] @@ -778,18 +706,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/23/6e/74407aed965a4ab6ddd93a7ded3180b730d281c77b765788419484cdfeef/greenlet-3.2.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2917bdf657f5859fbf3386b12d68ede4cf1f04c90c3a6bc1f013dd68a22e2269", size = 1612508, upload-time = "2025-11-04T12:42:23.427Z" }, { url = "https://files.pythonhosted.org/packages/0d/da/343cd760ab2f92bac1845ca07ee3faea9fe52bee65f7bcb19f16ad7de08b/greenlet-3.2.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:015d48959d4add5d6c9f6c5210ee3803a830dce46356e3bc326d6776bde54681", size = 1680760, upload-time = "2025-11-04T12:42:25.341Z" }, { url = "https://files.pythonhosted.org/packages/e3/a5/6ddab2b4c112be95601c13428db1d8b6608a8b6039816f2ba09c346c08fc/greenlet-3.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01", size = 303425, upload-time = "2025-08-07T13:32:27.59Z" }, - { url = "https://files.pythonhosted.org/packages/f7/c0/93885c4106d2626bf51fdec377d6aef740dfa5c4877461889a7cf8e565cc/greenlet-3.2.4-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:b6a7c19cf0d2742d0809a4c05975db036fdff50cd294a93632d6a310bf9ac02c", size = 269859, upload-time = "2025-08-07T13:16:16.003Z" }, - { url = "https://files.pythonhosted.org/packages/4d/f5/33f05dc3ba10a02dedb1485870cf81c109227d3d3aa280f0e48486cac248/greenlet-3.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:27890167f55d2387576d1f41d9487ef171849ea0359ce1510ca6e06c8bece11d", size = 627610, upload-time = "2025-08-07T13:43:01.345Z" }, - { url = "https://files.pythonhosted.org/packages/b2/a7/9476decef51a0844195f99ed5dc611d212e9b3515512ecdf7321543a7225/greenlet-3.2.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:18d9260df2b5fbf41ae5139e1be4e796d99655f023a636cd0e11e6406cca7d58", size = 639417, upload-time = "2025-08-07T13:45:32.094Z" }, - { url = "https://files.pythonhosted.org/packages/bd/e0/849b9159cbb176f8c0af5caaff1faffdece7a8417fcc6fe1869770e33e21/greenlet-3.2.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:671df96c1f23c4a0d4077a325483c1503c96a1b7d9db26592ae770daa41233d4", size = 634751, upload-time = "2025-08-07T13:53:18.848Z" }, - { url = "https://files.pythonhosted.org/packages/5f/d3/844e714a9bbd39034144dca8b658dcd01839b72bb0ec7d8014e33e3705f0/greenlet-3.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:16458c245a38991aa19676900d48bd1a6f2ce3e16595051a4db9d012154e8433", size = 634020, upload-time = "2025-08-07T13:18:36.841Z" }, - { url = "https://files.pythonhosted.org/packages/6b/4c/f3de2a8de0e840ecb0253ad0dc7e2bb3747348e798ec7e397d783a3cb380/greenlet-3.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9913f1a30e4526f432991f89ae263459b1c64d1608c0d22a5c79c287b3c70df", size = 582817, upload-time = "2025-08-07T13:18:35.48Z" }, - { url = "https://files.pythonhosted.org/packages/89/80/7332915adc766035c8980b161c2e5d50b2f941f453af232c164cff5e0aeb/greenlet-3.2.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b90654e092f928f110e0007f572007c9727b5265f7632c2fa7415b4689351594", size = 1111985, upload-time = "2025-08-07T13:42:42.425Z" }, - { url = "https://files.pythonhosted.org/packages/66/71/1928e2c80197353bcb9b50aa19c4d8e26ee6d7a900c564907665cf4b9a41/greenlet-3.2.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:81701fd84f26330f0d5f4944d4e92e61afe6319dcd9775e39396e39d7c3e5f98", size = 1136137, upload-time = "2025-08-07T13:18:26.168Z" }, - { url = "https://files.pythonhosted.org/packages/4b/bf/7bd33643e48ed45dcc0e22572f650767832bd4e1287f97434943cc402148/greenlet-3.2.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:28a3c6b7cd72a96f61b0e4b2a36f681025b60ae4779cc73c1535eb5f29560b10", size = 1542941, upload-time = "2025-11-04T12:42:27.427Z" }, - { url = "https://files.pythonhosted.org/packages/9b/74/4bc433f91d0d09a1c22954a371f9df928cb85e72640870158853a83415e5/greenlet-3.2.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:52206cd642670b0b320a1fd1cbfd95bca0e043179c1d8a045f2c6109dfe973be", size = 1609685, upload-time = "2025-11-04T12:42:29.242Z" }, - { url = "https://files.pythonhosted.org/packages/89/48/a5dc74dde38aeb2b15d418cec76ed50e1dd3d620ccda84d8199703248968/greenlet-3.2.4-cp39-cp39-win32.whl", hash = "sha256:65458b409c1ed459ea899e939f0e1cdb14f58dbc803f2f93c5eab5694d32671b", size = 281400, upload-time = "2025-08-07T14:02:20.263Z" }, - { url = "https://files.pythonhosted.org/packages/e5/44/342c4591db50db1076b8bda86ed0ad59240e3e1da17806a4cf10a6d0e447/greenlet-3.2.4-cp39-cp39-win_amd64.whl", hash = "sha256:d2e685ade4dafd447ede19c31277a224a239a0a1a4eca4e6390efedf20260cfb", size = 298533, upload-time = "2025-08-07T13:56:34.168Z" }, ] [[package]] @@ -971,31 +887,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a1/30/9ec597c962c5249ebd5c580386e4b5f2884cd943af42634291ee3b406415/leather-0.4.0-py2.py3-none-any.whl", hash = "sha256:18290bc93749ae39039af5e31e871fcfad74d26c4c3ea28ea4f681f4571b3a2b", size = 30256, upload-time = "2024-02-23T22:03:34.75Z" }, ] -[[package]] -name = "markdown-it-py" -version = "3.0.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.10'", -] -dependencies = [ - { name = "mdurl", marker = "python_full_version < '3.10'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, -] - [[package]] name = "markdown-it-py" version = "4.0.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.11'", - "python_full_version == '3.10.*'", -] dependencies = [ - { name = "mdurl", marker = "python_full_version >= '3.10'" }, + { name = "mdurl" }, ] sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } wheels = [ @@ -1058,16 +955,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098, upload-time = "2024-10-18T15:21:40.813Z" }, { url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208, upload-time = "2024-10-18T15:21:41.814Z" }, { url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739, upload-time = "2024-10-18T15:21:42.784Z" }, - { url = "https://files.pythonhosted.org/packages/a7/ea/9b1530c3fdeeca613faeb0fb5cbcf2389d816072fab72a71b45749ef6062/MarkupSafe-3.0.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:eaa0a10b7f72326f1372a713e73c3f739b524b3af41feb43e4921cb529f5929a", size = 14344, upload-time = "2024-10-18T15:21:43.721Z" }, - { url = "https://files.pythonhosted.org/packages/4b/c2/fbdbfe48848e7112ab05e627e718e854d20192b674952d9042ebd8c9e5de/MarkupSafe-3.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:48032821bbdf20f5799ff537c7ac3d1fba0ba032cfc06194faffa8cda8b560ff", size = 12389, upload-time = "2024-10-18T15:21:44.666Z" }, - { url = "https://files.pythonhosted.org/packages/f0/25/7a7c6e4dbd4f867d95d94ca15449e91e52856f6ed1905d58ef1de5e211d0/MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a9d3f5f0901fdec14d8d2f66ef7d035f2157240a433441719ac9a3fba440b13", size = 21607, upload-time = "2024-10-18T15:21:45.452Z" }, - { url = "https://files.pythonhosted.org/packages/53/8f/f339c98a178f3c1e545622206b40986a4c3307fe39f70ccd3d9df9a9e425/MarkupSafe-3.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88b49a3b9ff31e19998750c38e030fc7bb937398b1f78cfa599aaef92d693144", size = 20728, upload-time = "2024-10-18T15:21:46.295Z" }, - { url = "https://files.pythonhosted.org/packages/1a/03/8496a1a78308456dbd50b23a385c69b41f2e9661c67ea1329849a598a8f9/MarkupSafe-3.0.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cfad01eed2c2e0c01fd0ecd2ef42c492f7f93902e39a42fc9ee1692961443a29", size = 20826, upload-time = "2024-10-18T15:21:47.134Z" }, - { url = "https://files.pythonhosted.org/packages/e6/cf/0a490a4bd363048c3022f2f475c8c05582179bb179defcee4766fb3dcc18/MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1225beacc926f536dc82e45f8a4d68502949dc67eea90eab715dea3a21c1b5f0", size = 21843, upload-time = "2024-10-18T15:21:48.334Z" }, - { url = "https://files.pythonhosted.org/packages/19/a3/34187a78613920dfd3cdf68ef6ce5e99c4f3417f035694074beb8848cd77/MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3169b1eefae027567d1ce6ee7cae382c57fe26e82775f460f0b2778beaad66c0", size = 21219, upload-time = "2024-10-18T15:21:49.587Z" }, - { url = "https://files.pythonhosted.org/packages/17/d8/5811082f85bb88410ad7e452263af048d685669bbbfb7b595e8689152498/MarkupSafe-3.0.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:eb7972a85c54febfb25b5c4b4f3af4dcc731994c7da0d8a0b4a6eb0640e1d178", size = 20946, upload-time = "2024-10-18T15:21:50.441Z" }, - { url = "https://files.pythonhosted.org/packages/7c/31/bd635fb5989440d9365c5e3c47556cfea121c7803f5034ac843e8f37c2f2/MarkupSafe-3.0.2-cp39-cp39-win32.whl", hash = "sha256:8c4e8c3ce11e1f92f6536ff07154f9d49677ebaaafc32db9db4620bc11ed480f", size = 15063, upload-time = "2024-10-18T15:21:51.385Z" }, - { url = "https://files.pythonhosted.org/packages/b3/73/085399401383ce949f727afec55ec3abd76648d04b9f22e1c0e99cb4bec3/MarkupSafe-3.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:6e296a513ca3d94054c2c881cc913116e90fd030ad1c656b3869762b754f5f8a", size = 15506, upload-time = "2024-10-18T15:21:52.974Z" }, ] [[package]] @@ -1092,17 +979,17 @@ name = "mcp" version = "1.14.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "anyio", marker = "python_full_version >= '3.10'" }, - { name = "httpx", marker = "python_full_version >= '3.10'" }, - { name = "httpx-sse", marker = "python_full_version >= '3.10'" }, - { name = "jsonschema", marker = "python_full_version >= '3.10'" }, - { name = "pydantic", marker = "python_full_version >= '3.10'" }, - { name = "pydantic-settings", marker = "python_full_version >= '3.10'" }, - { name = "python-multipart", marker = "python_full_version >= '3.10'" }, - { name = "pywin32", marker = "python_full_version >= '3.10' and sys_platform == 'win32'" }, - { name = "sse-starlette", marker = "python_full_version >= '3.10'" }, - { name = "starlette", marker = "python_full_version >= '3.10'" }, - { name = "uvicorn", marker = "python_full_version >= '3.10' and sys_platform != 'emscripten'" }, + { name = "anyio" }, + { name = "httpx" }, + { name = "httpx-sse" }, + { name = "jsonschema" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "python-multipart" }, + { name = "pywin32", marker = "sys_platform == 'win32'" }, + { name = "sse-starlette" }, + { name = "starlette" }, + { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/95/fd/d6e941a52446198b73e5e4a953441f667f1469aeb06fb382d9f6729d6168/mcp-1.14.0.tar.gz", hash = "sha256:2e7d98b195e08b2abc1dc6191f6f3dc0059604ac13ee6a40f88676274787fac4", size = 454855, upload-time = "2025-09-11T17:40:48.667Z" } wheels = [ @@ -1228,22 +1115,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/44/1c/ccf35892684d3a408202e296e56843743e0b4fb1629e59432ea88cdb3909/mmh3-5.2.0-cp314-cp314t-win32.whl", hash = "sha256:6d541038b3fc360ec538fc116de87462627944765a6750308118f8b509a8eec7", size = 41970, upload-time = "2025-07-29T07:43:27.666Z" }, { url = "https://files.pythonhosted.org/packages/75/b2/b9e4f1e5adb5e21eb104588fcee2cd1eaa8308255173481427d5ecc4284e/mmh3-5.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:e912b19cf2378f2967d0c08e86ff4c6c360129887f678e27e4dde970d21b3f4d", size = 43063, upload-time = "2025-07-29T07:43:28.582Z" }, { url = "https://files.pythonhosted.org/packages/6a/fc/0e61d9a4e29c8679356795a40e48f647b4aad58d71bfc969f0f8f56fb912/mmh3-5.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:e7884931fe5e788163e7b3c511614130c2c59feffdc21112290a194487efb2e9", size = 40455, upload-time = "2025-07-29T07:43:29.563Z" }, - { url = "https://files.pythonhosted.org/packages/f2/11/4bad09e880b648eeb55393a644c08efbd7da302fc405c8d2f6555521bb98/mmh3-5.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3c6041fd9d5fb5fcac57d5c80f521a36b74aea06b8566431c63e4ffc49aced51", size = 56117, upload-time = "2025-07-29T07:43:30.955Z" }, - { url = "https://files.pythonhosted.org/packages/b2/43/97cacd1fa2994b4ec110334388e126fe000ddf041829721e2e59e46b0a7c/mmh3-5.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:58477cf9ef16664d1ce2b038f87d2dc96d70fe50733a34a7f07da6c9a5e3538c", size = 40634, upload-time = "2025-07-29T07:43:31.917Z" }, - { url = "https://files.pythonhosted.org/packages/e9/03/2a52e464b0e23f9838267adf75f942c5addc2c1f009a48d1ef5c331084fb/mmh3-5.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:be7d3dca9358e01dab1bad881fb2b4e8730cec58d36dd44482bc068bfcd3bc65", size = 40075, upload-time = "2025-07-29T07:43:32.9Z" }, - { url = "https://files.pythonhosted.org/packages/b3/d3/c0c00f7eb436a0adf64d8a877673ac76096bf86aca57b6a2c80786d69242/mmh3-5.2.0-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:931d47e08c9c8a67bf75d82f0ada8399eac18b03388818b62bfa42882d571d72", size = 95112, upload-time = "2025-07-29T07:43:33.815Z" }, - { url = "https://files.pythonhosted.org/packages/9b/f3/116cc1171bcb41a9cec10c46ee1d8bb5185d70c15848ff66d15ab7afb6fd/mmh3-5.2.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:dd966df3489ec13848d6c6303429bbace94a153f43d1ae2a55115fd36fd5ca5d", size = 101006, upload-time = "2025-07-29T07:43:34.876Z" }, - { url = "https://files.pythonhosted.org/packages/41/34/b38a0c5c323666e632cc07d4fd337c4af0b300619c7b8b7a1d9a2db1ac1a/mmh3-5.2.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c677d78887244bf3095020b73c42b505b700f801c690f8eaa90ad12d3179612f", size = 103782, upload-time = "2025-07-29T07:43:35.987Z" }, - { url = "https://files.pythonhosted.org/packages/25/d6/42b5ae7219ec87f756ffafcf7471b7fd3386e352653522d155f4897e06d0/mmh3-5.2.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:63830f846797187c5d3e2dae50f0848fdc86032f5bfdc58ae352f02f857e9025", size = 110660, upload-time = "2025-07-29T07:43:37.103Z" }, - { url = "https://files.pythonhosted.org/packages/8f/55/daea1ee478328f7ed3b5422f080a3f892e02bc1542f0bc5a1be083a05758/mmh3-5.2.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c3f563e8901960e2eaa64c8e8821895818acabeb41c96f2efbb936f65dbe486c", size = 118107, upload-time = "2025-07-29T07:43:38.173Z" }, - { url = "https://files.pythonhosted.org/packages/46/f1/930d3395a0aaef49db41019e94a7b46ac35b9a64c213a620eacac34078c0/mmh3-5.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:96f1e1ac44cbb42bcc406e509f70c9af42c594e72ccc7b1257f97554204445f0", size = 101448, upload-time = "2025-07-29T07:43:39.199Z" }, - { url = "https://files.pythonhosted.org/packages/cc/e4/543bf2622a1645fa560c26fe5dc2919c8c9eb2f9ac129778ce6acc9848fc/mmh3-5.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:7bbb0df897944b5ec830f3ad883e32c5a7375370a521565f5fe24443bfb2c4f7", size = 96474, upload-time = "2025-07-29T07:43:41.025Z" }, - { url = "https://files.pythonhosted.org/packages/16/d8/9c552bd64c86bb03fba08d4b702efd65b09ed54c6969df0d1ec7fa8c0ae4/mmh3-5.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:1fae471339ae1b9c641f19cf46dfe6ffd7f64b1fba7c4333b99fa3dd7f21ae0a", size = 110049, upload-time = "2025-07-29T07:43:42.106Z" }, - { url = "https://files.pythonhosted.org/packages/6b/47/8a012b9c4d9c9b704ffcd71cad861ef120b2bd417d081bdb3aaa9e396fe6/mmh3-5.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:aa6e5d31fdc5ed9e3e95f9873508615a778fe9b523d52c17fc770a3eb39ab6e4", size = 111683, upload-time = "2025-07-29T07:43:43.228Z" }, - { url = "https://files.pythonhosted.org/packages/2c/fc/4ad1bd01976484d0568a7d18d5a8597da1e65e76ac763114573dcd09d225/mmh3-5.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:746a5ee71c6d1103d9b560fa147881b5e68fd35da56e54e03d5acefad0e7c055", size = 99883, upload-time = "2025-07-29T07:43:44.304Z" }, - { url = "https://files.pythonhosted.org/packages/ed/1d/4fbd0f74c7e9c35f5f70eb77509b7a706ef76ee86957a79e228f47cf037f/mmh3-5.2.0-cp39-cp39-win32.whl", hash = "sha256:10983c10f5c77683bd845751905ba535ec47409874acc759d5ce3ff7ef34398a", size = 40790, upload-time = "2025-07-29T07:43:45.296Z" }, - { url = "https://files.pythonhosted.org/packages/a0/61/0f593606dbd3a4259301ffb61678433656dc4a2c6da022fa7a122de7ffb4/mmh3-5.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:fdfd3fb739f4e22746e13ad7ba0c6eedf5f454b18d11249724a388868e308ee4", size = 41563, upload-time = "2025-07-29T07:43:46.599Z" }, - { url = "https://files.pythonhosted.org/packages/07/e6/ff066b72d86f0a19d3e4b6f3af073a9a328cb3cb4b068e25972866fcd517/mmh3-5.2.0-cp39-cp39-win_arm64.whl", hash = "sha256:33576136c06b46a7046b6d83a3d75fbca7d25f84cec743f1ae156362608dc6d2", size = 39340, upload-time = "2025-07-29T07:43:47.512Z" }, ] [[package]] @@ -1314,14 +1185,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f0/03/42106dcded51f0a0b5284d3ce30a671e7bd3f7318d122b2ead66ad289fed/msgpack-1.1.2-cp314-cp314t-win32.whl", hash = "sha256:1d1418482b1ee984625d88aa9585db570180c286d942da463533b238b98b812b", size = 75197, upload-time = "2025-10-08T09:15:42.954Z" }, { url = "https://files.pythonhosted.org/packages/15/86/d0071e94987f8db59d4eeb386ddc64d0bb9b10820a8d82bcd3e53eeb2da6/msgpack-1.1.2-cp314-cp314t-win_amd64.whl", hash = "sha256:5a46bf7e831d09470ad92dff02b8b1ac92175ca36b087f904a0519857c6be3ff", size = 85772, upload-time = "2025-10-08T09:15:43.954Z" }, { url = "https://files.pythonhosted.org/packages/81/f2/08ace4142eb281c12701fc3b93a10795e4d4dc7f753911d836675050f886/msgpack-1.1.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d99ef64f349d5ec3293688e91486c5fdb925ed03807f64d98d205d2713c60b46", size = 70868, upload-time = "2025-10-08T09:15:44.959Z" }, - { url = "https://files.pythonhosted.org/packages/46/73/85469b4aa71d25e5949fee50d3c2cf46f69cea619fe97cfe309058080f75/msgpack-1.1.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ea5405c46e690122a76531ab97a079e184c0daf491e588592d6a23d3e32af99e", size = 81529, upload-time = "2025-10-08T09:15:46.069Z" }, - { url = "https://files.pythonhosted.org/packages/6c/3a/7d4077e8ae720b29d2b299a9591969f0d105146960681ea6f4121e6d0f8d/msgpack-1.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9fba231af7a933400238cb357ecccf8ab5d51535ea95d94fc35b7806218ff844", size = 84106, upload-time = "2025-10-08T09:15:47.064Z" }, - { url = "https://files.pythonhosted.org/packages/df/c0/da451c74746ed9388dca1b4ec647c82945f4e2f8ce242c25fb7c0e12181f/msgpack-1.1.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a8f6e7d30253714751aa0b0c84ae28948e852ee7fb0524082e6716769124bc23", size = 396656, upload-time = "2025-10-08T09:15:48.118Z" }, - { url = "https://files.pythonhosted.org/packages/e5/a1/20486c29a31ec9f0f88377fdf7eb7a67f30bcb5e0f89b7550f6f16d9373b/msgpack-1.1.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:94fd7dc7d8cb0a54432f296f2246bc39474e017204ca6f4ff345941d4ed285a7", size = 404722, upload-time = "2025-10-08T09:15:49.328Z" }, - { url = "https://files.pythonhosted.org/packages/ad/ae/e613b0a526d54ce85447d9665c2ff8c3210a784378d50573321d43d324b8/msgpack-1.1.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:350ad5353a467d9e3b126d8d1b90fe05ad081e2e1cef5753f8c345217c37e7b8", size = 391838, upload-time = "2025-10-08T09:15:50.517Z" }, - { url = "https://files.pythonhosted.org/packages/49/6a/07f3e10ed4503045b882ef7bf8512d01d8a9e25056950a977bd5f50df1c2/msgpack-1.1.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6bde749afe671dc44893f8d08e83bf475a1a14570d67c4bb5cec5573463c8833", size = 397516, upload-time = "2025-10-08T09:15:51.646Z" }, - { url = "https://files.pythonhosted.org/packages/76/9b/a86828e75986c12a3809c1e5062f5eba8e0cae3dfa2bf724ed2b1bb72b4c/msgpack-1.1.2-cp39-cp39-win32.whl", hash = "sha256:ad09b984828d6b7bb52d1d1d0c9be68ad781fa004ca39216c8a1e63c0f34ba3c", size = 64863, upload-time = "2025-10-08T09:15:53.118Z" }, - { url = "https://files.pythonhosted.org/packages/14/a7/b1992b4fb3da3b413f5fb78a63bad42f256c3be2352eb69273c3789c2c96/msgpack-1.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:67016ae8c8965124fdede9d3769528ad8284f14d635337ffa6a713a580f6c030", size = 71540, upload-time = "2025-10-08T09:15:55.573Z" }, ] [[package]] @@ -1423,24 +1286,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/50/b0/a6fae46071b645ae98786ab738447de1ef53742eaad949f27e960864bb49/multidict-6.6.4-cp313-cp313t-win32.whl", hash = "sha256:f93b2b2279883d1d0a9e1bd01f312d6fc315c5e4c1f09e112e4736e2f650bc4e", size = 47775, upload-time = "2025-08-11T12:08:12.439Z" }, { url = "https://files.pythonhosted.org/packages/b2/0a/2436550b1520091af0600dff547913cb2d66fbac27a8c33bc1b1bccd8d98/multidict-6.6.4-cp313-cp313t-win_amd64.whl", hash = "sha256:6d46a180acdf6e87cc41dc15d8f5c2986e1e8739dc25dbb7dac826731ef381a4", size = 53100, upload-time = "2025-08-11T12:08:13.823Z" }, { url = "https://files.pythonhosted.org/packages/97/ea/43ac51faff934086db9c072a94d327d71b7d8b40cd5dcb47311330929ef0/multidict-6.6.4-cp313-cp313t-win_arm64.whl", hash = "sha256:756989334015e3335d087a27331659820d53ba432befdef6a718398b0a8493ad", size = 45501, upload-time = "2025-08-11T12:08:15.173Z" }, - { url = "https://files.pythonhosted.org/packages/d4/d3/f04c5db316caee9b5b2cbba66270b358c922a959855995bedde87134287c/multidict-6.6.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:af7618b591bae552b40dbb6f93f5518328a949dac626ee75927bba1ecdeea9f4", size = 76977, upload-time = "2025-08-11T12:08:16.667Z" }, - { url = "https://files.pythonhosted.org/packages/70/39/a6200417d883e510728ab3caec02d3b66ff09e1c85e0aab2ba311abfdf06/multidict-6.6.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b6819f83aef06f560cb15482d619d0e623ce9bf155115150a85ab11b8342a665", size = 44878, upload-time = "2025-08-11T12:08:18.157Z" }, - { url = "https://files.pythonhosted.org/packages/6f/7e/815be31ed35571b137d65232816f61513fcd97b2717d6a9d7800b5a0c6e0/multidict-6.6.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4d09384e75788861e046330308e7af54dd306aaf20eb760eb1d0de26b2bea2cb", size = 44546, upload-time = "2025-08-11T12:08:19.694Z" }, - { url = "https://files.pythonhosted.org/packages/e2/f1/21b5bff6a8c3e2aff56956c241941ace6b8820e1abe6b12d3c52868a773d/multidict-6.6.4-cp39-cp39-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:a59c63061f1a07b861c004e53869eb1211ffd1a4acbca330e3322efa6dd02978", size = 223020, upload-time = "2025-08-11T12:08:21.554Z" }, - { url = "https://files.pythonhosted.org/packages/15/59/37083f1dd3439979a0ffeb1906818d978d88b4cc7f4600a9f89b1cb6713c/multidict-6.6.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:350f6b0fe1ced61e778037fdc7613f4051c8baf64b1ee19371b42a3acdb016a0", size = 240528, upload-time = "2025-08-11T12:08:23.45Z" }, - { url = "https://files.pythonhosted.org/packages/d1/f0/f054d123c87784307a27324c829eb55bcfd2e261eb785fcabbd832c8dc4a/multidict-6.6.4-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0c5cbac6b55ad69cb6aa17ee9343dfbba903118fd530348c330211dc7aa756d1", size = 219540, upload-time = "2025-08-11T12:08:24.965Z" }, - { url = "https://files.pythonhosted.org/packages/e8/26/8f78ce17b7118149c17f238f28fba2a850b660b860f9b024a34d0191030f/multidict-6.6.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:630f70c32b8066ddfd920350bc236225814ad94dfa493fe1910ee17fe4365cbb", size = 251182, upload-time = "2025-08-11T12:08:26.511Z" }, - { url = "https://files.pythonhosted.org/packages/00/c3/a21466322d69f6594fe22d9379200f99194d21c12a5bbf8c2a39a46b83b6/multidict-6.6.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f8d4916a81697faec6cb724a273bd5457e4c6c43d82b29f9dc02c5542fd21fc9", size = 249371, upload-time = "2025-08-11T12:08:28.075Z" }, - { url = "https://files.pythonhosted.org/packages/c2/8e/2e673124eb05cf8dc82e9265eccde01a36bcbd3193e27799b8377123c976/multidict-6.6.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e42332cf8276bb7645d310cdecca93a16920256a5b01bebf747365f86a1675b", size = 239235, upload-time = "2025-08-11T12:08:29.937Z" }, - { url = "https://files.pythonhosted.org/packages/2b/2d/bdd9f05e7c89e30a4b0e4faf0681a30748f8d1310f68cfdc0e3571e75bd5/multidict-6.6.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f3be27440f7644ab9a13a6fc86f09cdd90b347c3c5e30c6d6d860de822d7cb53", size = 237410, upload-time = "2025-08-11T12:08:31.872Z" }, - { url = "https://files.pythonhosted.org/packages/46/4c/3237b83f8ca9a2673bb08fc340c15da005a80f5cc49748b587c8ae83823b/multidict-6.6.4-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:21f216669109e02ef3e2415ede07f4f8987f00de8cdfa0cc0b3440d42534f9f0", size = 232979, upload-time = "2025-08-11T12:08:33.399Z" }, - { url = "https://files.pythonhosted.org/packages/55/a6/a765decff625ae9bc581aed303cd1837955177dafc558859a69f56f56ba8/multidict-6.6.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:d9890d68c45d1aeac5178ded1d1cccf3bc8d7accf1f976f79bf63099fb16e4bd", size = 240979, upload-time = "2025-08-11T12:08:35.02Z" }, - { url = "https://files.pythonhosted.org/packages/6b/2d/9c75975cb0c66ea33cae1443bb265b2b3cd689bffcbc68872565f401da23/multidict-6.6.4-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:edfdcae97cdc5d1a89477c436b61f472c4d40971774ac4729c613b4b133163cb", size = 246849, upload-time = "2025-08-11T12:08:37.038Z" }, - { url = "https://files.pythonhosted.org/packages/3e/71/d21ac0843c1d8751fb5dcf8a1f436625d39d4577bc27829799d09b419af7/multidict-6.6.4-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0b2e886624be5773e69cf32bcb8534aecdeb38943520b240fed3d5596a430f2f", size = 241798, upload-time = "2025-08-11T12:08:38.669Z" }, - { url = "https://files.pythonhosted.org/packages/94/3d/1d8911e53092837bd11b1c99d71de3e2a9a26f8911f864554677663242aa/multidict-6.6.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:be5bf4b3224948032a845d12ab0f69f208293742df96dc14c4ff9b09e508fc17", size = 235315, upload-time = "2025-08-11T12:08:40.266Z" }, - { url = "https://files.pythonhosted.org/packages/86/c5/4b758df96376f73e936b1942c6c2dfc17e37ed9d5ff3b01a811496966ca0/multidict-6.6.4-cp39-cp39-win32.whl", hash = "sha256:10a68a9191f284fe9d501fef4efe93226e74df92ce7a24e301371293bd4918ae", size = 41434, upload-time = "2025-08-11T12:08:41.965Z" }, - { url = "https://files.pythonhosted.org/packages/58/16/f1dfa2a0f25f2717a5e9e5fe8fd30613f7fe95e3530cec8d11f5de0b709c/multidict-6.6.4-cp39-cp39-win_amd64.whl", hash = "sha256:ee25f82f53262f9ac93bd7e58e47ea1bdcc3393cef815847e397cba17e284210", size = 46186, upload-time = "2025-08-11T12:08:43.367Z" }, - { url = "https://files.pythonhosted.org/packages/88/7d/a0568bac65438c494cb6950b29f394d875a796a237536ac724879cf710c9/multidict-6.6.4-cp39-cp39-win_arm64.whl", hash = "sha256:f9867e55590e0855bcec60d4f9a092b69476db64573c9fe17e92b0c50614c16a", size = 43115, upload-time = "2025-08-11T12:08:45.126Z" }, { url = "https://files.pythonhosted.org/packages/fd/69/b547032297c7e63ba2af494edba695d781af8a0c6e89e4d06cf848b21d80/multidict-6.6.4-py3-none-any.whl", hash = "sha256:27d8f8e125c07cb954e54d75d04905a9bba8a439c1d84aca94949d4d03d8601c", size = 12313, upload-time = "2025-08-11T12:08:46.891Z" }, ] @@ -1475,11 +1320,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/1f/6b76be289a5a521bb1caedc1f08e76ff17ab59061007f201a8a18cc514d1/mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8", size = 12584043, upload-time = "2024-10-22T21:55:06.231Z" }, { url = "https://files.pythonhosted.org/packages/a6/83/5a85c9a5976c6f96e3a5a7591aa28b4a6ca3a07e9e5ba0cec090c8b596d6/mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7", size = 13036996, upload-time = "2024-10-22T21:55:25.811Z" }, { url = "https://files.pythonhosted.org/packages/b4/59/c39a6f752f1f893fccbcf1bdd2aca67c79c842402b5283563d006a67cf76/mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc", size = 9737709, upload-time = "2024-10-22T21:55:21.246Z" }, - { url = "https://files.pythonhosted.org/packages/5f/d4/b33ddd40dad230efb317898a2d1c267c04edba73bc5086bf77edeb410fb2/mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc", size = 11013906, upload-time = "2024-10-22T21:55:28.105Z" }, - { url = "https://files.pythonhosted.org/packages/f4/e6/f414bca465b44d01cd5f4a82761e15044bedd1bf8025c5af3cc64518fac5/mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732", size = 10180657, upload-time = "2024-10-22T21:55:03.931Z" }, - { url = "https://files.pythonhosted.org/packages/38/e9/fc3865e417722f98d58409770be01afb961e2c1f99930659ff4ae7ca8b7e/mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc", size = 12586394, upload-time = "2024-10-22T21:54:49.173Z" }, - { url = "https://files.pythonhosted.org/packages/2e/35/f4d8b6d2cb0b3dad63e96caf159419dda023f45a358c6c9ac582ccaee354/mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d", size = 13103591, upload-time = "2024-10-22T21:55:01.642Z" }, - { url = "https://files.pythonhosted.org/packages/22/1d/80594aef135f921dd52e142fa0acd19df197690bd0cde42cea7b88cf5aa2/mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24", size = 9634690, upload-time = "2024-10-22T21:54:28.814Z" }, { url = "https://files.pythonhosted.org/packages/3b/86/72ce7f57431d87a7ff17d442f521146a6585019eb8f4f31b7c02801f78ad/mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a", size = 2647043, upload-time = "2024-10-22T21:55:16.617Z" }, ] @@ -1492,24 +1332,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] -[[package]] -name = "networkx" -version = "3.2.1" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.10'", -] -sdist = { url = "https://files.pythonhosted.org/packages/c4/80/a84676339aaae2f1cfdf9f418701dd634aef9cc76f708ef55c36ff39c3ca/networkx-3.2.1.tar.gz", hash = "sha256:9f1bb5cf3409bf324e0a722c20bdb4c20ee39bf1c30ce8ae499c8502b0b5e0c6", size = 2073928, upload-time = "2023-10-28T08:41:39.364Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d5/f0/8fbc882ca80cf077f1b246c0e3c3465f7f415439bdea6b899f6b19f61f70/networkx-3.2.1-py3-none-any.whl", hash = "sha256:f18c69adc97877c42332c170849c96cefa91881c99a7cb3e95b7c659ebdc1ec2", size = 1647772, upload-time = "2023-10-28T08:41:36.945Z" }, -] - [[package]] name = "networkx" version = "3.4.2" source = { registry = "https://pypi.org/simple" } resolution-markers = [ - "python_full_version == '3.10.*'", + "python_full_version < '3.11'", ] sdist = { url = "https://files.pythonhosted.org/packages/fd/1d/06475e1cd5264c0b870ea2cc6fdb3e37177c1e565c43f56ff17a10e3937f/networkx-3.4.2.tar.gz", hash = "sha256:307c3669428c5362aab27c8a1260aa8f47c4e91d3891f48be0141738d8d053e1", size = 2151368, upload-time = "2024-10-21T12:39:38.695Z" } wheels = [ @@ -1552,7 +1380,7 @@ wheels = [ [[package]] name = "openapi-python-client" -version = "0.24.3" +version = "0.28.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, @@ -1565,11 +1393,10 @@ dependencies = [ { name = "ruff" }, { name = "shellingham" }, { name = "typer" }, - { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/93/1b/1eabe23bf58bdd1a8c67c490202230999403172e99ccdd75adb39931e103/openapi_python_client-0.24.3.tar.gz", hash = "sha256:472d6f4a55dea35e471b08879fc72c4823c1b693cb11ea09eaae742aa1ec170d", size = 124384, upload-time = "2025-03-31T22:44:28.373Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ff/6f/8267f10fd571c1473a32bfccb3a940494c1aa612878df662609612feaa20/openapi_python_client-0.28.1.tar.gz", hash = "sha256:f11afc63c33c0e0b19beff9a1424026f0738815063c2c8e773e1f71dc10d692c", size = 125947, upload-time = "2026-01-10T23:19:42.568Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c2/9a/943e90d88cbb303a1ceadffd058cec40dfbee75aa3bbf8e7fe982ec8575b/openapi_python_client-0.24.3-py3-none-any.whl", hash = "sha256:1a5580c05a3cb4e0e58101b4d05ce1680f9c51d41a68ce220611e848b80c2ba9", size = 180947, upload-time = "2025-03-31T22:44:26.359Z" }, + { url = "https://files.pythonhosted.org/packages/8c/e2/1cdfbc19c6917b1a878e5270a221904290113d0fce0df3599edd79d77906/openapi_python_client-0.28.1-py3-none-any.whl", hash = "sha256:9cf2f139f3c718f376f6a6981ed8ae37671f0fb2dd0f1d9504b2f583af1f82f9", size = 183195, upload-time = "2026-01-10T23:19:40.618Z" }, ] [[package]] @@ -1764,22 +1591,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/35/91/9cb56efbb428b006bb85db28591e40b7736847b8331d43fe335acf95f6c8/propcache-0.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4445542398bd0b5d32df908031cb1b30d43ac848e20470a878b770ec2dcc6330", size = 265778, upload-time = "2025-06-09T22:55:36.45Z" }, { url = "https://files.pythonhosted.org/packages/9a/4c/b0fe775a2bdd01e176b14b574be679d84fc83958335790f7c9a686c1f468/propcache-0.3.2-cp313-cp313t-win32.whl", hash = "sha256:f86e5d7cd03afb3a1db8e9f9f6eff15794e79e791350ac48a8c924e6f439f394", size = 41175, upload-time = "2025-06-09T22:55:38.436Z" }, { url = "https://files.pythonhosted.org/packages/a4/ff/47f08595e3d9b5e149c150f88d9714574f1a7cbd89fe2817158a952674bf/propcache-0.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:9704bedf6e7cbe3c65eca4379a9b53ee6a83749f047808cbb5044d40d7d72198", size = 44857, upload-time = "2025-06-09T22:55:39.687Z" }, - { url = "https://files.pythonhosted.org/packages/6c/39/8ea9bcfaaff16fd0b0fc901ee522e24c9ec44b4ca0229cfffb8066a06959/propcache-0.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a7fad897f14d92086d6b03fdd2eb844777b0c4d7ec5e3bac0fbae2ab0602bbe5", size = 74678, upload-time = "2025-06-09T22:55:41.227Z" }, - { url = "https://files.pythonhosted.org/packages/d3/85/cab84c86966e1d354cf90cdc4ba52f32f99a5bca92a1529d666d957d7686/propcache-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1f43837d4ca000243fd7fd6301947d7cb93360d03cd08369969450cc6b2ce3b4", size = 43829, upload-time = "2025-06-09T22:55:42.417Z" }, - { url = "https://files.pythonhosted.org/packages/23/f7/9cb719749152d8b26d63801b3220ce2d3931312b2744d2b3a088b0ee9947/propcache-0.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:261df2e9474a5949c46e962065d88eb9b96ce0f2bd30e9d3136bcde84befd8f2", size = 43729, upload-time = "2025-06-09T22:55:43.651Z" }, - { url = "https://files.pythonhosted.org/packages/a2/a2/0b2b5a210ff311260002a315f6f9531b65a36064dfb804655432b2f7d3e3/propcache-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e514326b79e51f0a177daab1052bc164d9d9e54133797a3a58d24c9c87a3fe6d", size = 204483, upload-time = "2025-06-09T22:55:45.327Z" }, - { url = "https://files.pythonhosted.org/packages/3f/e0/7aff5de0c535f783b0c8be5bdb750c305c1961d69fbb136939926e155d98/propcache-0.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d4a996adb6904f85894570301939afeee65f072b4fd265ed7e569e8d9058e4ec", size = 217425, upload-time = "2025-06-09T22:55:46.729Z" }, - { url = "https://files.pythonhosted.org/packages/92/1d/65fa889eb3b2a7d6e4ed3c2b568a9cb8817547a1450b572de7bf24872800/propcache-0.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76cace5d6b2a54e55b137669b30f31aa15977eeed390c7cbfb1dafa8dfe9a701", size = 214723, upload-time = "2025-06-09T22:55:48.342Z" }, - { url = "https://files.pythonhosted.org/packages/9a/e2/eecf6989870988dfd731de408a6fa366e853d361a06c2133b5878ce821ad/propcache-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31248e44b81d59d6addbb182c4720f90b44e1efdc19f58112a3c3a1615fb47ef", size = 200166, upload-time = "2025-06-09T22:55:49.775Z" }, - { url = "https://files.pythonhosted.org/packages/12/06/c32be4950967f18f77489268488c7cdc78cbfc65a8ba8101b15e526b83dc/propcache-0.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abb7fa19dbf88d3857363e0493b999b8011eea856b846305d8c0512dfdf8fbb1", size = 194004, upload-time = "2025-06-09T22:55:51.335Z" }, - { url = "https://files.pythonhosted.org/packages/46/6c/17b521a6b3b7cbe277a4064ff0aa9129dd8c89f425a5a9b6b4dd51cc3ff4/propcache-0.3.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d81ac3ae39d38588ad0549e321e6f773a4e7cc68e7751524a22885d5bbadf886", size = 203075, upload-time = "2025-06-09T22:55:52.681Z" }, - { url = "https://files.pythonhosted.org/packages/62/cb/3bdba2b736b3e45bc0e40f4370f745b3e711d439ffbffe3ae416393eece9/propcache-0.3.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:cc2782eb0f7a16462285b6f8394bbbd0e1ee5f928034e941ffc444012224171b", size = 195407, upload-time = "2025-06-09T22:55:54.048Z" }, - { url = "https://files.pythonhosted.org/packages/29/bd/760c5c6a60a4a2c55a421bc34a25ba3919d49dee411ddb9d1493bb51d46e/propcache-0.3.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:db429c19a6c7e8a1c320e6a13c99799450f411b02251fb1b75e6217cf4a14fcb", size = 196045, upload-time = "2025-06-09T22:55:55.485Z" }, - { url = "https://files.pythonhosted.org/packages/76/58/ced2757a46f55b8c84358d6ab8de4faf57cba831c51e823654da7144b13a/propcache-0.3.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:21d8759141a9e00a681d35a1f160892a36fb6caa715ba0b832f7747da48fb6ea", size = 208432, upload-time = "2025-06-09T22:55:56.884Z" }, - { url = "https://files.pythonhosted.org/packages/bb/ec/d98ea8d5a4d8fe0e372033f5254eddf3254344c0c5dc6c49ab84349e4733/propcache-0.3.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2ca6d378f09adb13837614ad2754fa8afaee330254f404299611bce41a8438cb", size = 210100, upload-time = "2025-06-09T22:55:58.498Z" }, - { url = "https://files.pythonhosted.org/packages/56/84/b6d8a7ecf3f62d7dd09d9d10bbf89fad6837970ef868b35b5ffa0d24d9de/propcache-0.3.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:34a624af06c048946709f4278b4176470073deda88d91342665d95f7c6270fbe", size = 200712, upload-time = "2025-06-09T22:55:59.906Z" }, - { url = "https://files.pythonhosted.org/packages/bf/32/889f4903ddfe4a9dc61da71ee58b763758cf2d608fe1decede06e6467f8d/propcache-0.3.2-cp39-cp39-win32.whl", hash = "sha256:4ba3fef1c30f306b1c274ce0b8baaa2c3cdd91f645c48f06394068f37d3837a1", size = 38187, upload-time = "2025-06-09T22:56:01.212Z" }, - { url = "https://files.pythonhosted.org/packages/67/74/d666795fb9ba1dc139d30de64f3b6fd1ff9c9d3d96ccfdb992cd715ce5d2/propcache-0.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:7a2368eed65fc69a7a7a40b27f22e85e7627b74216f0846b04ba5c116e191ec9", size = 42025, upload-time = "2025-06-09T22:56:02.875Z" }, { url = "https://files.pythonhosted.org/packages/cc/35/cc0aaecf278bb4575b8555f2b137de5ab821595ddae9da9d3cd1da4072c7/propcache-0.3.2-py3-none-any.whl", hash = "sha256:98f1ec44fb675f5052cccc8e609c46ed23a35a1cfd18545ad4e29002d858a43f", size = 12663, upload-time = "2025-06-09T22:56:04.484Z" }, ] @@ -1795,8 +1606,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/10/35/16d31e0f92c6d2f0e77c2a3ba93185130ea13053dd16200a57434c882f2b/protobuf-6.33.0-cp39-abi3-manylinux2014_aarch64.whl", hash = "sha256:e0697ece353e6239b90ee43a9231318302ad8353c70e6e45499fa52396debf90", size = 324445, upload-time = "2025-10-15T20:39:44.932Z" }, { url = "https://files.pythonhosted.org/packages/e6/eb/2a981a13e35cda8b75b5585aaffae2eb904f8f351bdd3870769692acbd8a/protobuf-6.33.0-cp39-abi3-manylinux2014_s390x.whl", hash = "sha256:e0a1715e4f27355afd9570f3ea369735afc853a6c3951a6afe1f80d8569ad298", size = 339159, upload-time = "2025-10-15T20:39:46.186Z" }, { url = "https://files.pythonhosted.org/packages/21/51/0b1cbad62074439b867b4e04cc09b93f6699d78fd191bed2bbb44562e077/protobuf-6.33.0-cp39-abi3-manylinux2014_x86_64.whl", hash = "sha256:35be49fd3f4fefa4e6e2aacc35e8b837d6703c37a2168a55ac21e9b1bc7559ef", size = 323172, upload-time = "2025-10-15T20:39:47.465Z" }, - { url = "https://files.pythonhosted.org/packages/57/33/fbe61bbe91a656619f107b9dfd84b16e1438766bd62157b8d1c1214491fd/protobuf-6.33.0-cp39-cp39-win32.whl", hash = "sha256:cd33a8e38ea3e39df66e1bbc462b076d6e5ba3a4ebbde58219d777223a7873d3", size = 425690, upload-time = "2025-10-15T20:39:48.909Z" }, - { url = "https://files.pythonhosted.org/packages/2c/e4/ccc4814ad9d12fa404f7e5ce1983a2403644b0ed2588678c762b7a26ed92/protobuf-6.33.0-cp39-cp39-win_amd64.whl", hash = "sha256:c963e86c3655af3a917962c9619e1a6b9670540351d7af9439d06064e3317cc9", size = 436876, upload-time = "2025-10-15T20:39:50.009Z" }, { url = "https://files.pythonhosted.org/packages/07/d1/0a28c21707807c6aacd5dc9c3704b2aa1effbf37adebd8caeaf68b17a636/protobuf-6.33.0-py3-none-any.whl", hash = "sha256:25c9e1963c6734448ea2d308cfa610e692b801304ba0908d7bfa564ac5132995", size = 170477, upload-time = "2025-10-15T20:39:51.311Z" }, ] @@ -1840,13 +1649,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3a/d4/b4a3aa781a2c715520aa8ab4fe2e7fa49d33a1d4e71c8fc6ab7b5de7a3f8/pyarrow-19.0.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a9137cf7e1640dce4c190551ee69d478f7121b5c6f323553b319cac936395f6", size = 42171896, upload-time = "2025-02-18T18:54:49.808Z" }, { url = "https://files.pythonhosted.org/packages/23/1b/716d4cd5a3cbc387c6e6745d2704c4b46654ba2668260d25c402626c5ddb/pyarrow-19.0.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:7c1bca1897c28013db5e4c83944a2ab53231f541b9e0c3f4791206d0c0de389a", size = 40464851, upload-time = "2025-02-18T18:54:57.073Z" }, { url = "https://files.pythonhosted.org/packages/ed/bd/54907846383dcc7ee28772d7e646f6c34276a17da740002a5cefe90f04f7/pyarrow-19.0.1-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:58d9397b2e273ef76264b45531e9d552d8ec8a6688b7390b5be44c02a37aade8", size = 42085744, upload-time = "2025-02-18T18:55:08.562Z" }, - { url = "https://files.pythonhosted.org/packages/16/26/0ec396ebe98adefaffc0fff8e0dc14c8912e61093226284cf4b76faffd22/pyarrow-19.0.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:b9766a47a9cb56fefe95cb27f535038b5a195707a08bf61b180e642324963b46", size = 30701112, upload-time = "2025-02-18T18:55:15.112Z" }, - { url = "https://files.pythonhosted.org/packages/ba/10/c35d96686bf7f13e55bb87f06fe06e7d95533c271ef7f9a5a76e26b16fc2/pyarrow-19.0.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:6c5941c1aac89a6c2f2b16cd64fe76bcdb94b2b1e99ca6459de4e6f07638d755", size = 32117180, upload-time = "2025-02-18T18:55:20.073Z" }, - { url = "https://files.pythonhosted.org/packages/8c/0d/81881a55302b6847ea2ea187517faa039c219d80b55050904e354c2eddde/pyarrow-19.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd44d66093a239358d07c42a91eebf5015aa54fccba959db899f932218ac9cc8", size = 41161334, upload-time = "2025-02-18T18:55:26.155Z" }, - { url = "https://files.pythonhosted.org/packages/af/17/ea60a07ec6f6bb0740f11715e0d22ab8fdfcc94bc729832321f498370d75/pyarrow-19.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:335d170e050bcc7da867a1ed8ffb8b44c57aaa6e0843b156a501298657b1e972", size = 42190375, upload-time = "2025-02-18T18:55:34.216Z" }, - { url = "https://files.pythonhosted.org/packages/f2/87/4ef05a088b18082cde4950bdfca752dd31effb3ec201b8026e4816d0f3fa/pyarrow-19.0.1-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:1c7556165bd38cf0cd992df2636f8bcdd2d4b26916c6b7e646101aff3c16f76f", size = 40530649, upload-time = "2025-02-18T18:55:41.864Z" }, - { url = "https://files.pythonhosted.org/packages/59/1e/9fb9a66a64eae4ff332a8f149d803d8c6c556714803d20d54ed2e9524a3b/pyarrow-19.0.1-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:699799f9c80bebcf1da0983ba86d7f289c5a2a5c04b945e2f2bcf7e874a91911", size = 42081576, upload-time = "2025-02-18T18:55:48.912Z" }, - { url = "https://files.pythonhosted.org/packages/1b/ee/c110d8da8bdde8e832ccf1ff90be747cb684874e2dc8acf26840058b0c32/pyarrow-19.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:8464c9fbe6d94a7fe1599e7e8965f350fd233532868232ab2596a71586c5a429", size = 25465593, upload-time = "2025-02-18T18:55:54.191Z" }, ] [[package]] @@ -1931,19 +1733,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, - { url = "https://files.pythonhosted.org/packages/53/ea/bbe9095cdd771987d13c82d104a9c8559ae9aec1e29f139e286fd2e9256e/pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d", size = 2028677, upload-time = "2025-04-23T18:32:27.227Z" }, - { url = "https://files.pythonhosted.org/packages/49/1d/4ac5ed228078737d457a609013e8f7edc64adc37b91d619ea965758369e5/pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954", size = 1864735, upload-time = "2025-04-23T18:32:29.019Z" }, - { url = "https://files.pythonhosted.org/packages/23/9a/2e70d6388d7cda488ae38f57bc2f7b03ee442fbcf0d75d848304ac7e405b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb", size = 1898467, upload-time = "2025-04-23T18:32:31.119Z" }, - { url = "https://files.pythonhosted.org/packages/ff/2e/1568934feb43370c1ffb78a77f0baaa5a8b6897513e7a91051af707ffdc4/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7", size = 1983041, upload-time = "2025-04-23T18:32:33.655Z" }, - { url = "https://files.pythonhosted.org/packages/01/1a/1a1118f38ab64eac2f6269eb8c120ab915be30e387bb561e3af904b12499/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4", size = 2136503, upload-time = "2025-04-23T18:32:35.519Z" }, - { url = "https://files.pythonhosted.org/packages/5c/da/44754d1d7ae0f22d6d3ce6c6b1486fc07ac2c524ed8f6eca636e2e1ee49b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b", size = 2736079, upload-time = "2025-04-23T18:32:37.659Z" }, - { url = "https://files.pythonhosted.org/packages/4d/98/f43cd89172220ec5aa86654967b22d862146bc4d736b1350b4c41e7c9c03/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3", size = 2006508, upload-time = "2025-04-23T18:32:39.637Z" }, - { url = "https://files.pythonhosted.org/packages/2b/cc/f77e8e242171d2158309f830f7d5d07e0531b756106f36bc18712dc439df/pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a", size = 2113693, upload-time = "2025-04-23T18:32:41.818Z" }, - { url = "https://files.pythonhosted.org/packages/54/7a/7be6a7bd43e0a47c147ba7fbf124fe8aaf1200bc587da925509641113b2d/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782", size = 2074224, upload-time = "2025-04-23T18:32:44.033Z" }, - { url = "https://files.pythonhosted.org/packages/2a/07/31cf8fadffbb03be1cb520850e00a8490c0927ec456e8293cafda0726184/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9", size = 2245403, upload-time = "2025-04-23T18:32:45.836Z" }, - { url = "https://files.pythonhosted.org/packages/b6/8d/bbaf4c6721b668d44f01861f297eb01c9b35f612f6b8e14173cb204e6240/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e", size = 2242331, upload-time = "2025-04-23T18:32:47.618Z" }, - { url = "https://files.pythonhosted.org/packages/bb/93/3cc157026bca8f5006250e74515119fcaa6d6858aceee8f67ab6dc548c16/pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9", size = 1910571, upload-time = "2025-04-23T18:32:49.401Z" }, - { url = "https://files.pythonhosted.org/packages/5b/90/7edc3b2a0d9f0dda8806c04e511a67b0b7a41d2187e2003673a996fb4310/pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3", size = 1956504, upload-time = "2025-04-23T18:32:51.287Z" }, { url = "https://files.pythonhosted.org/packages/30/68/373d55e58b7e83ce371691f6eaa7175e3a24b956c44628eb25d7da007917/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", size = 2023982, upload-time = "2025-04-23T18:32:53.14Z" }, { url = "https://files.pythonhosted.org/packages/a4/16/145f54ac08c96a63d8ed6442f9dec17b2773d19920b627b18d4f10a061ea/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", size = 1858412, upload-time = "2025-04-23T18:32:55.52Z" }, { url = "https://files.pythonhosted.org/packages/41/b1/c6dc6c3e2de4516c0bb2c46f6a373b91b5660312342a0cf5826e38ad82fa/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", size = 1892749, upload-time = "2025-04-23T18:32:57.546Z" }, @@ -1962,15 +1751,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b8/e9/1f7efbe20d0b2b10f6718944b5d8ece9152390904f29a78e68d4e7961159/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", size = 2239013, upload-time = "2025-04-23T18:33:26.621Z" }, { url = "https://files.pythonhosted.org/packages/3c/b2/5309c905a93811524a49b4e031e9851a6b00ff0fb668794472ea7746b448/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", size = 2238715, upload-time = "2025-04-23T18:33:28.656Z" }, { url = "https://files.pythonhosted.org/packages/32/56/8a7ca5d2cd2cda1d245d34b1c9a942920a718082ae8e54e5f3e5a58b7add/pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", size = 2066757, upload-time = "2025-04-23T18:33:30.645Z" }, - { url = "https://files.pythonhosted.org/packages/08/98/dbf3fdfabaf81cda5622154fda78ea9965ac467e3239078e0dcd6df159e7/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101", size = 2024034, upload-time = "2025-04-23T18:33:32.843Z" }, - { url = "https://files.pythonhosted.org/packages/8d/99/7810aa9256e7f2ccd492590f86b79d370df1e9292f1f80b000b6a75bd2fb/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64", size = 1858578, upload-time = "2025-04-23T18:33:34.912Z" }, - { url = "https://files.pythonhosted.org/packages/d8/60/bc06fa9027c7006cc6dd21e48dbf39076dc39d9abbaf718a1604973a9670/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d", size = 1892858, upload-time = "2025-04-23T18:33:36.933Z" }, - { url = "https://files.pythonhosted.org/packages/f2/40/9d03997d9518816c68b4dfccb88969756b9146031b61cd37f781c74c9b6a/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535", size = 2068498, upload-time = "2025-04-23T18:33:38.997Z" }, - { url = "https://files.pythonhosted.org/packages/d8/62/d490198d05d2d86672dc269f52579cad7261ced64c2df213d5c16e0aecb1/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d", size = 2108428, upload-time = "2025-04-23T18:33:41.18Z" }, - { url = "https://files.pythonhosted.org/packages/9a/ec/4cd215534fd10b8549015f12ea650a1a973da20ce46430b68fc3185573e8/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6", size = 2069854, upload-time = "2025-04-23T18:33:43.446Z" }, - { url = "https://files.pythonhosted.org/packages/1a/1a/abbd63d47e1d9b0d632fee6bb15785d0889c8a6e0a6c3b5a8e28ac1ec5d2/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca", size = 2237859, upload-time = "2025-04-23T18:33:45.56Z" }, - { url = "https://files.pythonhosted.org/packages/80/1c/fa883643429908b1c90598fd2642af8839efd1d835b65af1f75fba4d94fe/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039", size = 2239059, upload-time = "2025-04-23T18:33:47.735Z" }, - { url = "https://files.pythonhosted.org/packages/d4/29/3cade8a924a61f60ccfa10842f75eb12787e1440e2b8660ceffeb26685e7/pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27", size = 2066661, upload-time = "2025-04-23T18:33:49.995Z" }, ] [[package]] @@ -1978,9 +1758,9 @@ name = "pydantic-settings" version = "2.10.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pydantic", marker = "python_full_version >= '3.10'" }, - { name = "python-dotenv", marker = "python_full_version >= '3.10'" }, - { name = "typing-inspection", marker = "python_full_version >= '3.10'" }, + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, ] sdist = { url = "https://files.pythonhosted.org/packages/68/85/1ea668bbab3c50071ca613c6ab30047fb36ab0da1b92fa8f17bbc38fd36c/pydantic_settings-2.10.1.tar.gz", hash = "sha256:06f0062169818d0f5524420a360d632d5857b83cffd4d42fe29597807a1614ee", size = 172583, upload-time = "2025-06-24T13:26:46.841Z" } wheels = [ @@ -2002,8 +1782,7 @@ version = "0.9.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cachetools" }, - { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "click" }, { name = "fsspec" }, { name = "mmh3" }, { name = "pydantic" }, @@ -2031,19 +1810,10 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7f/cf/178a9f63fac1bfdd13bc85169e7ab903955d082e2cd80507b1921a6f64dc/pyiceberg-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e4e585164d7d86f5c9a609a1bc2abeae2f0ea0680a11a2064d3a945866b5311", size = 1277399, upload-time = "2025-04-30T14:59:10.193Z" }, { url = "https://files.pythonhosted.org/packages/d1/6b/78d1739eb1d5b18529ee438aed75dac3e0b246f5e4d800931f9d1e37cda2/pyiceberg-0.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5fee08dac30e8524526f7d18468f9670f8606905b850b261314c597c6633f3b4", size = 1269083, upload-time = "2025-04-30T14:59:11.964Z" }, { url = "https://files.pythonhosted.org/packages/67/69/c0087d19c8d8e8530acee3ba485d54aedeebf2963784a16692ca4b439566/pyiceberg-0.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:124793c54a0c2fb5ac4ab19c38da116c068e277c85cbaa7e4064e635a70b595e", size = 595512, upload-time = "2025-04-30T14:59:14.464Z" }, - { url = "https://files.pythonhosted.org/packages/08/12/8d46a700af1a2a9cb41d612115303d462a71646edd0f196ec961b09e9dba/pyiceberg-0.9.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a6e29eb5ce63e8a14738f3efeb54022093456e02b681f0b8c815f7ef9e20ddcb", size = 488285, upload-time = "2025-04-30T14:59:15.823Z" }, - { url = "https://files.pythonhosted.org/packages/35/47/35b0e1466b79d8a98881c1e5bd02b75a6611d27f8202dcbcc3bbcccd71fc/pyiceberg-0.9.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ebd4f74da8a3f7b78ad746c1d91d8cd9aa9cf97f4d36da164e3550f6a06b00e", size = 486373, upload-time = "2025-04-30T14:59:17.297Z" }, - { url = "https://files.pythonhosted.org/packages/97/cf/a55aedec089b521445b6bb18f703e3e8f666f22c7b81db0b8668b6727ed6/pyiceberg-0.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b357638a58d9b0a5d7018fbe88fa84469c980c80d86441b7b9cd99871512447d", size = 645018, upload-time = "2025-04-30T14:59:18.41Z" }, - { url = "https://files.pythonhosted.org/packages/fc/b1/32f25ea1905c0e7581d68d30e5a0b69182f9cab0acd3e8a9d1648429a39e/pyiceberg-0.9.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f8a93c1e4ab35195018ce8fbbb6d973e099194ffe06d859bdf069d7b846da7aa", size = 644838, upload-time = "2025-04-30T14:59:19.515Z" }, - { url = "https://files.pythonhosted.org/packages/40/0f/d3ade290baddef6cfa31430e131bb36f3e34a8ec2d3bc5caf107e58dbbda/pyiceberg-0.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:5c1b3598d521476ffce13949ae762a3dec49287198b26de445caa0daf2e395fa", size = 487809, upload-time = "2025-04-30T14:59:20.61Z" }, { url = "https://files.pythonhosted.org/packages/aa/62/0153ed3a39d6f4b3235d430123703d4684eec7ba780404bbc118ace7406a/pyiceberg-0.9.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:77aec1c77d675603e0c5358e74adcae8d13b323753d702011be3f309d26af355", size = 668261, upload-time = "2025-04-30T14:59:21.751Z" }, { url = "https://files.pythonhosted.org/packages/24/bd/c4cec142686dd8124032c69b6b02ba3703abc114ce787d0f02088b1f43d8/pyiceberg-0.9.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:cf567438bf6267bbb67fdfdfc72ac500d523725fca9a6a38f93e8acd4146190e", size = 657439, upload-time = "2025-04-30T14:59:23.304Z" }, { url = "https://files.pythonhosted.org/packages/ae/74/bbfc70bb1857f9d55d06fee1330a0236876b8ae4aa6fc5d815e2c4fef4f7/pyiceberg-0.9.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5992db7c00d789a33ff117700d453126803e769507a5edeb79bb6510ff72fc00", size = 1352983, upload-time = "2025-04-30T14:59:25.023Z" }, { url = "https://files.pythonhosted.org/packages/90/20/e33e1716d1368b2471b80d9f1e338110f1e781b34ebffc5e320523102ffc/pyiceberg-0.9.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c9e460fca26162a3822c0e8d50b49c80928a0e35cb41698748d7a26f8c016215", size = 657563, upload-time = "2025-04-30T14:59:27.004Z" }, - { url = "https://files.pythonhosted.org/packages/c9/37/9d531ce880a5ccd458a408b0b8d65305201822166d6cabdb6daa5a1f1f6f/pyiceberg-0.9.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:037aa7a8bfaf7f1482e6a3532217b5f4281bc81db6698c3ea87771d0453a8232", size = 637004, upload-time = "2025-04-30T14:59:28.948Z" }, - { url = "https://files.pythonhosted.org/packages/eb/fd/d370f11fcb8da9c4146356dd635ef6a6615372f1e202e37cb4a9e47fafd5/pyiceberg-0.9.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:5150464428a0568c4f46405884bc777dde37935580fb72b0030dfa28805d82e7", size = 627370, upload-time = "2025-04-30T14:59:30.559Z" }, - { url = "https://files.pythonhosted.org/packages/af/66/843ce33ab3dbcce71fa8dec4368f930c4349d0c403990087a2ae996d387e/pyiceberg-0.9.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af2a6c273cfaf2b21b319fcf79489f87604220a0497942303b2a715a9d0f29e9", size = 1315204, upload-time = "2025-04-30T14:59:31.959Z" }, - { url = "https://files.pythonhosted.org/packages/1c/56/f0c7014cd16bd9990bdfa9b901fe6ecc344d6b9775676dc35c48b3a6aca1/pyiceberg-0.9.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:023c3fcee36a441b7e20418b6e9cdc6f904141bfda09f8580dfe022d7faa7a53", size = 626539, upload-time = "2025-04-30T14:59:33.17Z" }, ] [package.optional-dependencies] @@ -2183,9 +1953,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" }, { url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" }, { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" }, - { url = "https://files.pythonhosted.org/packages/59/42/b86689aac0cdaee7ae1c58d464b0ff04ca909c19bb6502d4973cdd9f9544/pywin32-311-cp39-cp39-win32.whl", hash = "sha256:aba8f82d551a942cb20d4a83413ccbac30790b50efb89a75e4f586ac0bb8056b", size = 8760837, upload-time = "2025-07-14T20:12:59.59Z" }, - { url = "https://files.pythonhosted.org/packages/9f/8a/1403d0353f8c5a2f0829d2b1c4becbf9da2f0a4d040886404fc4a5431e4d/pywin32-311-cp39-cp39-win_amd64.whl", hash = "sha256:e0c4cfb0621281fe40387df582097fd796e80430597cb9944f0ae70447bacd91", size = 9590187, upload-time = "2025-07-14T20:13:01.419Z" }, - { url = "https://files.pythonhosted.org/packages/60/22/e0e8d802f124772cec9c75430b01a212f86f9de7546bda715e54140d5aeb/pywin32-311-cp39-cp39-win_arm64.whl", hash = "sha256:62ea666235135fee79bb154e695f3ff67370afefd71bd7fea7512fc70ef31e3d", size = 8778162, upload-time = "2025-07-14T20:13:03.544Z" }, ] [[package]] @@ -2230,15 +1997,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597, upload-time = "2024-08-06T20:32:56.985Z" }, { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527, upload-time = "2024-08-06T20:33:03.001Z" }, { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446, upload-time = "2024-08-06T20:33:04.33Z" }, - { url = "https://files.pythonhosted.org/packages/65/d8/b7a1db13636d7fb7d4ff431593c510c8b8fca920ade06ca8ef20015493c5/PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d", size = 184777, upload-time = "2024-08-06T20:33:25.896Z" }, - { url = "https://files.pythonhosted.org/packages/0a/02/6ec546cd45143fdf9840b2c6be8d875116a64076218b61d68e12548e5839/PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f", size = 172318, upload-time = "2024-08-06T20:33:27.212Z" }, - { url = "https://files.pythonhosted.org/packages/0e/9a/8cc68be846c972bda34f6c2a93abb644fb2476f4dcc924d52175786932c9/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290", size = 720891, upload-time = "2024-08-06T20:33:28.974Z" }, - { url = "https://files.pythonhosted.org/packages/e9/6c/6e1b7f40181bc4805e2e07f4abc10a88ce4648e7e95ff1abe4ae4014a9b2/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12", size = 722614, upload-time = "2024-08-06T20:33:34.157Z" }, - { url = "https://files.pythonhosted.org/packages/3d/32/e7bd8535d22ea2874cef6a81021ba019474ace0d13a4819c2a4bce79bd6a/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19", size = 737360, upload-time = "2024-08-06T20:33:35.84Z" }, - { url = "https://files.pythonhosted.org/packages/d7/12/7322c1e30b9be969670b672573d45479edef72c9a0deac3bb2868f5d7469/PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e", size = 699006, upload-time = "2024-08-06T20:33:37.501Z" }, - { url = "https://files.pythonhosted.org/packages/82/72/04fcad41ca56491995076630c3ec1e834be241664c0c09a64c9a2589b507/PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725", size = 723577, upload-time = "2024-08-06T20:33:39.389Z" }, - { url = "https://files.pythonhosted.org/packages/ed/5e/46168b1f2757f1fcd442bc3029cd8767d88a98c9c05770d8b420948743bb/PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631", size = 144593, upload-time = "2024-08-06T20:33:46.63Z" }, - { url = "https://files.pythonhosted.org/packages/19/87/5124b1c1f2412bb95c59ec481eaf936cd32f0fe2a7b16b97b81c4c017a6a/PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8", size = 162312, upload-time = "2024-08-06T20:33:49.073Z" }, ] [[package]] @@ -2275,8 +2033,7 @@ name = "rich" version = "13.9.4" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "markdown-it-py" }, { name = "pygments" }, { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] @@ -2393,20 +2150,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/dd/10/6b283707780a81919f71625351182b4f98932ac89a09023cb61865136244/rpds_py-0.27.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f39f58a27cc6e59f432b568ed8429c7e1641324fbe38131de852cd77b2d534b0", size = 555813, upload-time = "2025-08-27T12:15:00.334Z" }, { url = "https://files.pythonhosted.org/packages/04/2e/30b5ea18c01379da6272a92825dd7e53dc9d15c88a19e97932d35d430ef7/rpds_py-0.27.1-cp314-cp314t-win32.whl", hash = "sha256:d5fa0ee122dc09e23607a28e6d7b150da16c662e66409bbe85230e4c85bb528a", size = 217385, upload-time = "2025-08-27T12:15:01.937Z" }, { url = "https://files.pythonhosted.org/packages/32/7d/97119da51cb1dd3f2f3c0805f155a3aa4a95fa44fe7d78ae15e69edf4f34/rpds_py-0.27.1-cp314-cp314t-win_amd64.whl", hash = "sha256:6567d2bb951e21232c2f660c24cf3470bb96de56cdcb3f071a83feeaff8a2772", size = 230097, upload-time = "2025-08-27T12:15:03.961Z" }, - { url = "https://files.pythonhosted.org/packages/7f/6c/252e83e1ce7583c81f26d1d884b2074d40a13977e1b6c9c50bbf9a7f1f5a/rpds_py-0.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c918c65ec2e42c2a78d19f18c553d77319119bf43aa9e2edf7fb78d624355527", size = 372140, upload-time = "2025-08-27T12:15:05.441Z" }, - { url = "https://files.pythonhosted.org/packages/9d/71/949c195d927c5aeb0d0629d329a20de43a64c423a6aa53836290609ef7ec/rpds_py-0.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1fea2b1a922c47c51fd07d656324531adc787e415c8b116530a1d29c0516c62d", size = 354086, upload-time = "2025-08-27T12:15:07.404Z" }, - { url = "https://files.pythonhosted.org/packages/9f/02/e43e332ad8ce4f6c4342d151a471a7f2900ed1d76901da62eb3762663a71/rpds_py-0.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbf94c58e8e0cd6b6f38d8de67acae41b3a515c26169366ab58bdca4a6883bb8", size = 382117, upload-time = "2025-08-27T12:15:09.275Z" }, - { url = "https://files.pythonhosted.org/packages/d0/05/b0fdeb5b577197ad72812bbdfb72f9a08fa1e64539cc3940b1b781cd3596/rpds_py-0.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c2a8fed130ce946d5c585eddc7c8eeef0051f58ac80a8ee43bd17835c144c2cc", size = 394520, upload-time = "2025-08-27T12:15:10.727Z" }, - { url = "https://files.pythonhosted.org/packages/67/1f/4cfef98b2349a7585181e99294fa2a13f0af06902048a5d70f431a66d0b9/rpds_py-0.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:037a2361db72ee98d829bc2c5b7cc55598ae0a5e0ec1823a56ea99374cfd73c1", size = 522657, upload-time = "2025-08-27T12:15:12.613Z" }, - { url = "https://files.pythonhosted.org/packages/44/55/ccf37ddc4c6dce7437b335088b5ca18da864b334890e2fe9aa6ddc3f79a9/rpds_py-0.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5281ed1cc1d49882f9997981c88df1a22e140ab41df19071222f7e5fc4e72125", size = 402967, upload-time = "2025-08-27T12:15:14.113Z" }, - { url = "https://files.pythonhosted.org/packages/74/e5/5903f92e41e293b07707d5bf00ef39a0eb2af7190aff4beaf581a6591510/rpds_py-0.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fd50659a069c15eef8aa3d64bbef0d69fd27bb4a50c9ab4f17f83a16cbf8905", size = 384372, upload-time = "2025-08-27T12:15:15.842Z" }, - { url = "https://files.pythonhosted.org/packages/8f/e3/fbb409e18aeefc01e49f5922ac63d2d914328430e295c12183ce56ebf76b/rpds_py-0.27.1-cp39-cp39-manylinux_2_31_riscv64.whl", hash = "sha256:c4b676c4ae3921649a15d28ed10025548e9b561ded473aa413af749503c6737e", size = 401264, upload-time = "2025-08-27T12:15:17.388Z" }, - { url = "https://files.pythonhosted.org/packages/55/79/529ad07794e05cb0f38e2f965fc5bb20853d523976719400acecc447ec9d/rpds_py-0.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:079bc583a26db831a985c5257797b2b5d3affb0386e7ff886256762f82113b5e", size = 418691, upload-time = "2025-08-27T12:15:19.144Z" }, - { url = "https://files.pythonhosted.org/packages/33/39/6554a7fd6d9906fda2521c6d52f5d723dca123529fb719a5b5e074c15e01/rpds_py-0.27.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4e44099bd522cba71a2c6b97f68e19f40e7d85399de899d66cdb67b32d7cb786", size = 558989, upload-time = "2025-08-27T12:15:21.087Z" }, - { url = "https://files.pythonhosted.org/packages/19/b2/76fa15173b6f9f445e5ef15120871b945fb8dd9044b6b8c7abe87e938416/rpds_py-0.27.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e202e6d4188e53c6661af813b46c37ca2c45e497fc558bacc1a7630ec2695aec", size = 589835, upload-time = "2025-08-27T12:15:22.696Z" }, - { url = "https://files.pythonhosted.org/packages/ee/9e/5560a4b39bab780405bed8a88ee85b30178061d189558a86003548dea045/rpds_py-0.27.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f41f814b8eaa48768d1bb551591f6ba45f87ac76899453e8ccd41dba1289b04b", size = 555227, upload-time = "2025-08-27T12:15:24.278Z" }, - { url = "https://files.pythonhosted.org/packages/52/d7/cd9c36215111aa65724c132bf709c6f35175973e90b32115dedc4ced09cb/rpds_py-0.27.1-cp39-cp39-win32.whl", hash = "sha256:9e71f5a087ead99563c11fdaceee83ee982fd39cf67601f4fd66cb386336ee52", size = 217899, upload-time = "2025-08-27T12:15:25.926Z" }, - { url = "https://files.pythonhosted.org/packages/5b/e0/d75ab7b4dd8ba777f6b365adbdfc7614bbfe7c5f05703031dfa4b61c3d6c/rpds_py-0.27.1-cp39-cp39-win_amd64.whl", hash = "sha256:71108900c9c3c8590697244b9519017a400d9ba26a36c48381b3f64743a44aab", size = 228725, upload-time = "2025-08-27T12:15:27.398Z" }, { url = "https://files.pythonhosted.org/packages/d5/63/b7cc415c345625d5e62f694ea356c58fb964861409008118f1245f8c3347/rpds_py-0.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7ba22cb9693df986033b91ae1d7a979bc399237d45fccf875b76f62bb9e52ddf", size = 371360, upload-time = "2025-08-27T12:15:29.218Z" }, { url = "https://files.pythonhosted.org/packages/e5/8c/12e1b24b560cf378b8ffbdb9dc73abd529e1adcfcf82727dfd29c4a7b88d/rpds_py-0.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5b640501be9288c77738b5492b3fd3abc4ba95c50c2e41273c8a1459f08298d3", size = 353933, upload-time = "2025-08-27T12:15:30.837Z" }, { url = "https://files.pythonhosted.org/packages/9b/85/1bb2210c1f7a1b99e91fea486b9f0f894aa5da3a5ec7097cbad7dec6d40f/rpds_py-0.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb08b65b93e0c6dd70aac7f7890a9c0938d5ec71d5cb32d45cf844fb8ae47636", size = 382962, upload-time = "2025-08-27T12:15:32.348Z" }, @@ -2432,19 +2175,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6a/24/e3e72d265121e00b063aef3e3501e5b2473cf1b23511d56e529531acf01e/rpds_py-0.27.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:94c44ee01fd21c9058f124d2d4f0c9dc7634bec93cd4b38eefc385dabe71acbf", size = 560003, upload-time = "2025-08-27T12:16:08.06Z" }, { url = "https://files.pythonhosted.org/packages/26/ca/f5a344c534214cc2d41118c0699fffbdc2c1bc7046f2a2b9609765ab9c92/rpds_py-0.27.1-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:df8b74962e35c9249425d90144e721eed198e6555a0e22a563d29fe4486b51f6", size = 590482, upload-time = "2025-08-27T12:16:10.137Z" }, { url = "https://files.pythonhosted.org/packages/ce/08/4349bdd5c64d9d193c360aa9db89adeee6f6682ab8825dca0a3f535f434f/rpds_py-0.27.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:dc23e6820e3b40847e2f4a7726462ba0cf53089512abe9ee16318c366494c17a", size = 556523, upload-time = "2025-08-27T12:16:12.188Z" }, - { url = "https://files.pythonhosted.org/packages/4e/ea/5463cd5048a7a2fcdae308b6e96432802132c141bfb9420260142632a0f1/rpds_py-0.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:aa8933159edc50be265ed22b401125c9eebff3171f570258854dbce3ecd55475", size = 371778, upload-time = "2025-08-27T12:16:13.851Z" }, - { url = "https://files.pythonhosted.org/packages/0d/c8/f38c099db07f5114029c1467649d308543906933eebbc226d4527a5f4693/rpds_py-0.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a50431bf02583e21bf273c71b89d710e7a710ad5e39c725b14e685610555926f", size = 354394, upload-time = "2025-08-27T12:16:15.609Z" }, - { url = "https://files.pythonhosted.org/packages/7d/79/b76f97704d9dd8ddbd76fed4c4048153a847c5d6003afe20a6b5c3339065/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78af06ddc7fe5cc0e967085a9115accee665fb912c22a3f54bad70cc65b05fe6", size = 382348, upload-time = "2025-08-27T12:16:17.251Z" }, - { url = "https://files.pythonhosted.org/packages/8a/3f/ef23d3c1be1b837b648a3016d5bbe7cfe711422ad110b4081c0a90ef5a53/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:70d0738ef8fee13c003b100c2fbd667ec4f133468109b3472d249231108283a3", size = 394159, upload-time = "2025-08-27T12:16:19.251Z" }, - { url = "https://files.pythonhosted.org/packages/74/8a/9e62693af1a34fd28b1a190d463d12407bd7cf561748cb4745845d9548d3/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2f6fd8a1cea5bbe599b6e78a6e5ee08db434fc8ffea51ff201c8765679698b3", size = 522775, upload-time = "2025-08-27T12:16:20.929Z" }, - { url = "https://files.pythonhosted.org/packages/36/0d/8d5bb122bf7a60976b54c5c99a739a3819f49f02d69df3ea2ca2aff47d5c/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8177002868d1426305bb5de1e138161c2ec9eb2d939be38291d7c431c4712df8", size = 402633, upload-time = "2025-08-27T12:16:22.548Z" }, - { url = "https://files.pythonhosted.org/packages/0f/0e/237948c1f425e23e0cf5a566d702652a6e55c6f8fbd332a1792eb7043daf/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:008b839781d6c9bf3b6a8984d1d8e56f0ec46dc56df61fd669c49b58ae800400", size = 384867, upload-time = "2025-08-27T12:16:24.29Z" }, - { url = "https://files.pythonhosted.org/packages/d6/0a/da0813efcd998d260cbe876d97f55b0f469ada8ba9cbc47490a132554540/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:a55b9132bb1ade6c734ddd2759c8dc132aa63687d259e725221f106b83a0e485", size = 401791, upload-time = "2025-08-27T12:16:25.954Z" }, - { url = "https://files.pythonhosted.org/packages/51/78/c6c9e8a8aaca416a6f0d1b6b4a6ee35b88fe2c5401d02235d0a056eceed2/rpds_py-0.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a46fdec0083a26415f11d5f236b79fa1291c32aaa4a17684d82f7017a1f818b1", size = 419525, upload-time = "2025-08-27T12:16:27.659Z" }, - { url = "https://files.pythonhosted.org/packages/a3/69/5af37e1d71487cf6d56dd1420dc7e0c2732c1b6ff612aa7a88374061c0a8/rpds_py-0.27.1-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:8a63b640a7845f2bdd232eb0d0a4a2dd939bcdd6c57e6bb134526487f3160ec5", size = 559255, upload-time = "2025-08-27T12:16:29.343Z" }, - { url = "https://files.pythonhosted.org/packages/40/7f/8b7b136069ef7ac3960eda25d832639bdb163018a34c960ed042dd1707c8/rpds_py-0.27.1-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:7e32721e5d4922deaaf963469d795d5bde6093207c52fec719bd22e5d1bedbc4", size = 590384, upload-time = "2025-08-27T12:16:31.005Z" }, - { url = "https://files.pythonhosted.org/packages/d8/06/c316d3f6ff03f43ccb0eba7de61376f8ec4ea850067dddfafe98274ae13c/rpds_py-0.27.1-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:2c426b99a068601b5f4623573df7a7c3d72e87533a2dd2253353a03e7502566c", size = 555959, upload-time = "2025-08-27T12:16:32.73Z" }, - { url = "https://files.pythonhosted.org/packages/60/94/384cf54c430b9dac742bbd2ec26c23feb78ded0d43d6d78563a281aec017/rpds_py-0.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:4fc9b7fe29478824361ead6e14e4f5aed570d477e06088826537e202d25fe859", size = 228784, upload-time = "2025-08-27T12:16:34.428Z" }, ] [[package]] @@ -2501,15 +2231,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/87/b8/01c29b924dcbbed75cc45b30c30d565d763b9c4d540545a0eeecffb8f09c/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4f6f3eac23941b32afccc23081e1f50612bdbe4e982012ef4f5797986828cd01", size = 709059, upload-time = "2024-12-11T19:58:18.846Z" }, { url = "https://files.pythonhosted.org/packages/30/8c/ed73f047a73638257aa9377ad356bea4d96125b305c34a28766f4445cc0f/ruamel.yaml.clib-0.2.12-cp313-cp313-win32.whl", hash = "sha256:6442cb36270b3afb1b4951f060eccca1ce49f3d087ca1ca4563a6eb479cb3de6", size = 98583, upload-time = "2024-10-20T10:13:09.658Z" }, { url = "https://files.pythonhosted.org/packages/b0/85/e8e751d8791564dd333d5d9a4eab0a7a115f7e349595417fd50ecae3395c/ruamel.yaml.clib-0.2.12-cp313-cp313-win_amd64.whl", hash = "sha256:e5b8daf27af0b90da7bb903a876477a9e6d7270be6146906b276605997c7e9a3", size = 115190, upload-time = "2024-10-20T10:13:10.66Z" }, - { url = "https://files.pythonhosted.org/packages/e5/46/ccdef7a84ad745c37cb3d9a81790f28fbc9adf9c237dba682017b123294e/ruamel.yaml.clib-0.2.12-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:fc4b630cd3fa2cf7fce38afa91d7cfe844a9f75d7f0f36393fa98815e911d987", size = 131834, upload-time = "2024-10-20T10:13:11.72Z" }, - { url = "https://files.pythonhosted.org/packages/29/09/932360f30ad1b7b79f08757e0a6fb8c5392a52cdcc182779158fe66d25ac/ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bc5f1e1c28e966d61d2519f2a3d451ba989f9ea0f2307de7bc45baa526de9e45", size = 636120, upload-time = "2024-10-20T10:13:12.84Z" }, - { url = "https://files.pythonhosted.org/packages/a2/2a/5b27602e7a4344c1334e26bf4739746206b7a60a8acdba33a61473468b73/ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a0e060aace4c24dcaf71023bbd7d42674e3b230f7e7b97317baf1e953e5b519", size = 724914, upload-time = "2024-10-20T10:13:14.605Z" }, - { url = "https://files.pythonhosted.org/packages/da/1c/23497017c554fc06ff5701b29355522cff850f626337fff35d9ab352cb18/ruamel.yaml.clib-0.2.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2f1c3765db32be59d18ab3953f43ab62a761327aafc1594a2a1fbe038b8b8a7", size = 689072, upload-time = "2024-10-20T10:13:15.939Z" }, - { url = "https://files.pythonhosted.org/packages/68/e6/f3d4ff3223f9ea49c3b7169ec0268e42bd49f87c70c0e3e853895e4a7ae2/ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d85252669dc32f98ebcd5d36768f5d4faeaeaa2d655ac0473be490ecdae3c285", size = 667091, upload-time = "2024-10-21T11:26:52.274Z" }, - { url = "https://files.pythonhosted.org/packages/84/62/ead07043527642491e5011b143f44b81ef80f1025a96069b7210e0f2f0f3/ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e143ada795c341b56de9418c58d028989093ee611aa27ffb9b7f609c00d813ed", size = 699111, upload-time = "2024-10-21T11:26:54.294Z" }, - { url = "https://files.pythonhosted.org/packages/52/b3/fe4d84446f7e4887e3bea7ceff0a7df23790b5ed625f830e79ace88ebefb/ruamel.yaml.clib-0.2.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2c59aa6170b990d8d2719323e628aaf36f3bfbc1c26279c0eeeb24d05d2d11c7", size = 666365, upload-time = "2024-12-11T19:58:20.444Z" }, - { url = "https://files.pythonhosted.org/packages/6e/b3/7feb99a00bfaa5c6868617bb7651308afde85e5a0b23cd187fe5de65feeb/ruamel.yaml.clib-0.2.12-cp39-cp39-win32.whl", hash = "sha256:beffaed67936fbbeffd10966a4eb53c402fafd3d6833770516bf7314bc6ffa12", size = 100863, upload-time = "2024-10-20T10:13:17.244Z" }, - { url = "https://files.pythonhosted.org/packages/93/07/de635108684b7a5bb06e432b0930c5a04b6c59efe73bd966d8db3cc208f2/ruamel.yaml.clib-0.2.12-cp39-cp39-win_amd64.whl", hash = "sha256:040ae85536960525ea62868b642bdb0c2cc6021c9f9d507810c0c604e66f5a7b", size = 118653, upload-time = "2024-10-20T10:13:18.289Z" }, ] [[package]] @@ -2628,14 +2349,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/86/85/29d216002d4593c2ce1c0ec2cec46dda77bfbcd221e24caa6e85eff53d89/sqlalchemy-2.0.43-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9df7126fd9db49e3a5a3999442cc67e9ee8971f3cb9644250107d7296cb2a164", size = 3219363, upload-time = "2025-08-11T15:56:39.11Z" }, { url = "https://files.pythonhosted.org/packages/b6/e4/bd78b01919c524f190b4905d47e7630bf4130b9f48fd971ae1c6225b6f6a/sqlalchemy-2.0.43-cp313-cp313-win32.whl", hash = "sha256:7f1ac7828857fcedb0361b48b9ac4821469f7694089d15550bbcf9ab22564a1d", size = 2096718, upload-time = "2025-08-11T15:55:05.349Z" }, { url = "https://files.pythonhosted.org/packages/ac/a5/ca2f07a2a201f9497de1928f787926613db6307992fe5cda97624eb07c2f/sqlalchemy-2.0.43-cp313-cp313-win_amd64.whl", hash = "sha256:971ba928fcde01869361f504fcff3b7143b47d30de188b11c6357c0505824197", size = 2123200, upload-time = "2025-08-11T15:55:07.932Z" }, - { url = "https://files.pythonhosted.org/packages/92/95/ddb5acf74a71e0fa4f9410c7d8555f169204ae054a49693b3cd31d0bf504/sqlalchemy-2.0.43-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ceb5c832cc30663aeaf5e39657712f4c4241ad1f638d487ef7216258f6d41fe7", size = 2136445, upload-time = "2025-08-12T17:29:06.145Z" }, - { url = "https://files.pythonhosted.org/packages/ea/d4/7d7ea7dfbc1ddb0aa54dd63a686cd43842192b8e1bfb5315bb052925f704/sqlalchemy-2.0.43-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11f43c39b4b2ec755573952bbcc58d976779d482f6f832d7f33a8d869ae891bf", size = 2126411, upload-time = "2025-08-12T17:29:08.138Z" }, - { url = "https://files.pythonhosted.org/packages/07/bd/123ba09bec14112de10e49d8835e6561feb24fd34131099d98d28d34f106/sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:413391b2239db55be14fa4223034d7e13325a1812c8396ecd4f2c08696d5ccad", size = 3221776, upload-time = "2025-08-11T16:00:30.938Z" }, - { url = "https://files.pythonhosted.org/packages/ae/35/553e45d5b91b15980c13e1dbcd7591f49047589843fff903c086d7985afb/sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c379e37b08c6c527181a397212346be39319fb64323741d23e46abd97a400d34", size = 3221665, upload-time = "2025-08-12T17:29:11.307Z" }, - { url = "https://files.pythonhosted.org/packages/07/4d/ff03e516087251da99bd879b5fdb2c697ff20295c836318dda988e12ec19/sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:03d73ab2a37d9e40dec4984d1813d7878e01dbdc742448d44a7341b7a9f408c7", size = 3160067, upload-time = "2025-08-11T16:00:33.148Z" }, - { url = "https://files.pythonhosted.org/packages/ae/88/cbc7caa186ecdc5dea013e9ccc00d78b93a6638dc39656a42369a9536458/sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8cee08f15d9e238ede42e9bbc1d6e7158d0ca4f176e4eab21f88ac819ae3bd7b", size = 3184462, upload-time = "2025-08-12T17:29:14.919Z" }, - { url = "https://files.pythonhosted.org/packages/ab/69/f8bbd43080b6fa75cb44ff3a1cc99aaae538dd0ade1a58206912b2565d72/sqlalchemy-2.0.43-cp39-cp39-win32.whl", hash = "sha256:b3edaec7e8b6dc5cd94523c6df4f294014df67097c8217a89929c99975811414", size = 2104031, upload-time = "2025-08-11T15:48:56.453Z" }, - { url = "https://files.pythonhosted.org/packages/36/39/2ec1b0e7a4f44d833d924e7bfca8054c72e37eb73f4d02795d16d8b0230a/sqlalchemy-2.0.43-cp39-cp39-win_amd64.whl", hash = "sha256:227119ce0a89e762ecd882dc661e0aa677a690c914e358f0dd8932a2e8b2765b", size = 2128007, upload-time = "2025-08-11T15:48:57.872Z" }, { url = "https://files.pythonhosted.org/packages/b8/d9/13bdde6521f322861fab67473cec4b1cc8999f3871953531cf61945fad92/sqlalchemy-2.0.43-py3-none-any.whl", hash = "sha256:1681c21dd2ccee222c2fe0bef671d1aef7c504087c9c4e800371cfcc8ac966fc", size = 1924759, upload-time = "2025-08-11T15:39:53.024Z" }, ] @@ -2653,7 +2366,7 @@ name = "sse-starlette" version = "3.0.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "anyio", marker = "python_full_version >= '3.10'" }, + { name = "anyio" }, ] sdist = { url = "https://files.pythonhosted.org/packages/42/6f/22ed6e33f8a9e76ca0a412405f31abb844b779d52c5f96660766edcd737c/sse_starlette-3.0.2.tar.gz", hash = "sha256:ccd60b5765ebb3584d0de2d7a6e4f745672581de4f5005ab31c3a25d10b52b3a", size = 20985, upload-time = "2025-07-27T09:07:44.565Z" } wheels = [ @@ -2665,8 +2378,8 @@ name = "starlette" version = "0.48.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "anyio", marker = "python_full_version >= '3.10'" }, - { name = "typing-extensions", marker = "python_full_version >= '3.10' and python_full_version < '3.13'" }, + { name = "anyio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a7/a5/d6f429d43394057b67a6b5bbe6eae2f77a6bf7459d961fdb224bf206eee6/starlette-0.48.0.tar.gz", hash = "sha256:7e8cee469a8ab2352911528110ce9088fdc6a37d9876926e73da7ce4aa4c7a46", size = 2652949, upload-time = "2025-09-13T08:41:05.699Z" } wheels = [ @@ -2782,7 +2495,7 @@ dev = [ { name = "behave" }, { name = "black" }, { name = "dirty-equals" }, - { name = "mcp", marker = "python_full_version >= '3.10'" }, + { name = "mcp" }, { name = "mypy" }, { name = "openapi-python-client" }, { name = "pre-commit" }, @@ -2796,7 +2509,7 @@ test = [ { name = "aiohttp" }, { name = "behave" }, { name = "dirty-equals" }, - { name = "mcp", marker = "python_full_version >= '3.10'" }, + { name = "mcp" }, { name = "pytest" }, { name = "pytest-env" }, { name = "pytest-httpx" }, @@ -2828,7 +2541,7 @@ dev = [ { name = "dirty-equals", specifier = ">=0.10.0" }, { name = "mcp", marker = "python_full_version >= '3.10'", specifier = ">=1.1.0" }, { name = "mypy", specifier = "==1.13.0" }, - { name = "openapi-python-client", specifier = "==0.24.3" }, + { name = "openapi-python-client", specifier = "==0.28.1" }, { name = "pre-commit", specifier = "==4.0.1" }, { name = "pyiceberg", extras = ["sql-sqlite"], specifier = "==0.9.1" }, { name = "pytest", specifier = "==8.3.5" }, @@ -2861,18 +2574,17 @@ wheels = [ [[package]] name = "typer" -version = "0.15.3" +version = "0.21.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "click" }, { name = "rich" }, { name = "shellingham" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/98/1a/5f36851f439884bcfe8539f6a20ff7516e7b60f319bbaf69a90dc35cc2eb/typer-0.15.3.tar.gz", hash = "sha256:818873625d0569653438316567861899f7e9972f2e6e0c16dab608345ced713c", size = 101641, upload-time = "2025-04-28T21:40:59.204Z" } +sdist = { url = "https://files.pythonhosted.org/packages/36/bf/8825b5929afd84d0dabd606c67cd57b8388cb3ec385f7ef19c5cc2202069/typer-0.21.1.tar.gz", hash = "sha256:ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d", size = 110371, upload-time = "2026-01-06T11:21:10.989Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/48/20/9d953de6f4367163d23ec823200eb3ecb0050a2609691e512c8b95827a9b/typer-0.15.3-py3-none-any.whl", hash = "sha256:c86a65ad77ca531f03de08d1b9cb67cd09ad02ddddf4b34745b5008f43b239bd", size = 45253, upload-time = "2025-04-28T21:40:56.269Z" }, + { url = "https://files.pythonhosted.org/packages/a0/1d/d9257dd49ff2ca23ea5f132edf1281a0c4f9de8a762b9ae399b670a59235/typer-0.21.1-py3-none-any.whl", hash = "sha256:7985e89081c636b88d172c2ee0cfe33c253160994d47bdfdc302defd7d1f1d01", size = 47381, upload-time = "2026-01-06T11:21:09.824Z" }, ] [[package]] @@ -2919,9 +2631,9 @@ name = "uvicorn" version = "0.35.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, - { name = "h11", marker = "python_full_version >= '3.10'" }, - { name = "typing-extensions", marker = "python_full_version == '3.10.*'" }, + { name = "click" }, + { name = "h11" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/5e/42/e0e305207bb88c6b8d3061399c6a961ffe5fbb7e2aa63c9234df7259e9cd/uvicorn-0.35.0.tar.gz", hash = "sha256:bc662f087f7cf2ce11a1d7fd70b90c9f98ef2e2831556dd078d131b96cc94a01", size = 78473, upload-time = "2025-06-28T16:15:46.058Z" } wheels = [ @@ -2943,12 +2655,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/76/06/04c8e804f813cf972e3262f3f8584c232de64f0cde9f703b46cf53a45090/virtualenv-20.34.0-py3-none-any.whl", hash = "sha256:341f5afa7eee943e4984a9207c025feedd768baff6753cd660c857ceb3e36026", size = 5983279, upload-time = "2025-08-13T14:24:05.111Z" }, ] -[[package]] -name = "win-unicode-console" -version = "0.5" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/89/8d/7aad74930380c8972ab282304a2ff45f3d4927108bb6693cabcc9fc6a099/win_unicode_console-0.5.zip", hash = "sha256:d4142d4d56d46f449d6f00536a73625a871cba040f0bc1a2e305a04578f07d1e", size = 31420, upload-time = "2016-06-25T19:48:54.05Z" } - [[package]] name = "yarl" version = "1.20.1" @@ -3045,23 +2751,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/9e/ed/c5fb04869b99b717985e244fd93029c7a8e8febdfcffa06093e32d7d44e7/yarl-1.20.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:88cab98aa4e13e1ade8c141daeedd300a4603b7132819c484841bb7af3edce9e", size = 341709, upload-time = "2025-06-10T00:45:23.221Z" }, { url = "https://files.pythonhosted.org/packages/24/fd/725b8e73ac2a50e78a4534ac43c6addf5c1c2d65380dd48a9169cc6739a9/yarl-1.20.1-cp313-cp313t-win32.whl", hash = "sha256:b121ff6a7cbd4abc28985b6028235491941b9fe8fe226e6fdc539c977ea1739d", size = 86591, upload-time = "2025-06-10T00:45:25.793Z" }, { url = "https://files.pythonhosted.org/packages/94/c3/b2e9f38bc3e11191981d57ea08cab2166e74ea770024a646617c9cddd9f6/yarl-1.20.1-cp313-cp313t-win_amd64.whl", hash = "sha256:541d050a355bbbc27e55d906bc91cb6fe42f96c01413dd0f4ed5a5240513874f", size = 93003, upload-time = "2025-06-10T00:45:27.752Z" }, - { url = "https://files.pythonhosted.org/packages/01/75/0d37402d208d025afa6b5b8eb80e466d267d3fd1927db8e317d29a94a4cb/yarl-1.20.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e42ba79e2efb6845ebab49c7bf20306c4edf74a0b20fc6b2ccdd1a219d12fad3", size = 134259, upload-time = "2025-06-10T00:45:29.882Z" }, - { url = "https://files.pythonhosted.org/packages/73/84/1fb6c85ae0cf9901046f07d0ac9eb162f7ce6d95db541130aa542ed377e6/yarl-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:41493b9b7c312ac448b7f0a42a089dffe1d6e6e981a2d76205801a023ed26a2b", size = 91269, upload-time = "2025-06-10T00:45:32.917Z" }, - { url = "https://files.pythonhosted.org/packages/f3/9c/eae746b24c4ea29a5accba9a06c197a70fa38a49c7df244e0d3951108861/yarl-1.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f5a5928ff5eb13408c62a968ac90d43f8322fd56d87008b8f9dabf3c0f6ee983", size = 89995, upload-time = "2025-06-10T00:45:35.066Z" }, - { url = "https://files.pythonhosted.org/packages/fb/30/693e71003ec4bc1daf2e4cf7c478c417d0985e0a8e8f00b2230d517876fc/yarl-1.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c41ad5d717b3961b2dd785593b67d386b73feca30522048d37298fee981805", size = 325253, upload-time = "2025-06-10T00:45:37.052Z" }, - { url = "https://files.pythonhosted.org/packages/0f/a2/5264dbebf90763139aeb0b0b3154763239398400f754ae19a0518b654117/yarl-1.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:59febc3969b0781682b469d4aca1a5cab7505a4f7b85acf6db01fa500fa3f6ba", size = 320897, upload-time = "2025-06-10T00:45:39.962Z" }, - { url = "https://files.pythonhosted.org/packages/e7/17/77c7a89b3c05856489777e922f41db79ab4faf58621886df40d812c7facd/yarl-1.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d2b6fb3622b7e5bf7a6e5b679a69326b4279e805ed1699d749739a61d242449e", size = 340696, upload-time = "2025-06-10T00:45:41.915Z" }, - { url = "https://files.pythonhosted.org/packages/6d/55/28409330b8ef5f2f681f5b478150496ec9cf3309b149dab7ec8ab5cfa3f0/yarl-1.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:749d73611db8d26a6281086f859ea7ec08f9c4c56cec864e52028c8b328db723", size = 335064, upload-time = "2025-06-10T00:45:43.893Z" }, - { url = "https://files.pythonhosted.org/packages/85/58/cb0257cbd4002828ff735f44d3c5b6966c4fd1fc8cc1cd3cd8a143fbc513/yarl-1.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9427925776096e664c39e131447aa20ec738bdd77c049c48ea5200db2237e000", size = 327256, upload-time = "2025-06-10T00:45:46.393Z" }, - { url = "https://files.pythonhosted.org/packages/53/f6/c77960370cfa46f6fb3d6a5a79a49d3abfdb9ef92556badc2dcd2748bc2a/yarl-1.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff70f32aa316393eaf8222d518ce9118148eddb8a53073c2403863b41033eed5", size = 316389, upload-time = "2025-06-10T00:45:48.358Z" }, - { url = "https://files.pythonhosted.org/packages/64/ab/be0b10b8e029553c10905b6b00c64ecad3ebc8ace44b02293a62579343f6/yarl-1.20.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c7ddf7a09f38667aea38801da8b8d6bfe81df767d9dfc8c88eb45827b195cd1c", size = 340481, upload-time = "2025-06-10T00:45:50.663Z" }, - { url = "https://files.pythonhosted.org/packages/c5/c3/3f327bd3905a4916029bf5feb7f86dcf864c7704f099715f62155fb386b2/yarl-1.20.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:57edc88517d7fc62b174fcfb2e939fbc486a68315d648d7e74d07fac42cec240", size = 336941, upload-time = "2025-06-10T00:45:52.554Z" }, - { url = "https://files.pythonhosted.org/packages/d1/42/040bdd5d3b3bb02b4a6ace4ed4075e02f85df964d6e6cb321795d2a6496a/yarl-1.20.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:dab096ce479d5894d62c26ff4f699ec9072269d514b4edd630a393223f45a0ee", size = 339936, upload-time = "2025-06-10T00:45:54.919Z" }, - { url = "https://files.pythonhosted.org/packages/0d/1c/911867b8e8c7463b84dfdc275e0d99b04b66ad5132b503f184fe76be8ea4/yarl-1.20.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14a85f3bd2d7bb255be7183e5d7d6e70add151a98edf56a770d6140f5d5f4010", size = 360163, upload-time = "2025-06-10T00:45:56.87Z" }, - { url = "https://files.pythonhosted.org/packages/e2/31/8c389f6c6ca0379b57b2da87f1f126c834777b4931c5ee8427dd65d0ff6b/yarl-1.20.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2c89b5c792685dd9cd3fa9761c1b9f46fc240c2a3265483acc1565769996a3f8", size = 359108, upload-time = "2025-06-10T00:45:58.869Z" }, - { url = "https://files.pythonhosted.org/packages/7f/09/ae4a649fb3964324c70a3e2b61f45e566d9ffc0affd2b974cbf628957673/yarl-1.20.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:69e9b141de5511021942a6866990aea6d111c9042235de90e08f94cf972ca03d", size = 351875, upload-time = "2025-06-10T00:46:01.45Z" }, - { url = "https://files.pythonhosted.org/packages/8d/43/bbb4ed4c34d5bb62b48bf957f68cd43f736f79059d4f85225ab1ef80f4b9/yarl-1.20.1-cp39-cp39-win32.whl", hash = "sha256:b5f307337819cdfdbb40193cad84978a029f847b0a357fbe49f712063cfc4f06", size = 82293, upload-time = "2025-06-10T00:46:03.763Z" }, - { url = "https://files.pythonhosted.org/packages/d7/cd/ce185848a7dba68ea69e932674b5c1a42a1852123584bccc5443120f857c/yarl-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:eae7bfe2069f9c1c5b05fc7fe5d612e5bbc089a39309904ee8b829e322dcad00", size = 87385, upload-time = "2025-06-10T00:46:05.655Z" }, { url = "https://files.pythonhosted.org/packages/b4/2d/2345fce04cfd4bee161bf1e7d9cdc702e3e16109021035dbb24db654a622/yarl-1.20.1-py3-none-any.whl", hash = "sha256:83b8eb083fe4683c6115795d9fc1cfaf2cbbefb19b3a1cb68f6527460f483a77", size = 46542, upload-time = "2025-06-10T00:46:07.521Z" }, ]